make style
This commit is contained in:
1 parent
e3ec14f437
commit
648cbf159c
8 files changed
+37
-31
No files matched your search
@@ -356,7 +356,10 @@ static void handle_packet(const char *s, size_t len) {
|
||||
}
|
||||
switch (s[0]) {
|
||||
case '?':
|
||||
case 'c': case 'C': case 's': case 'S': // no execution control
|
||||
case 'c':
|
||||
case 'C':
|
||||
case 's':
|
||||
case 'S': // no execution control
|
||||
send_str("S05");
|
||||
break;
|
||||
case 'g': // registers are not available
|
||||
@@ -367,7 +370,9 @@ static void handle_packet(const char *s, size_t len) {
|
||||
memset(s_out, '0', 8);
|
||||
send_payload(s_out, 8);
|
||||
break;
|
||||
case 'H': case 'T': case 'D':
|
||||
case 'H':
|
||||
case 'T':
|
||||
case 'D':
|
||||
send_str("OK");
|
||||
break;
|
||||
case 'm':
|
||||
@@ -376,7 +381,8 @@ static void handle_packet(const char *s, size_t len) {
|
||||
case 'M':
|
||||
do_mem_write(s + 1, s + len);
|
||||
break;
|
||||
case 'G': case 'P': // registers are read-only
|
||||
case 'G':
|
||||
case 'P': // registers are read-only
|
||||
send_err(0x01);
|
||||
break;
|
||||
case 'v':
|
||||
|
||||
@@ -258,13 +258,13 @@ def run_reset_step(counter_index: str, delay_bd: int, delay_00: int) -> None:
|
||||
|
||||
def tune_delay(delay_bd: int, previous_counter: int, current_counter: int, locked: bool) -> int:
|
||||
"""Tune BD delay based on counter changes.
|
||||
|
||||
|
||||
Args:
|
||||
delay_bd: Current BD delay in microseconds
|
||||
previous_counter: Previous counter value for comparison
|
||||
current_counter: Current counter value
|
||||
locked: If True, delay is locked and not adjusted
|
||||
|
||||
|
||||
Returns:
|
||||
Adjusted delay_bd value
|
||||
"""
|
||||
@@ -375,7 +375,7 @@ class StopListener:
|
||||
|
||||
def calibrate_bd_delay(counter_index: str, stop: StopListener) -> Tuple[Optional[int], Optional[int]]:
|
||||
"""Auto-calibrate BD delay for tear-off.
|
||||
|
||||
|
||||
Returns:
|
||||
Tuple of (delay_bd, delay_00) where delay_00 is calculated as delay_bd - DELAY_00_OFFSET,
|
||||
or (None, None) if calibration failed.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Tag contents (NTAG) are encrypted are contain a security record computed from card UUID,
|
||||
# therefore cloning a card contents to another one will not work and such tag will be rejected by a printer.
|
||||
|
||||
# You need a Proxmark3 card dump in PM3 bin or json file. Patching will modify this dump so you need to
|
||||
# You need a Proxmark3 card dump in PM3 bin or json file. Patching will modify this dump so you need to
|
||||
# upload it again to a card.
|
||||
|
||||
# Note that Niimbot mobile app keeps copy of those values on their servers so resetting the tag print counter
|
||||
@@ -184,7 +184,7 @@ class LabelTag:
|
||||
field_value = pack("<B", value)
|
||||
self.vendor_data[offset : offset + 1] = field_value
|
||||
|
||||
def uint32_to_field(self, offset, value: int) -> None:
|
||||
def uint32_to_field(self, offset, value: int) -> None:
|
||||
field_value = pack("<I", value)
|
||||
self.vendor_data[offset : offset + 4] = field_value
|
||||
|
||||
@@ -279,7 +279,7 @@ class LabelTag:
|
||||
@print_counter_crc32.setter
|
||||
def print_counter_crc32(self, value:int):
|
||||
return self.uint32_to_field(self.PRINT_COUNTER_CRC32_OFFSET, value)
|
||||
|
||||
|
||||
|
||||
@property
|
||||
def print_limit(self) -> int:
|
||||
|
||||
@@ -1840,7 +1840,7 @@ static int calypso_select_file_id_with_p1_fallback(uint16_t file_id, bool check_
|
||||
sAPDU_t apdu = {0x00, ISO7816_SELECT_FILE, CALYPSO_SELECT_CURRENT_DF_P1, CALYPSO_SELECT_CURRENT_DF_P2, sizeof(file_id_data), file_id_data};
|
||||
int res = calypso_exchange_select(apdu, response);
|
||||
if (res != PM3_SUCCESS || (calypso_select_sw_has_file(response->sw) &&
|
||||
(check_lid == false || calypso_fcp_matches_lid(response->data, response->len, file_id)))) {
|
||||
(check_lid == false || calypso_fcp_matches_lid(response->data, response->len, file_id)))) {
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1878,12 +1878,12 @@ static int calypso_select_file_path(const uint16_t *path, size_t path_len, calyp
|
||||
|
||||
static int calypso_select_file_path_then_id_fallback(const uint16_t *path, size_t path_len, uint16_t file_id, const calypso_dump_profile_t *profile, calypso_apdu_response_t *response) {
|
||||
const calypso_dump_node_t *node = calypso_dump_profile_unique_lid_node(profile,
|
||||
&(calypso_dump_node_t) {.has_select_lid = true, .select_lid = file_id});
|
||||
&(calypso_dump_node_t) {.has_select_lid = true, .select_lid = file_id});
|
||||
bool check_lid = node != NULL && node->select_aid_len > 0;
|
||||
if (path != NULL && path_len > 0) {
|
||||
int res = calypso_select_file_path(path, path_len, response);
|
||||
if (res != PM3_SUCCESS || (calypso_select_sw_has_file(response->sw) &&
|
||||
(check_lid == false || calypso_fcp_matches_lid(response->data, response->len, file_id)))) {
|
||||
(check_lid == false || calypso_fcp_matches_lid(response->data, response->len, file_id)))) {
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1893,7 +1893,7 @@ static int calypso_select_file_path_then_id_fallback(const uint16_t *path, size_
|
||||
const uint16_t legacy_path[] = {file_id, file_id};
|
||||
res = calypso_select_file_path(legacy_path, ARRAYLEN(legacy_path), response);
|
||||
if (res != PM3_SUCCESS || (calypso_select_sw_has_file(response->sw) &&
|
||||
(check_lid == false || calypso_fcp_matches_lid(response->data, response->len, file_id)))) {
|
||||
(check_lid == false || calypso_fcp_matches_lid(response->data, response->len, file_id)))) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9217,7 +9217,7 @@ static void DesfireViewPrintApp(const desfire_dump_app_t *app) {
|
||||
}
|
||||
|
||||
static int desfire_etest_probe_result(const PacketResponseNG *resp, bool json,
|
||||
char *fields, size_t fields_len);
|
||||
char *fields, size_t fields_len);
|
||||
|
||||
static int CmdHF14ADesSim(const char *Cmd) {
|
||||
CLIParserContext *ctx;
|
||||
@@ -9332,7 +9332,7 @@ static void desfire_etest_hex(char *dst, size_t dstlen, const uint8_t *src, size
|
||||
}
|
||||
|
||||
static int desfire_etest_probe_result(const PacketResponseNG *resp, bool json,
|
||||
char *fields, size_t fields_len) {
|
||||
char *fields, size_t fields_len) {
|
||||
if (resp->length != sizeof(desfire_sim_probe_result_t)) {
|
||||
return PM3_EFAILED;
|
||||
}
|
||||
|
||||
+2
-2
@@ -4338,7 +4338,7 @@
|
||||
"notes": [
|
||||
"hf gp aids",
|
||||
"hf gp aids --quick -> only prefixes from aidlist.json",
|
||||
"hf gp aids --prefix 5849414F4D -> only AIDs under this prefix",
|
||||
"hf gp aids --prefix A000000151 -> only AIDs under this prefix",
|
||||
"hf gp aids -w -> use contact interface"
|
||||
],
|
||||
"offline": true,
|
||||
@@ -16885,6 +16885,6 @@
|
||||
"metadata": {
|
||||
"commands_extracted": 940,
|
||||
"extracted_by": "PM3Help2JSON v1.00",
|
||||
"extracted_on": "2026-11-09T03:44:51+00:00"
|
||||
"extracted_on": "2026-11-09T05:12:17+00:00"
|
||||
}
|
||||
}
|
||||
@@ -28,23 +28,23 @@ module fpga_hf(
|
||||
//input pck0,
|
||||
input ncs,
|
||||
input [7:0] adc_d,
|
||||
//input cross_hi,
|
||||
//input cross_hi,
|
||||
//input cross_lo,
|
||||
input mosi,
|
||||
input ssp_dout,
|
||||
input ce, // 复位输入,常态高
|
||||
|
||||
|
||||
output ssp_din,
|
||||
output ssp_frame,
|
||||
output ssp_clk,
|
||||
output adc_clk,
|
||||
output adc_clk,
|
||||
//output adc_noe,
|
||||
output miso,
|
||||
output pwr_lo,
|
||||
output pwr_lo,
|
||||
output pwr_hi,
|
||||
output pwr_oe1,
|
||||
output pwr_oe2,
|
||||
//output pwr_oe3,
|
||||
output pwr_oe1,
|
||||
output pwr_oe2,
|
||||
//output pwr_oe3,
|
||||
output pwr_oe4,
|
||||
output dbg,
|
||||
output reg [11:0] pwm_duty = 12'h800
|
||||
|
||||
@@ -26,7 +26,7 @@ module fpga_top (
|
||||
input spi_mosi,
|
||||
input ssp_dout,
|
||||
input module_sel, // module select: 1 = HF, 0 = LF
|
||||
|
||||
|
||||
output ssp_din,
|
||||
output ssp_frame,
|
||||
output ssp_clk,
|
||||
@@ -46,7 +46,7 @@ module fpga_top (
|
||||
output pan_en, // analog supply enable
|
||||
output pdp_en // boost converter enable
|
||||
);
|
||||
|
||||
|
||||
wire ce_lf = ~module_sel; // enable, active high; a low level holds the module in reset
|
||||
wire ce_hf = module_sel; // enable, active high; a low level holds the module in reset
|
||||
//-----------------------------------------GATE-------------------------
|
||||
@@ -56,10 +56,10 @@ module fpga_top (
|
||||
gate_en_sync1 <= gate_en;
|
||||
gate_en_sync2 <= gate_en_sync1;
|
||||
end
|
||||
|
||||
|
||||
assign clk_gate = ~gate_en_sync2; // inverted, the external gate is active low
|
||||
//-----------------------------------------PWM--------------------------
|
||||
|
||||
|
||||
// CLKOUT is 200 MHz: 4096 steps at 5 ns keep the resolution, at a 20.48 us
|
||||
// period. 400 MHz does not close the 12 bit carry chain at 2.5 ns.
|
||||
Gowin_rPLL pwr_pwm_pll(
|
||||
@@ -107,7 +107,7 @@ module fpga_top (
|
||||
.mosi(spi_mosi),
|
||||
.ssp_dout(ssp_dout),
|
||||
.ce(ce_lf),
|
||||
|
||||
|
||||
.ssp_din(ssp_din_lf),
|
||||
.ssp_frame(ssp_frame_lf),
|
||||
.ssp_clk(ssp_clk_lf),
|
||||
@@ -132,7 +132,7 @@ module fpga_top (
|
||||
.mosi(spi_mosi),
|
||||
.ssp_dout(ssp_dout),
|
||||
.ce(ce_hf),
|
||||
|
||||
|
||||
.ssp_din(ssp_din_hf),
|
||||
.ssp_frame(ssp_frame_hf),
|
||||
.ssp_clk(ssp_clk_hf),
|
||||
@@ -161,4 +161,4 @@ module fpga_top (
|
||||
assign dbg1 = ~module_sel ? dbg_lf : dbg_hf;
|
||||
assign pwm_duty = ~module_sel ? pwm_duty_lf : pwm_duty_hf;
|
||||
|
||||
endmodule
|
||||
endmodule
|
||||
Reference in new issue
Block a user