From e4bfa4e42b614ab13febfb47e414065a94fa4133 Mon Sep 17 00:00:00 2001 From: chenyisong Date: Mon, 21 Oct 2024 17:42:09 +0800 Subject: [PATCH] update t2 --- beken_os/beken378/build/bk7231n_ota.ld | 25 ++++++++++++++++--- beken_os/beken378/driver/ble/ble.c | 8 +++--- .../ble/ble_pub/plf/refip/src/bim/bim_app.c | 2 +- beken_os/beken378/driver/phy/phy_trident.c | 2 +- beken_os/beken378/driver/pwm/mcu_ps_timer.c | 14 +++++------ beken_os/beken378/driver/sdcard/sdcard.c | 6 ++--- beken_os/beken378/driver/sys_ctrl/sys_ctrl.c | 22 ++++++++-------- .../beken378/func/bk7011_cal/bk7231N_cal.c | 9 +++++++ .../beken378/func/bk7011_cal/bk7231N_cal.h | 2 +- .../beken378/func/bk7011_cal/bk7231U_cal.h | 2 +- .../beken378/func/bk7011_cal/bk7231_cal.h | 2 +- .../beken378/func/include/target_util_pub.h | 2 +- beken_os/beken378/func/misc/start_type.c | 2 +- beken_os/beken378/func/misc/target_util.c | 4 +-- beken_os/beken378/func/power_save/manual_ps.c | 10 ++++---- .../beken378/func/power_save/power_save.c | 8 +++--- .../beken378/func/rf_test/rx_sensitivity.c | 2 +- build_example.sh | 14 ++++++++++- 18 files changed, 87 insertions(+), 49 deletions(-) diff --git a/beken_os/beken378/build/bk7231n_ota.ld b/beken_os/beken378/build/bk7231n_ota.ld index 12cb9e1..374dbe2 100755 --- a/beken_os/beken378/build/bk7231n_ota.ld +++ b/beken_os/beken378/build/bk7231n_ota.ld @@ -98,15 +98,17 @@ SECTIONS *(.text.portDISABLE_IRQ) *(.text.vPortEnterCritical) *(.text.vPortExitCritical) - *(.text.flash_bypass_op_write) + *(.text.flash_bypass_op_write) *(.text.flash_bypass_op_read) } > itcm AT>flash _itcmcode_flash_begin = LOADADDR(.itcm.code); _itcmcode_ram_begin = ADDR(.itcm.code); _itcmcode_ram_end = _itcmcode_ram_begin + SIZEOF(.itcm.code); - . = ALIGN(0x8); + /* code, instructions.for example: i=i+1; */ + + . = ALIGN(0x8); .text : { *(.text) @@ -125,13 +127,16 @@ SECTIONS *(.rodata.*) *(.gnu.linkonce.r*) } > flash - + + + __exidx_start = .; .ARM.exidx : { *(.ARM.exidx*) *(.gnu.linkonce.armexidx.*) } > flash - + __exidx_end = .; + . = ORIGIN(tcm); .tcm ALIGN(8) : { @@ -506,6 +511,18 @@ SECTIONS /* This symbol defines end of code/data sections. Heap starts here. */ PROVIDE(end = .); + + . = __exidx_end + SIZEOF(.data); + .ty_text_section ALIGN(0x8) : + { + _ty_section_start = .; + /* this is for c++ global constructor init */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(*.init_array.*))) + KEEP (*(*.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >flash + ty_section_size = SIZEOF(.ty_text_section); } GROUP( libgcc.a diff --git a/beken_os/beken378/driver/ble/ble.c b/beken_os/beken378/driver/ble/ble.c index a1c2e56..9ec3b2f 100755 --- a/beken_os/beken378/driver/ble/ble.c +++ b/beken_os/beken378/driver/ble/ble.c @@ -60,7 +60,7 @@ extern void rwnxl_reset_handle(int dummy); extern uint32_t ps_get_sleep_prevent(void); extern UINT32 txl_cntrl_pck_get(void ); extern void sctrl_modem_core_reset(void); -extern void delay(INT32 num); +extern void bk_delay(INT32 num); extern void rw_main(void); extern void appm_update_param(struct gapc_conn_param *conn_param); @@ -367,7 +367,7 @@ void ble_set_pn9_trx(uint32 param) { reg = 0x0; REG_WRITE(REG_BLE_XVR_TRX_CONFIG_ADDR, reg); - delay(10); + bk_delay(10); reg = 0x2400; REG_WRITE(REG_BLE_XVR_TRX_CONFIG_ADDR, reg); } @@ -375,7 +375,7 @@ void ble_set_pn9_trx(uint32 param) { reg = 0x0; REG_WRITE(REG_BLE_XVR_TRX_CONFIG_ADDR, reg); - delay(10); + bk_delay(10); reg = 0x3800; REG_WRITE(REG_BLE_XVR_TRX_CONFIG_ADDR, reg); } @@ -418,7 +418,7 @@ UINT32 ble_ctrl( UINT32 cmd, void *param ) reg = REG_READ(REG_BLE_XVR_TRX_CONFIG_ADDR); reg &= ~(1 << REG_BLE_XVR_TEST_RADIO_POST); REG_WRITE(REG_BLE_XVR_TRX_CONFIG_ADDR, reg); - delay(10); + bk_delay(10); reg |= (1 << REG_BLE_XVR_TEST_RADIO_POST); REG_WRITE(REG_BLE_XVR_TRX_CONFIG_ADDR, reg); break; diff --git a/beken_os/beken378/driver/ble/ble_pub/plf/refip/src/bim/bim_app.c b/beken_os/beken378/driver/ble/ble_pub/plf/refip/src/bim/bim_app.c index 6b8b4cf..7865e61 100755 --- a/beken_os/beken378/driver/ble/ble_pub/plf/refip/src/bim/bim_app.c +++ b/beken_os/beken378/driver/ble/ble_pub/plf/refip/src/bim/bim_app.c @@ -11,7 +11,7 @@ typedef void (*FUNCPTR)(void); -void delay(uint32_t t) +void bk_delay(uint32_t t) { for(int i = 1000;i> 0;i--) { diff --git a/beken_os/beken378/driver/phy/phy_trident.c b/beken_os/beken378/driver/phy/phy_trident.c index 8d479cd..a094f5c 100755 --- a/beken_os/beken378/driver/phy/phy_trident.c +++ b/beken_os/beken378/driver/phy/phy_trident.c @@ -2207,7 +2207,7 @@ void phy_agc_reset(void) mdm_reg |= MDM_MDMSWRESET_BIT; mdm_swreset_set(mdm_reg); - delay(10); + bk_delay(10); mdm_reg = mdm_swreset_get(); mdm_reg &= ~MDM_MDMSWRESET_BIT; diff --git a/beken_os/beken378/driver/pwm/mcu_ps_timer.c b/beken_os/beken378/driver/pwm/mcu_ps_timer.c index ef7de40..f76e37e 100755 --- a/beken_os/beken378/driver/pwm/mcu_ps_timer.c +++ b/beken_os/beken378/driver/pwm/mcu_ps_timer.c @@ -62,10 +62,10 @@ void ps_pwm_reconfig(UINT32 period, UINT8 clk_mux) //disable #if (CFG_SOC_NAME == SOC_BK7231) ps_pwm_disable(); - delay(5); + bk_delay(5); //new ps_pwm_set_period(period, clk_mux); - delay(1); + bk_delay(1); //reenable ps_pwm_enable(); @@ -76,7 +76,7 @@ void ps_pwm_reconfig(UINT32 period, UINT8 clk_mux) ps_pwm_set_period(period, clk_mux); //reenable ps_pwm_enable(); - delay(5); + bk_delay(5); REG_WRITE(PWM_INTERRUPT_STATUS,0x3f); #endif @@ -115,9 +115,9 @@ void ps_timer3_enable(UINT32 period) reg = REG_READ(TIMER3_5_CTL); reg &= (~TIMERCTL3_EN_BIT); REG_WRITE(TIMER3_5_CTL,reg); - delay(2); + bk_delay(2); REG_WRITE(TIMER3_CNT,period); - delay(2); + bk_delay(2); reg = REG_READ(TIMER3_5_CTL); reg |= (TIMERCTL3_EN_BIT); reg &= ~(0x7 << TIMERCTLB_INT_POSI); @@ -158,9 +158,9 @@ UINT32 ps_timer3_disable(void) reg &= (~TIMERCTL3_EN_BIT); reg &= ~(0x7 << TIMERCTLB_INT_POSI); REG_WRITE(TIMER3_5_CTL,reg); - delay(2); + bk_delay(2); REG_WRITE(TIMER3_CNT,FCLK_DURATION_MS*32); - delay(2); + bk_delay(2); reg = REG_READ(TIMER3_5_CTL); reg |= (TIMERCTL3_EN_BIT); REG_WRITE(TIMER3_5_CTL,reg); diff --git a/beken_os/beken378/driver/sdcard/sdcard.c b/beken_os/beken378/driver/sdcard/sdcard.c index f347fe8..3b7aaed 100755 --- a/beken_os/beken378/driver/sdcard/sdcard.c +++ b/beken_os/beken378/driver/sdcard/sdcard.c @@ -1026,10 +1026,10 @@ uint8 sd_clk_is_attached(void) { uint32 tmp, mask, param ; sdio_clk_config(0); - delay(1); + bk_delay(1); param = GPIO_CFG_PARAM(sd_clk_pin, GMODE_INPUT_PULLUP); sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m); - delay(5); + bk_delay(5); if(sddev_control(GPIO_DEV_NAME, CMD_GPIO_INPUT, &sd_clk_pin)) { GLOBAL_INT_DECLARATION(); @@ -1047,7 +1047,7 @@ uint8 sd_clk_is_attached(void) { param = GPIO_CFG_PARAM(sd_clk_pin, GMODE_SECOND_FUNC_PULL_UP); sddev_control(GPIO_DEV_NAME, CMD_GPIO_CFG, ¶m); - delay(1); + bk_delay(1); sdio_clk_config(1); return SD_CARD_ONLINE; } diff --git a/beken_os/beken378/driver/sys_ctrl/sys_ctrl.c b/beken_os/beken378/driver/sys_ctrl/sys_ctrl.c index 5e799df..c1951a1 100755 --- a/beken_os/beken378/driver/sys_ctrl/sys_ctrl.c +++ b/beken_os/beken378/driver/sys_ctrl/sys_ctrl.c @@ -244,7 +244,7 @@ void sctrl_set_cpu_clk_dco(void) reg_val |= ((MCLK_FIELD_DCO&MCLK_MUX_MASK) << MCLK_MUX_POSI); reg_val |= HCLK_DIV2_EN_BIT; - delay(10); + bk_delay(10); REG_WRITE(SCTRL_CONTROL, reg_val); reg_val &= ~(MCLK_DIV_MASK << MCLK_DIV_POSI); REG_WRITE(SCTRL_CONTROL, reg_val); @@ -887,7 +887,7 @@ void sctrl_mcu_sleep(UINT32 peri_clk) else { PS_DEBUG_DOWN_TRIGER; - delay(1); + bk_delay(1); #if PS_CLOSE_PERI_CLK /* close all peri clock*/ ps_saves[0].peri_clk_cfg= REG_READ(ICU_PERI_CLK_PWD); @@ -901,7 +901,7 @@ void sctrl_mcu_sleep(UINT32 peri_clk) #endif WFI(); } - delay(5); + bk_delay(5); } UINT32 sctrl_mcu_wakeup(void) { @@ -924,7 +924,7 @@ UINT32 sctrl_mcu_wakeup(void) else { PS_DEBUG_BCN_TRIGER; - delay(2); + bk_delay(2); PS_DEBUG_BCN_TRIGER; #if PS_CLOSE_PERI_CLK @@ -1076,7 +1076,7 @@ void sctrl_subsys_reset(UINT32 cmd) if(reg) { REG_WRITE(reg, reset_word); - delay(10); + bk_delay(10); REG_WRITE(reg, 0); } @@ -1247,7 +1247,7 @@ void sctrl_enter_rtos_idle_sleep(UINT32 peri_clk) reg &= ~(SLEEP_MODE_MASK << SLEEP_MODE_POSI); reg = reg | SLEEP_MODE_CFG_NORMAL_VOL_WORD; REG_WRITE(SCTRL_SLEEP, reg); - delay(5); + bk_delay(5); } void sctrl_exit_rtos_idle_sleep(void) @@ -1269,7 +1269,7 @@ void sctrl_exit_rtos_idle_sleep(void) reg |= (BLK_EN_26M_XTAL | BLK_EN_DPLL_480M | BLK_EN_XTAL2RF | BLK_EN_ANALOG_SYS_LDO); REG_WRITE(SCTRL_BLOCK_EN_CFG, reg); - delay(1); //delay 1.1ms for 26MHz DCO clock. need change for other dco clock frequency + bk_delay(1); //delay 1.1ms for 26MHz DCO clock. need change for other dco clock frequency sctrl_cali_dpll(0); /* dpll division reset release*/ reg = REG_READ(SCTRL_CONTROL); @@ -1694,7 +1694,7 @@ void sctrl_enter_rtos_deep_sleep(PS_DEEP_CTRL_PARAM *deep_param) reg = reg | SLEEP_MODE_CFG_DEEP_WORD; REG_WRITE(SCTRL_SLEEP, reg); - delay(5); + bk_delay(5); } RESET_SOURCE_STATUS sctrl_get_deep_sleep_wake_soure(void) @@ -1827,7 +1827,7 @@ UINT32 sctrl_ctrl(UINT32 cmd, void *param) case CMD_SCTRL_NORMAL_WAKEUP: sctrl_hw_wakeup(); - delay(50); + bk_delay(50); sctrl_rf_wakeup(); break; #endif @@ -1978,7 +1978,7 @@ UINT32 sctrl_ctrl(UINT32 cmd, void *param) << MODEM_CORE_RESET_POSI); REG_WRITE(SCTRL_MODEM_CORE_RESET_PHY_HCLK, reg); - delay(1); + bk_delay(1); reg = ret; REG_WRITE(SCTRL_MODEM_CORE_RESET_PHY_HCLK, reg); @@ -1986,7 +1986,7 @@ UINT32 sctrl_ctrl(UINT32 cmd, void *param) reg = REG_READ(SCTRL_RESET); while(reg & MODEM_CORE_RESET_BIT) { - delay(10); + bk_delay(10); reg = REG_READ(SCTRL_RESET); } ret = SCTRL_SUCCESS; diff --git a/beken_os/beken378/func/bk7011_cal/bk7231N_cal.c b/beken_os/beken378/func/bk7011_cal/bk7231N_cal.c index 6f31e92..952259f 100755 --- a/beken_os/beken378/func/bk7011_cal/bk7231N_cal.c +++ b/beken_os/beken378/func/bk7011_cal/bk7231N_cal.c @@ -2508,6 +2508,13 @@ void bk7011_set_rfcali_mode(int mode) os_printf("set rfcali_mode:%d\r\n", gcali_context.cali_mode); } +char rx2_use_flag = 0; + +char get_rx2_flag(void) +{ + return rx2_use_flag; +} + UINT32 rwnx_cal_load_user_rfcali_mode(int *rfcali_mode) { #define RF_MODE_GPIO_ID (GPIO1) @@ -2525,6 +2532,8 @@ UINT32 rwnx_cal_load_user_rfcali_mode(int *rfcali_mode) gpio_level = bk_gpio_input(RF_MODE_GPIO_ID); + rx2_use_flag = 1; + second_func = GFUNC_MODE_UART2; gpio_ctrl(CMD_GPIO_ENABLE_SECOND, &second_func); GLOBAL_INT_RESTORE(); diff --git a/beken_os/beken378/func/bk7011_cal/bk7231N_cal.h b/beken_os/beken378/func/bk7011_cal/bk7231N_cal.h index cdd5764..ee466d9 100755 --- a/beken_os/beken378/func/bk7011_cal/bk7231N_cal.h +++ b/beken_os/beken378/func/bk7011_cal/bk7231N_cal.h @@ -43,7 +43,7 @@ void delay05us(INT32 num); //#define DPDCALILEN 256 -#define cpu_delay(val) delay(MAX(1, val/100)) +#define cpu_delay(val) bk_delay(MAX(1, val/100)) #define DELAY1US 100 //#define DELAY05US 1 diff --git a/beken_os/beken378/func/bk7011_cal/bk7231U_cal.h b/beken_os/beken378/func/bk7011_cal/bk7231U_cal.h index 111eea2..22175f2 100755 --- a/beken_os/beken378/func/bk7011_cal/bk7231U_cal.h +++ b/beken_os/beken378/func/bk7011_cal/bk7231U_cal.h @@ -30,7 +30,7 @@ void delay05us(INT32 num); //#define DPDCALILEN 256 -#define cpu_delay(val) delay(MAX(1, val/100)) +#define cpu_delay(val) bk_delay(MAX(1, val/100)) #define DELAY1US 100 //#define DELAY05US 1 diff --git a/beken_os/beken378/func/bk7011_cal/bk7231_cal.h b/beken_os/beken378/func/bk7011_cal/bk7231_cal.h index 87c1eb8..18b0946 100755 --- a/beken_os/beken378/func/bk7011_cal/bk7231_cal.h +++ b/beken_os/beken378/func/bk7011_cal/bk7231_cal.h @@ -38,7 +38,7 @@ void delay05us(INT32 num); #define SUMNUMBERS 4 #define MINOFFSET 16 -#define cpu_delay(val) delay(MAX(1, val/100)) +#define cpu_delay(val) bk_delay(MAX(1, val/100)) #define DELAY1US 100 #define cal_delay(val) delay05us(MAX(1, val)) // 8us diff --git a/beken_os/beken378/func/include/target_util_pub.h b/beken_os/beken378/func/include/target_util_pub.h index a46f457..22e1545 100755 --- a/beken_os/beken378/func/include/target_util_pub.h +++ b/beken_os/beken378/func/include/target_util_pub.h @@ -1,7 +1,7 @@ #ifndef _TARGET_UTIL_PUB_H_ #define _TARGET_UTIL_PUB_H_ -extern void delay(INT32 num); +extern void bk_delay(INT32 num); extern void delay_ms(UINT32 ms_count); extern void delay_sec(UINT32 ms_count); extern void delay_tick(UINT32 tick_count); diff --git a/beken_os/beken378/func/misc/start_type.c b/beken_os/beken378/func/misc/start_type.c index 0c5258e..5d245cc 100755 --- a/beken_os/beken378/func/misc/start_type.c +++ b/beken_os/beken378/func/misc/start_type.c @@ -32,7 +32,7 @@ void bk_misc_crash_xat0_reboot(void) GLOBAL_INT_DISABLE(); icu_ctrl(CMD_CLK_PWR_DOWN, (void *)¶meter); - delay(30000); //100ms + bk_delay(30000); //100ms wdt_ctrl(WCMD_SET_PERIOD, &wdt_val); icu_ctrl(CMD_CLK_PWR_UP, (void *)¶meter); while(1); diff --git a/beken_os/beken378/func/misc/target_util.c b/beken_os/beken378/func/misc/target_util.c index 392fea9..6b579d7 100755 --- a/beken_os/beken378/func/misc/target_util.c +++ b/beken_os/beken378/func/misc/target_util.c @@ -14,7 +14,7 @@ delay(10):about 125us delay(100):about 850us */ -void delay(INT32 num) +void bk_delay(INT32 num) { volatile INT32 i, j; @@ -62,7 +62,7 @@ void delay_ms(UINT32 ms_count) ASSERT(clk); cell = 100 * clk / 26000000; - delay(ms_count * cell); + bk_delay(ms_count * cell); } /* diff --git a/beken_os/beken378/func/power_save/manual_ps.c b/beken_os/beken378/func/power_save/manual_ps.c index 5089ac6..1fe41e7 100755 --- a/beken_os/beken378/func/power_save/manual_ps.c +++ b/beken_os/beken378/func/power_save/manual_ps.c @@ -74,7 +74,7 @@ void power_save_wakeup_with_peri( UINT8 uart2_wk, UINT32 gpio_index_map) power_save_ps_mode_set(PS_MCU_PS_MODE); param = (0xfffff & ~PWD_UART2_CLK_BIT); sddev_control(SCTRL_DEV_NAME, CMD_SCTRL_NORMAL_SLEEP, ¶m); - delay(200000); + bk_delay(200000); sddev_control(SCTRL_DEV_NAME, CMD_SCTRL_NORMAL_WAKEUP, 0); for (i = 0; i < GPIONUM; i++) @@ -145,7 +145,7 @@ void power_save_wakeup_with_timer(UINT32 sleep_time) else if(wakeup_timer < 32) wakeup_timer = 32; - delay(5); + bk_delay(5); power_save_pwm1_enable(wakeup_timer); } else @@ -163,7 +163,7 @@ void power_save_wakeup_with_timer(UINT32 sleep_time) param = (0xfffff & (~PWD_PWM1_CLK_BIT) & (~PWD_UART2_CLK_BIT)); sddev_control(SCTRL_DEV_NAME, CMD_SCTRL_RTOS_IDLE_SLEEP, ¶m); PS_DEBUG_UP_OUT; - delay(5); + bk_delay(5); sddev_control(SCTRL_DEV_NAME, CMD_SCTRL_RTOS_IDLE_WAKEUP, 0); phy_init_after_wakeup(); GLOBAL_INT_RESTORE(); @@ -199,7 +199,7 @@ void power_save_wakeup_with_gpio(UINT32 gpio_index) PS_DEBUG_UP_OUT; param = (0xfffff & (~PWD_UART2_CLK_BIT)); sddev_control(SCTRL_DEV_NAME, CMD_SCTRL_RTOS_IDLE_SLEEP, ¶m); - delay(5); + bk_delay(5); sddev_control(SCTRL_DEV_NAME, CMD_SCTRL_RTOS_IDLE_WAKEUP, 0); phy_init_after_wakeup(); GLOBAL_INT_RESTORE(); @@ -251,7 +251,7 @@ void bk_enter_deep_sleep_mode ( PS_DEEP_CTRL_PARAM *deep_param ) GLOBAL_INT_DECLARATION(); GLOBAL_INT_DISABLE(); sddev_control ( SCTRL_DEV_NAME, CMD_SCTRL_RTOS_DEEP_SLEEP, deep_param ); - delay ( 5 ); + bk_delay ( 5 ); GLOBAL_INT_RESTORE(); (void)i; (void)param; diff --git a/beken_os/beken378/func/power_save/power_save.c b/beken_os/beken378/func/power_save/power_save.c index 28d908c..b31093b 100755 --- a/beken_os/beken378/func/power_save/power_save.c +++ b/beken_os/beken378/func/power_save/power_save.c @@ -336,7 +336,7 @@ void power_save_mac_idle_callback(void) nxmac_wake_up_sw_setf(0); /*first clear beacon interval,delay,then set beacon interval,to fix rw sleep wakeup time*/ nxmac_beacon_int_setf(0); - delay(1); + bk_delay(1); nxmac_beacon_int_setf(bk_ps_info.ps_beacon_int); os_null_printf(" sleep_first %d\r\n", bk_ps_info.liston_mode); os_printf(" dtim period:%d multi:%d\r\n", bk_ps_info.ps_dtim_period, bk_ps_info.ps_dtim_multi); @@ -804,7 +804,7 @@ void power_save_dtim_ps_exit(void) bk_ps_info.PsDataWakeupWaitTimeMs = 0 ; bk_ps_info.PsPeriWakeupWaitTimeMs = 0 ; nxmac_beacon_int_setf(0); - delay(1); + bk_delay(1); bk_ps_info.ps_real_sleep = 0; bk_ps_info.sleep_count = 0; bk_ps_info.sleep_first = 1; @@ -985,7 +985,7 @@ void power_save_rf_dtim_manual_do_wakeup(void) || bk_ps_info.ps_arm_wakeup_way == PS_ARM_WAKEUP_UPING) && (bk_ps_info.ps_real_sleep == 1)) { - delay(1); + bk_delay(1); PS_DEBUG_UP_TRIGER; if(bk_ps_info.ps_arm_wakeup_way == PS_ARM_WAKEUP_UPING) @@ -1288,7 +1288,7 @@ void power_save_keep_timer_real_handler() ps_reseted_moniter_flag = 0; } GLOBAL_INT_RESTORE(); - delay(1); + bk_delay(1); PS_DEBUG_PWM_TRIGER; #if CFG_USE_STA_PS diff --git a/beken_os/beken378/func/rf_test/rx_sensitivity.c b/beken_os/beken378/func/rf_test/rx_sensitivity.c index b7a8e9e..8a93687 100755 --- a/beken_os/beken378/func/rf_test/rx_sensitivity.c +++ b/beken_os/beken378/func/rf_test/rx_sensitivity.c @@ -407,7 +407,7 @@ void rs_get_rx_result(void) REG_WRITE(0xc0000298, 0x0); REG_WRITE(0xc0000040, 0x00011881); - delay(100); + bk_delay(100); TXBW20NEW = REG_READ(0xc0000b70); TXBW40NEW = REG_READ(0xc0000b74); diff --git a/build_example.sh b/build_example.sh index 466019c..fea93e2 100755 --- a/build_example.sh +++ b/build_example.sh @@ -106,7 +106,19 @@ TYUTOOL_DIR=$(pwd)/tools/tyutool cd beken_os -if [ "$USER_CMD" = "clean" ];then +TOP_DIR=$(pwd) +if [ -f ${TOP_DIR}/.app ]; then + OLD_APP_BIN_NAME=$(cat ${TOP_DIR}/.app) + echo OLD_APP_BIN_NAME: ${OLD_APP_BIN_NAME} +fi + +echo ${APP_BIN_NAME} > ${TOP_DIR}/.app +if [ "$OLD_APP_BIN_NAME" != "$APP_BIN_NAME" ]; then + make clean + echo "AUTO CLEAN SUCCESS" +fi + +if [ x"$USER_CMD" = "xclean" ];then # make clean make APP_BIN_NAME=$APP_BIN_NAME APP_VERSION=$APP_VERSION LIBS_DIR=$LIBS_DIR LIBS="$LIBS" OUTPUT_DIR=$OUTPUT_DIR HEADER_DIR="$HEADER_DIR" $USER_CMD -j -C ./ echo "*************************************************************************"