diff --git a/ATC_v43.bin b/ATC_v43.bin index 3d42b19c..8a81a6a9 100644 Binary files a/ATC_v43.bin and b/ATC_v43.bin differ diff --git a/BTH_v43.bin b/BTH_v43.bin index 3fc002a2..1588586b 100644 Binary files a/BTH_v43.bin and b/BTH_v43.bin differ diff --git a/CGDK2_v43.bin b/CGDK2_v43.bin index b128aad2..25457c11 100644 Binary files a/CGDK2_v43.bin and b/CGDK2_v43.bin differ diff --git a/CGG1M_v43.bin b/CGG1M_v43.bin index 93899f72..3d7763b9 100644 Binary files a/CGG1M_v43.bin and b/CGG1M_v43.bin differ diff --git a/CGG1_v43.bin b/CGG1_v43.bin index 51ef587c..a17cfcc5 100644 Binary files a/CGG1_v43.bin and b/CGG1_v43.bin differ diff --git a/MHO_C401N_v43.bin b/MHO_C401N_v43.bin index 1fc51592..1d1d9640 100644 Binary files a/MHO_C401N_v43.bin and b/MHO_C401N_v43.bin differ diff --git a/MHO_C401_v43.bin b/MHO_C401_v43.bin index e830c140..d190f0c3 100644 Binary files a/MHO_C401_v43.bin and b/MHO_C401_v43.bin differ diff --git a/src/app.c b/src/app.c index 48df3c73..815386c9 100644 --- a/src/app.c +++ b/src/app.c @@ -573,9 +573,6 @@ void user_init_normal(void) {//this will get executed one time after power up if (flash_read_cfg(&trg, EEP_ID_TRG, FEEP_SAVE_SIZE_TRG) != FEEP_SAVE_SIZE_TRG) memcpy(&trg, &def_trg, FEEP_SAVE_SIZE_TRG); -#if USE_WK_RDS_COUNTER - rds.type = trg.rds.type; -#endif #endif // if version < 4.2 -> clear cfg.flg2.longrange if (old_ver <= 0x41) { @@ -583,11 +580,11 @@ void user_init_normal(void) {//this will get executed one time after power up flash_write_cfg(&cfg, EEP_ID_CFG, sizeof(cfg)); } } else { - memcpy(&cfg, &def_cfg, sizeof(cfg)); - memcpy(&cmf, &def_cmf, sizeof(cmf)); #if BLE_SECURITY_ENABLE pincode = 0; #endif + memcpy(&cfg, &def_cfg, sizeof(cfg)); + memcpy(&cmf, &def_cmf, sizeof(cmf)); #if USE_TRIGGER_OUT memcpy(&trg, &def_trg, FEEP_SAVE_SIZE_TRG); #endif @@ -597,10 +594,12 @@ void user_init_normal(void) {//this will get executed one time after power up #endif } #if USE_WK_RDS_COUNTER + rds.type = trg.rds.type; rds_init(); #endif init_i2c(); reg_i2c_speed = (uint8_t)(CLOCK_SYS_CLOCK_HZ/(4*100000)); // 100 kHz + test_config(); #if (POWERUP_SCREEN) || (USE_RTC) || (BLE_EXT_ADV) if(analog_read(DEEP_ANA_REG0) != 0x55) { #if (BLE_EXT_ADV) @@ -618,7 +617,6 @@ void user_init_normal(void) {//this will get executed one time after power up #endif // SHOW_REBOOT_SCREEN || (USE_RTC) #endif // POWERUP_SCREEN || (USE_RTC) || (BLE_EXT_ADV) } - test_config(); memcpy(&ext, &def_ext, sizeof(ext)); init_ble(); bls_app_registerEventCallback(BLT_EV_FLAG_SUSPEND_EXIT, &suspend_exit_cb); diff --git a/src/i2c.h b/src/i2c.h index bcdee7c3..804c9bbb 100644 --- a/src/i2c.h +++ b/src/i2c.h @@ -4,9 +4,9 @@ /* Universal I2C/SMBUS read-write transaction struct */ typedef struct _i2c_utr_t { - unsigned char mode; // bit0..6: number wr_byte for new START (bit7: =1 - generate STOP/START) - unsigned char rdlen; // bit0..6: number rd_byte (bit7: =0 - old read byte generate NACK, =1 - ACK) - unsigned char wrdata[1]; // i2c_addr_wr, wr_byte1, wr_byte2, wr_byte3, ... wr_byte126 + unsigned char mode; // bit0..6: The byte number of the record for the new START (bit7: =1 - generate STOP/START) + unsigned char rdlen; // bit0..6: Number of bytes read (bit7: =0 - the last byte read generates NACK, =1 - ACK) + unsigned char wrdata[1]; // Array, the first byte is the address, then the bytes to write to the bus: i2c_addr_wr, wr_byte1, wr_byte2, wr_byte3, ... wr_byte126 } i2c_utr_t; void init_i2c();