config data: engineering to disable some stuff in the application

tatry_variant
Mateusz Lubecki 2022-09-19 19:00:11 +02:00
rodzic 827c797554
commit fe74e93c88
10 zmienionych plików z 63 dodań i 23 usunięć

Wyświetl plik

@ -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 {

Wyświetl plik

@ -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_ */

Wyświetl plik

@ -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

Wyświetl plik

@ -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
};
/**

Wyświetl plik

@ -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
};

Wyświetl plik

@ -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
};

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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();

Wyświetl plik

@ -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

Wyświetl plik

@ -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";