diff --git a/armsrc/thinfilm.c b/armsrc/thinfilm.c index 1c86cfe0f..625c10247 100644 --- a/armsrc/thinfilm.c +++ b/armsrc/thinfilm.c @@ -60,6 +60,11 @@ void ReadThinFilm(void) { #define SEC_E 0x0f #define SEC_F 0x00 +// Frame delimiter. A reader needs some unmodulated carrier to find the start of a +// frame (our own demod wants three quiet bytes), but a Kovio tag is only read by +// landing a frame inside the reader's poll slot, so keep the gap short. +#define THINFILM_FRAME_GAP_US 500 + // A 32 sample average costs about 3.8 ms, since every sample pays a 42.7 us ADC // startup and a 40 us sample & hold. That is fine once, for the baseline, but in // the send loop it costs more than the deliberate inter frame delay and nearly @@ -231,13 +236,7 @@ void SimulateThinFilm(uint8_t *data, size_t len) { // one tosend byte == one 106 kbit/s bit == 8 ssp clk ticks LogTrace(data, len, start_time * 16, (start_time + (ts->max * 8)) * 16, NULL, false); - if (len == 16) { - // wait 3.6ms - SpinDelayUs(3600); - } else { - // wait 2.4ms - SpinDelayUs(2400); - } + SpinDelayUs(THINFILM_FRAME_GAP_US); } } diff --git a/client/src/cmdhfthinfilm.c b/client/src/cmdhfthinfilm.c index c7433e1d2..e13badb05 100644 --- a/client/src/cmdhfthinfilm.c +++ b/client/src/cmdhfthinfilm.c @@ -212,7 +212,7 @@ static int CmdHfThinFilmList(const char *Cmd) { static command_t CommandTable[] = { {"help", CmdHelp, AlwaysAvailable, "This help"}, {"info", CmdHfThinFilmInfo, IfPm3NfcBarcode, "Tag information"}, - {"list", CmdHfThinFilmList, AlwaysAvailable, "List NFC Barcode / Thinfilm history - not correct"}, + {"list", CmdHfThinFilmList, AlwaysAvailable, "List NFC Barcode / Thinfilm history"}, {"sim", CmdHfThinFilmSim, IfPm3NfcBarcode, "Fake Thinfilm tag"}, {NULL, NULL, NULL, NULL} }; diff --git a/doc/commands.json b/doc/commands.json index 1f94cb5e9..d57042d8d 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -10474,7 +10474,7 @@ }, "hf thinfilm help": { "command": "hf thinfilm help", - "description": "help This help list List NFC Barcode / Thinfilm history - not correct --------------------------------------------------------------------------------------- hf thinfilm info available offline: no Get info from Thinfilm tags", + "description": "help This help list List NFC Barcode / Thinfilm history --------------------------------------------------------------------------------------- hf thinfilm info available offline: no Get info from Thinfilm tags", "notes": [ "hf thinfilm info" ], @@ -10927,6 +10927,20 @@ ], "usage": "hw bwm autooff [-h]" }, + "hw bwm name": { + "command": "hw bwm name", + "description": "Get or set the BWM BLE advertising name (stored on the BWM, in NVS). With no --set, prints the current name. Setting a name stores it and reboots the BWM to apply it - this briefly drops a BLE/WiFi connection; reconnect after a few seconds. Over USB the reboot is not noticeable.", + "notes": [ + "hw bwm name -> show current BLE name", + "hw bwm name --set MyPM5 -> set BLE name to 'MyPM5'" + ], + "offline": false, + "options": [ + "-h, --help This help", + "--set new BLE name (1-31 chars); omit to read current name" + ], + "usage": "hw bwm name [-h] [--set ]" + }, "hw bwm setcap": { "command": "hw bwm setcap", "description": "Program the BWM fuel gauge (BQ27427) Design Capacity for the fitted cell. Run ONCE after fitting or replacing the battery. This triggers a gauge config-update; do not run it repeatedly, as that disrupts the Impedance Track learning cycle. PM5 only.", @@ -16494,8 +16508,8 @@ } }, "metadata": { - "commands_extracted": 918, + "commands_extracted": 919, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2026-09-11T13:13:54+00:00" + "extracted_on": "2026-09-12T12:14:59+00:00" } } diff --git a/doc/commands.md b/doc/commands.md index 8446cbe64..c24866717 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -938,7 +938,7 @@ Check column "offline" for their availability. |------- |------- |----------- |`hf thinfilm help `|Y |`This help` |`hf thinfilm info `|N |`Tag information` -|`hf thinfilm list `|Y |`List NFC Barcode / Thinfilm history - not correct` +|`hf thinfilm list `|Y |`List NFC Barcode / Thinfilm history` |`hf thinfilm sim `|N |`Fake Thinfilm tag` @@ -1042,6 +1042,7 @@ Check column "offline" for their availability. |`hw bwm help `|Y |`This help` |`hw bwm autooff `|N |`Toggle auto power-off on USB unplug` |`hw bwm charge `|N |`Enable/disable battery charging (one-shot)` +|`hw bwm name `|N |`Get/set the BWM BLE advertising name` |`hw bwm setcap `|N |`Set fuel-gauge design capacity (run once after battery change)` |`hw bwm upgrade `|N |`Reflash BWM (ESP32) firmware over the BWM link, no header` |`hw bwm vchg `|N |`Set charger charge-voltage target (default 4100 mV)`