diff --git a/sid-A10001986/sid-A10001986.ino b/sid-A10001986/sid-A10001986.ino index 66ea76d..c1c6200 100644 --- a/sid-A10001986/sid-A10001986.ino +++ b/sid-A10001986/sid-A10001986.ino @@ -104,6 +104,11 @@ /* Changelog * + * 2024/09/13 (A10001986) + * - Command *50 is now *60, command *51 is now *61 + * (Changed for uniformity with other props) + * 2024/09/11 (A10001986) + * - Fix C99-compliance * 2024/09/09 (A10001986) * - Tune BTTFN poll interval * 2024/08/28 (A10001986) diff --git a/sid-A10001986/sid_global.h b/sid-A10001986/sid_global.h index bc20430..1e444ee 100644 --- a/sid-A10001986/sid_global.h +++ b/sid-A10001986/sid_global.h @@ -12,8 +12,8 @@ #define _SID_GLOBAL_H // Version strings -#define SID_VERSION "V1.24" -#define SID_VERSION_EXTRA "SEP092024" +#define SID_VERSION "V1.3" +#define SID_VERSION_EXTRA "SEP132024" //#define SID_DBG // debug output on Serial diff --git a/sid-A10001986/sid_main.cpp b/sid-A10001986/sid_main.cpp index d4afeae..38e26f0 100644 --- a/sid-A10001986/sid_main.cpp +++ b/sid-A10001986/sid_main.cpp @@ -412,6 +412,19 @@ static uint32_t commandQueue[16] = { 0 }; static uint8_t bttfnDateBuf[8] = { 0xff }; static unsigned long bttfnDateNow = 0; +#define GET32(a,b) \ + (((a)[b]) | \ + (((a)[(b)+1]) << 8) | \ + (((a)[(b)+2]) << 16) | \ + (((a)[(b)+3]) << 24)) +//#define GET32(a,b) *((uint32_t *)((a) + (b))) +#define SET32(a,b,c) \ + (a)[b] = ((uint32_t)(c)) & 0xff; \ + ((a)[(b)+1]) = ((uint32_t)(c)) >> 8; \ + ((a)[(b)+2]) = ((uint32_t)(c)) >> 16; \ + ((a)[(b)+3]) = ((uint32_t)(c)) >> 24; +//#define SET32(a,b,c) *((uint32_t *)((a) + (b))) = c + // Forward declarations ------ static void startIRLearn(); @@ -2191,12 +2204,14 @@ static bool execute(bool isIR) snake_start(); } break; - case 50: // *50 enable/disable strict mode + case 50: // *50(deprecated) + case 60: // *60 enable/disable strict mode if(!TTrunning && !isIRLocked) { toggleStrictMode(); } break; - case 51: // *51 enable/disable "peaks" in Spectrum Analyzer + case 51: // *51(deprecated)) + case 61: // *61 enable/disable "peaks" in Spectrum Analyzer if(!TTrunning && !isIRLocked) { doPeaks = !doPeaks; } @@ -2761,7 +2776,8 @@ static void BTTFNCheckPacket() // (Possibly) a response packet - if(*((uint32_t *)(BTTFUDPBuf + 6)) != BTTFUDPID) + //if(*((uint32_t *)(BTTFUDPBuf + 6)) != BTTFUDPID) + if(GET32(BTTFUDPBuf, 6) != BTTFUDPID) return; // Response marker missing or wrong version, bail @@ -2841,7 +2857,9 @@ static void BTTFNSendPacket() memcpy(BTTFUDPBuf, BTTFUDPHD, 4); // Serial - *((uint32_t *)(BTTFUDPBuf + 6)) = BTTFUDPID = (uint32_t)millis(); + BTTFUDPID = (uint32_t)millis(); + SET32(BTTFUDPBuf, 6, BTTFUDPID); + //*((uint32_t *)(BTTFUDPBuf + 6)) = // Tell the TCD about our hostname (0-term., 13 bytes total) strncpy((char *)BTTFUDPBuf + 10, settings.hostName, 12); @@ -2855,7 +2873,8 @@ static void BTTFNSendPacket() #ifdef BTTFN_MC if(!haveTCDIP) { BTTFUDPBuf[5] |= 0x80; - memcpy(BTTFUDPBuf + 31, (void *)&tcdHostNameHash, 4); + //memcpy(BTTFUDPBuf + 31, (void *)&tcdHostNameHash, 4); + SET32(BTTFUDPBuf, 31, tcdHostNameHash); } #endif