Dependencies: nRF51822
Diff: Source/main.cpp
- Revision:
- 63:c321added5b1
- Parent:
- 60:6327aa30a10e
--- a/Source/main.cpp Wed Feb 24 16:03:57 2021 +0000 +++ b/Source/main.cpp Wed Jun 16 16:33:49 2021 +0000 @@ -235,18 +235,6 @@ start_periodic_tick(FAST_TICK_SEC); #if SKIP_SHIP_MODE // package_open_sense_enable = 1; - - // (cap is on) before going to in-use, adapt the cap_on threshold (iff the cap is on) - { - adaptive_active = true; - int i = 20; // multiple calls aallow it to adapt slowly to eliminate potencial noise. - while(i--) - { - test_cap(); - } - adaptive_active = false; - } - state = IN_USE_SETUP; #else state = POST; @@ -412,7 +400,7 @@ break; case IN_USE_SETUP: - flash_led(3, .25); + //flash_led(3, .25); start_periodic_tick(PERIODIC_TICK_SEC); debug("In Use\n"); if(NV_NOT_IN_USE) nv_clear(NV_NOT_IN_USE_ADDR); @@ -503,9 +491,6 @@ } while(state != last_state); } -const uint32_t tdoffset = 1604131200 + 4*3600; // - 0x00015180; // used so all records start at the same time/date (10/31/2020 8:00:00am - 1hr) - - void dataWasRead(void) { flash_led(1, 0.04); @@ -566,7 +551,7 @@ { uint16_t crc = crc16((const unsigned char*)CRC_START_ADDR, (uint32_t)(CRC_END_ADDR - CRC_START_ADDR + 1) ); BLE_UART_xmit("sm="); - BLE_UART_xmit(char2hex(crc, 4)); + BLE_UART_xmit(char2hex(crc+1, 4)); // added 1 to force CRC error - DEW 15JUN2021 BLE_UART_xmit("\n"); } break; @@ -644,23 +629,7 @@ } } break; - - case 'n': // set RTC - { - int i = 1; - uint32_t num = 0; - - while(cmd[i]>='0' && cmd[i]<='9') { - num = num*10 + cmd[i++]-'0'; - } - - if(i>1) { - set_rtc(num-tdoffset); - BLE_UART_xmit("*RTC Set\n"); - } - } - break; - + case 'v': // version BLE_UART_xmit("v="); BLE_UART_xmit(FW_VERSION);