diff --git a/binaries/AP_FW_1.54.bin b/binaries/AP_FW_1.54.bin index 4ada9ee7..e7d55833 100644 Binary files a/binaries/AP_FW_1.54.bin and b/binaries/AP_FW_1.54.bin differ diff --git a/binaries/AP_FW_2.9.bin b/binaries/AP_FW_2.9.bin index b664e285..4174e0df 100644 Binary files a/binaries/AP_FW_2.9.bin and b/binaries/AP_FW_2.9.bin differ diff --git a/binaries/AP_FW_Nodisplay.bin b/binaries/AP_FW_Nodisplay.bin index 3b7d4468..891d6ed2 100644 Binary files a/binaries/AP_FW_Nodisplay.bin and b/binaries/AP_FW_Nodisplay.bin differ diff --git a/binaries/AP_FW_Pack.bin b/binaries/AP_FW_Pack.bin index e29ea531..d9bf54db 100644 Binary files a/binaries/AP_FW_Pack.bin and b/binaries/AP_FW_Pack.bin differ diff --git a/binaries/AP_FW_Segmented_UK.bin b/binaries/AP_FW_Segmented_UK.bin index 34d1d0a9..4f3c2ed8 100644 Binary files a/binaries/AP_FW_Segmented_UK.bin and b/binaries/AP_FW_Segmented_UK.bin differ diff --git a/binaries/Tag_FW_1.54.bin b/binaries/Tag_FW_1.54.bin index 2696f754..6f5e5479 100644 Binary files a/binaries/Tag_FW_1.54.bin and b/binaries/Tag_FW_1.54.bin differ diff --git a/binaries/Tag_FW_2.9-uc8151.bin b/binaries/Tag_FW_2.9-uc8151.bin index a65c106c..56d9514b 100644 Binary files a/binaries/Tag_FW_2.9-uc8151.bin and b/binaries/Tag_FW_2.9-uc8151.bin differ diff --git a/binaries/Tag_FW_2.9.bin b/binaries/Tag_FW_2.9.bin index 5e3396c3..f1d703b2 100644 Binary files a/binaries/Tag_FW_2.9.bin and b/binaries/Tag_FW_2.9.bin differ diff --git a/binaries/Tag_FW_4.2.bin b/binaries/Tag_FW_4.2.bin index cfe88d81..cd9ba81b 100644 Binary files a/binaries/Tag_FW_4.2.bin and b/binaries/Tag_FW_4.2.bin differ diff --git a/binaries/Tag_FW_Pack.bin b/binaries/Tag_FW_Pack.bin index 8a03bff4..059ee9e4 100644 Binary files a/binaries/Tag_FW_Pack.bin and b/binaries/Tag_FW_Pack.bin differ diff --git a/tag_types.h b/tag_types.h index 2f6981f5..9e86a0e3 100755 --- a/tag_types.h +++ b/tag_types.h @@ -6,6 +6,7 @@ #define SOLUM_SEG_EU 0xF1 #define SOLUM_NODISPLAY 0xFF +#define CAPABILITY_SUPPORTS_COMPRESSION 0x02 #define CAPABILITY_SUPPORTS_CUSTOM_LUTS 0x04 #define CAPABILITY_ALT_LUT_SIZE 0x08 #define CAPABILITY_HAS_EXT_POWER 0x10 @@ -30,4 +31,11 @@ #define CMD_DO_REBOOT 0 #define CMD_DO_SCAN 1 -#define CMD_DO_RESET_SETTINGS 2 \ No newline at end of file +#define CMD_DO_RESET_SETTINGS 2 + +#define WAKEUP_REASON_TIMED 0 +#define WAKEUP_REASON_GPIO 2 +#define WAKEUP_REASON_NFC 3 +#define WAKEUP_REASON_FIRSTBOOT 0xFC +#define WAKEUP_REASON_NETWORK_SCAN 0xFD +#define WAKEUP_REASON_WDT_RESET 0xFE \ No newline at end of file diff --git a/zbs243_AP_FW/builder.php b/zbs243_AP_FW/builder.php index 0cc11ca5..a0887ca9 100644 --- a/zbs243_AP_FW/builder.php +++ b/zbs243_AP_FW/builder.php @@ -23,8 +23,8 @@ $stackdisturbed = false; $mem = checkmem(); while(1){ $errlist = array(); - //exec("make BUILD=zbs154v033 CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist); - exec("make BUILD=zbs_segmented_uk CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist); + exec("make BUILD=zbs154_ssd1619 CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist); + //exec("make BUILD=zbs_segmented_uk CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist); if(checkmem()!=$mem){ $stackdisturbed = true; echo "Stack size was $mem, is now ".checkmem()." !!!\n"; diff --git a/zbs243_AP_FW/emulateTag.c b/zbs243_AP_FW/emulateTag.c index 0f897ba7..c0807b7e 100755 --- a/zbs243_AP_FW/emulateTag.c +++ b/zbs243_AP_FW/emulateTag.c @@ -163,8 +163,9 @@ void fakeTagCheckIn() { adr->lastPacketLQI = 100; adr->lastPacketRSSI = 100; adr->capabilities |= CAPABILITY_HAS_EXT_POWER; + adr->tagSoftwareVersion = 1; if (firstboot) { - adr->wakeupReason = 0xFC; + adr->wakeupReason = WAKEUP_REASON_FIRSTBOOT; firstboot = false; } else { adr->wakeupReason = 0; diff --git a/zbs243_AP_FW/main.c b/zbs243_AP_FW/main.c index 61e893f5..1a28048e 100755 --- a/zbs243_AP_FW/main.c +++ b/zbs243_AP_FW/main.c @@ -24,13 +24,13 @@ #include "emulateTag.h" #endif -#define MAX_PENDING_MACS 55 +#define MAX_PENDING_MACS 50 #define HOUSEKEEPING_INTERVAL 60UL struct pendingData __xdata pendingDataArr[MAX_PENDING_MACS]; // VERSION GOES HERE! -uint16_t __xdata version = 0x0016; +uint16_t __xdata version = 0x0017; #define RAW_PKT_PADDING 2 @@ -416,9 +416,9 @@ void espNotifyAPInfo() { countSlots(); pr("PEN>%02X\n", curPendingData); pr("NOP>%02X\n", curNoUpdate); -#if (AP_EMULATE_TAG == 1) - fakeTagCheckIn(); -#endif +//#if (AP_EMULATE_TAG == 1) +// fakeTagCheckIn(); // removed this for now to ensure IP info is properly displayed; first tag check in now happens after the first round of housekeeping (30s) +//#endif } // process data from tag @@ -741,6 +741,11 @@ void main(void) { switch (getPacketType(radiorxbuffer)) { case PKT_AVAIL_DATA_REQ: if (ret == 28) { + // old version of the AvailDataReq struct, set all the new fields to zero, so it will pass the CRC + processAvailDataReq(radiorxbuffer); + memset(radiorxbuffer + 1 + sizeof(struct MacFrameBcast) + sizeof(struct oldAvailDataReq), 0, sizeof(struct AvailDataReq) - sizeof(struct oldAvailDataReq) + 2); + } else if (ret == 40) { + // new version of the AvailDataReq struct processAvailDataReq(radiorxbuffer); } break; diff --git a/zbs243_Tag_FW/main.lk b/zbs243_Tag_FW/main.lk deleted file mode 100644 index c3616a4d..00000000 --- a/zbs243_Tag_FW/main.lk +++ /dev/null @@ -1,45 +0,0 @@ --muwx --i main.ihx --M --X 0x2000 --C 0xfc00 --b HOME = 0x0000 --b XSEG = 0xe000 --b PSEG = 0xe000 --b ISEG = 0x0000 --b BSEG = 0x0000 --k /usr/local/bin/../share/sdcc/lib/large --k /usr/local/share/sdcc/lib/large --l mcs51 --l libsdcc --l libint --l liblong --l libfloat -main.rel -eeprom.rel -drawing.rel -comms.rel -syncedproto.rel -userinterface.rel -powermgt.rel -barcode.rel -i2cdevices.rel -settings.rel -soc/zbs243/soc.rel -soc/zbs243/wdt.rel -soc/zbs243/sleep.rel -soc/zbs243/spi.rel -soc/zbs243/uart.rel -soc/zbs243/timer.rel -soc/zbs243/radio.rel -soc/zbs243/flash.rel -soc/zbs243/temperature.rel -cpu/8051/random.rel -cpu/8051/printf.rel -soc/zbs243/i2c.rel -cpu/8051/asmUtil.rel -cpu/8051/cpu.rel -board/zbs29_uc8151/board.rel -board/zbs29_uc8151/screen.rel - --e diff --git a/zbs243_Tag_FW/powermgt.h b/zbs243_Tag_FW/powermgt.h index 04ab8a47..e43a07ca 100755 --- a/zbs243_Tag_FW/powermgt.h +++ b/zbs243_Tag_FW/powermgt.h @@ -2,13 +2,6 @@ #define _POWERMGT_H_ #include -#define WAKEUP_REASON_TIMED 0 -#define WAKEUP_REASON_GPIO 2 -#define WAKEUP_REASON_NFC 3 -#define WAKEUP_REASON_FIRSTBOOT 0xFC -#define WAKEUP_REASON_NETWORK_SCAN 0xFD -#define WAKEUP_REASON_WDT_RESET 0xFE - #define DETECT_P1_0_NOTHING 0 #define DETECT_P1_0_BUTTON 1 #define DETECT_P1_0_JIG 2 diff --git a/zbs243_Tag_FW/settings.h b/zbs243_Tag_FW/settings.h index f765bd4d..7e822c22 100755 --- a/zbs243_Tag_FW/settings.h +++ b/zbs243_Tag_FW/settings.h @@ -3,8 +3,8 @@ #include -#define FW_VERSION 18 // version number (max 2.5.5 :) ) -#define FW_VERSION_SUFFIX "-RW" // suffix, like -RC1 or whatever. +#define FW_VERSION 19 // version number (max 2.5.5 :) ) +#define FW_VERSION_SUFFIX "-VER" // suffix, like -RC1 or whatever. // #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers // #define PRINT_LUT // uncomment if you want the tag to print the LUT for the current temperature bracket diff --git a/zbs243_Tag_FW/syncedproto.c b/zbs243_Tag_FW/syncedproto.c index b6b7f146..7cb8072f 100755 --- a/zbs243_Tag_FW/syncedproto.c +++ b/zbs243_Tag_FW/syncedproto.c @@ -196,6 +196,9 @@ static void sendAvailDataReq() { availreq->temperature = temperature; availreq->batteryMv = batteryVoltage; availreq->capabilities = capabilities; + availreq->tagSoftwareVersion = fwVersion; + availreq->currentChannel = currentChannel; + availreq->customMode = tagSettings.customMode; addCRC(availreq, sizeof(struct AvailDataReq)); commsTxNoCpy(outBuffer); } diff --git a/zbs243_Tag_FW/userinterface.c b/zbs243_Tag_FW/userinterface.c index 94affe74..3629019a 100755 --- a/zbs243_Tag_FW/userinterface.c +++ b/zbs243_Tag_FW/userinterface.c @@ -27,7 +27,7 @@ // extern uint8_t __xdata APmac[]; // extern uint16_t __xdata batteryVoltage; -const uint8_t __code fwVersion = FW_VERSION; +const uint16_t __code fwVersion = FW_VERSION; const char __code fwVersionSuffix[] = FW_VERSION_SUFFIX; extern uint8_t __xdata capabilities; diff --git a/zbs243_Tag_FW/userinterface.h b/zbs243_Tag_FW/userinterface.h index 4fb51f27..e3bc33b6 100755 --- a/zbs243_Tag_FW/userinterface.h +++ b/zbs243_Tag_FW/userinterface.h @@ -15,7 +15,7 @@ void showLongTermSleep(); void showNoEEPROM(); void showNoMAC(); -extern const uint8_t __code fwVersion; +extern const uint16_t __code fwVersion; extern const char __code fwVersionSuffix[]; extern bool __xdata lowBatteryShown; extern bool __xdata noAPShown; diff --git a/zbs243_shared/proto.h b/zbs243_shared/proto.h index 67f9d97a..161a761c 100755 --- a/zbs243_shared/proto.h +++ b/zbs243_shared/proto.h @@ -31,7 +31,6 @@ enum TagScreenType { TagScreenTypeOther = 0x7f, }; - #ifndef __packed #define __packed __attribute__((packed)) #endif @@ -110,9 +109,23 @@ struct AvailDataReq { uint16_t batteryMv; uint8_t hwType; uint8_t wakeupReason; - uint8_t capabilities; // undefined, as of now + uint8_t capabilities; + uint16_t tagSoftwareVersion; + uint8_t currentChannel; + uint8_t customMode; + uint8_t reserved[8]; } __packed; +struct oldAvailDataReq { + uint8_t checksum; + uint8_t lastPacketLQI; + int8_t lastPacketRSSI; + int8_t temperature; + uint16_t batteryMv; + uint8_t hwType; + uint8_t wakeupReason; + uint8_t capabilities; +} __packed; struct AvailDataInfo { uint8_t checksum; @@ -190,7 +203,6 @@ struct espSetChannelPower { uint8_t power; } __packed; - #define MACFMT "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" #define MACCVT(x) ((const uint8_t*)(x))[7], ((const uint8_t*)(x))[6], ((const uint8_t*)(x))[5], ((const uint8_t*)(x))[4], ((const uint8_t*)(x))[3], ((const uint8_t*)(x))[2], ((const uint8_t*)(x))[1], ((const uint8_t*)(x))[0]