diff --git a/include/config_data.h b/include/config_data.h index 88c6477..480a4aa 100644 --- a/include/config_data.h +++ b/include/config_data.h @@ -85,6 +85,9 @@ typedef struct __attribute__((aligned (4))) config_data_mode_t { typedef struct __attribute__((aligned (4))) config_data_basic_t { + #define ENGINEERING1 (1) + #define ENGINEERING1_INH_WX_PWR_HNDL (1 << 1) + char callsign[7]; uint8_t ssid; @@ -122,6 +125,18 @@ typedef struct __attribute__((aligned (4))) config_data_basic_t { uint8_t wx_double_transmit; + /** + * bit0 - must be set to zero to enable this engineering + * bit1 - inhibit 'wx_pwr_switch_periodic_handle' + * bit2 - + * bit3 - + * bit4 - + * bit5 - + * bit6 - + * bit7 - + */ + uint8_t engineering1; + } config_data_basic_t; typedef enum config_data_wx_sources_enum_t { diff --git a/include/configuration_handler.h b/include/configuration_handler.h index 9483e49..e4a1d77 100644 --- a/include/configuration_handler.h +++ b/include/configuration_handler.h @@ -38,4 +38,6 @@ void configuration_clear_bits_register(uint32_t value); configuration_handler_region_t configuration_get_current(uint32_t * size); const uint32_t * configuration_get_address(configuration_handler_region_t region); +int configuration_get_inhibit_wx_pwr_handle(void); + #endif /* CONFIGURATION_HANDLER_H_ */ diff --git a/include/main.h b/include/main.h index 395e261..e912cde 100644 --- a/include/main.h +++ b/include/main.h @@ -8,7 +8,7 @@ #include "config_data.h" #define SW_VER "EA16" -#define SW_DATE "17092022" +#define SW_DATE "19092022" #define SW_KISS_PROTO "A" #define SYSTICK_TICKS_PER_SECONDS 100 diff --git a/src/config_data_default.c b/src/config_data_default.c index 1b3859a..ac4c107 100644 --- a/src/config_data_default.c +++ b/src/config_data_default.c @@ -192,11 +192,16 @@ const config_data_basic_t __attribute__((section(".config_section_default.basic" #endif #ifdef _WX_DOUBLE_TRANSMIT - .wx_double_transmit = 1 + .wx_double_transmit = 1, #else - .wx_double_transmit = 0 + .wx_double_transmit = 0, #endif +#ifdef ENG1 + .engineering1 = ENG1 +#else + .engineering1 = 0xFF +#endif }; /** diff --git a/src/config_data_first.c b/src/config_data_first.c index c94e01d..0d2eb32 100644 --- a/src/config_data_first.c +++ b/src/config_data_first.c @@ -199,9 +199,15 @@ const config_data_basic_t __attribute__((section(".config_section_first.basic")) #endif #ifdef _WX_DOUBLE_TRANSMIT - .wx_double_transmit = 1 + .wx_double_transmit = 1, #else - .wx_double_transmit = 0 + .wx_double_transmit = 0, +#endif + +#ifdef ENG1 + .engineering1 = ENG1 +#else + .engineering1 = 0xFF #endif }; diff --git a/src/config_data_second.c b/src/config_data_second.c index 5057b74..4cec7e9 100644 --- a/src/config_data_second.c +++ b/src/config_data_second.c @@ -193,9 +193,15 @@ const config_data_basic_t __attribute__((section(".config_section_second.basic") #endif #ifdef _WX_DOUBLE_TRANSMIT - .wx_double_transmit = 1 + .wx_double_transmit = 1, #else - .wx_double_transmit = 0 + .wx_double_transmit = 0, +#endif + +#ifdef ENG1 + .engineering1 = ENG1 +#else + .engineering1 = 0xFF #endif }; diff --git a/src/configuration_handler.c b/src/configuration_handler.c index 975fc1d..3994a70 100644 --- a/src/configuration_handler.c +++ b/src/configuration_handler.c @@ -814,3 +814,16 @@ const uint32_t * configuration_get_address(configuration_handler_region_t region } +int configuration_get_inhibit_wx_pwr_handle(void) { + + int out = 0; + + if ((main_config_data_basic->engineering1 & ENGINEERING1) == 0) { + if ((main_config_data_basic->engineering1 & ENGINEERING1_INH_WX_PWR_HNDL) != 0) { + out = 1; + } + } + + return out; +} + diff --git a/src/main.c b/src/main.c index e648344..7d14077 100644 --- a/src/main.c +++ b/src/main.c @@ -289,15 +289,6 @@ const char * post_content = "{\ \"rte_main_going_sleep_count\": 2,\ \"rte_main_last_sleep_master_time\": 9}"; -static void dupa(uint16_t http_code, char * content, uint16_t content_lenght) { - - if (http_code == 200) { - if (content_lenght > 0) { - kiss10m++; - } - } -} - //#define SERIAL_TX_TEST_MODE int main(int argc, char* argv[]){ @@ -1356,9 +1347,11 @@ int main(int argc, char* argv[]){ */ if (main_two_second_pool_timer < 10) { - wx_check_force_i2c_reset(); + if (configuration_get_inhibit_wx_pwr_handle() == 0) { + wx_pwr_switch_periodic_handle(); + } - wx_pwr_switch_periodic_handle(); + wx_check_force_i2c_reset(); #ifdef INTERNAL_WATCHDOG IWDG_ReloadCounter(); diff --git a/system/src/gsm/sim800c.c b/system/src/gsm/sim800c.c index 28d1912..0b43e7f 100644 --- a/system/src/gsm/sim800c.c +++ b/system/src/gsm/sim800c.c @@ -27,14 +27,14 @@ static const char * GET_REGISTERED_NETWORK = "AT+COPS?\r\0"; extern const char * START_CONFIG_APN; static const char * TRANSPARENT_MODE_ON = "AT+CIPMODE=1\r\0"; -static const char * TRANSPARENT_MODE_OFF = "AT+CIPMODE=0\r\0"; +//static const char * TRANSPARENT_MODE_OFF = "AT+CIPMODE=0\r\0"; static const char * OK = "OK\r\n\0"; static const char * SIGNAL_LEVEL = "+CSQ:\0"; static const char * NETWORK_REGISTRATION = "+CREG:\0"; static const char * CPIN = "+CPIN:\0"; -static const char * CPIN_READY = "READY"; -static const char * CPIN_SIMPIN = "SIMPIN"; +//static const char * CPIN_READY = "READY"; +//static const char * CPIN_SIMPIN = "SIMPIN"; static const char * REGISTERED_NETWORK = "+COPS:\0"; static const char * INCOMING_CALL = "RING\0"; #define INCOMING_CALL_LN 4 diff --git a/system/src/gsm/sim800c_tcpip.c b/system/src/gsm/sim800c_tcpip.c index db01722..a4a3aab 100644 --- a/system/src/gsm/sim800c_tcpip.c +++ b/system/src/gsm/sim800c_tcpip.c @@ -16,11 +16,11 @@ const static char * NEWLINE = "\r\0"; const static char * CLOSE_TCP = "AT+CIPCLOSE\r\0"; -static const char * ESCAPE = "+++\0"; +//static const char * ESCAPE = "+++\0"; #define CONNECT_LN 13 static const char * CONNECT = "OK\r\n\r\nCONNECT\0"; -static const char * OK = "OK\0"; +//static const char * OK = "OK\0"; #define DISCONNECTED_LN 6 static const char * DISCONNECTED = "CLOSED\0";