17 Commits

Author SHA1 Message Date
wuqi a1b914709d 发布PWM32EPRO V2.0版本 2026-09-05 12:41:51 +08:00
wuqi cbb03c9d9c 清理在线发布文件并恢复PWM32EPRO型号 2026-08-03 14:20:14 +08:00
wuqi 5e921a1546 恢复433接收引脚为GPIO5 2026-08-03 13:23:27 +08:00
wuqi f71c3f4124 添加DWM22量产固件和黑盒测试文档 2026-08-03 12:46:54 +08:00
wuqi ee68f37f04 DWM22量产测试 2026-07-29 18:33:18 +08:00
wuqi 99d4844c01 DWM22测试板 2026-07-29 17:37:05 +08:00
wuqi 6d114add28 更改成固定窗口解码模块 2026-07-29 13:48:23 +08:00
wuqi 46e9db0796 解决中性光写flash闪烁问题 2026-07-29 11:27:02 +08:00
wuqi 7b0bf78309 Revert "修复APP切换记忆策略时闪烁"
This reverts commit 550d0987ea.
2026-07-28 17:51:50 +08:00
wuqi eab8e1cc98 Revert "保持蓝牙与中性光运行时写入参数"
This reverts commit d119f8cceb.
2026-07-28 17:51:50 +08:00
wuqi d119f8cceb 保持蓝牙与中性光运行时写入参数 2026-07-28 17:49:22 +08:00
wuqi 550d0987ea 修复APP切换记忆策略时闪烁 2026-07-28 17:36:13 +08:00
wuqi 1676f4b3ad 修复中性光上电瞬时闪烁 2026-07-28 17:19:15 +08:00
wuqi b2e642366c 恢复4aa84e1固件构建布局 2026-07-28 17:09:50 +08:00
wuqi ee4b458933 增加上电三色轮换与记忆策略 2026-07-28 16:35:13 +08:00
wuqi 55a26d7b18 恢复到4aa84e1版本 2026-07-28 16:17:41 +08:00
wuqi 2200a04f05 修复断电轮换保存及蓝牙广播构建 2026-07-28 16:14:32 +08:00
124 changed files with 6830 additions and 5191 deletions
Binary file not shown.
Binary file not shown.
@@ -340,6 +340,10 @@ __RAM_CODE static uint8_t xc_fmc_spi_flash_status(void)
return sta[1]; return sta[1];
} }
__RAM_CODE __WEAK void xc_fmc_spi_flash_busy_hook(void)
{
}
/** /**
**************************************************************************************** ****************************************************************************************
* @brief xc_fmc_spi_flash_wait_busy * @brief xc_fmc_spi_flash_wait_busy
@@ -354,8 +358,14 @@ __RAM_CODE static uint8_t xc_fmc_spi_flash_status(void)
*/ */
__RAM_CODE static void xc_fmc_spi_flash_wait_busy(void) __RAM_CODE static void xc_fmc_spi_flash_wait_busy(void)
{ {
while ((xc_fmc_spi_flash_status() & PUYA_FLASH_STATUS_WIP_SET)) for (;;) {
; xc_fmc_spi_flash_busy_hook();
if ((xc_fmc_spi_flash_status() &
PUYA_FLASH_STATUS_WIP_SET) == 0U)
break;
}
xc_fmc_spi_flash_busy_hook();
} }
/** /**
@@ -472,6 +482,30 @@ __RAM_CODE void xc_fmc_spi_flash_erase_page(uint32_t addr)
* @retval void * @retval void
**************************************************************************************** ****************************************************************************************
*/ */
__RAM_CODE void xc_fmc_spi_flash_write_16bytes(uint32_t addr, uint8_t *data)
{
uint8_t cmd[16 + 4] = {0};
xc_fmc_spi_flash_wait_busy();
xc_fmc_spi_flash_write_enable();
xc_fmc_spi_flash_wait_busy();
cmd[0] = CMD_PAGE_PROGRAM;
cmd[1] = addr >> 16;
cmd[2] = addr >> 8;
cmd[3] = addr;
ram_memcpy_bytes(&cmd[4], data, 16);
xc_fmc_status_wait_idle();
xc_fmc_spi_enable(FMC_SSI_CTRL0_DFS_LEN_32BIT);
xc_fmc_spi_write_nbyte(cmd, sizeof(cmd));
xc_fmc_spi_flash_wait_busy();
xc_fmc_spi_disable();
}
__RAM_CODE void xc_fmc_spi_flash_write_page(uint32_t addr, uint8_t *data, __RAM_CODE void xc_fmc_spi_flash_write_page(uint32_t addr, uint8_t *data,
uint16_t size) uint16_t size)
{ {
@@ -293,6 +293,7 @@ void xc_fmc_spi_flash_wait_busy(void);
void xc_fmc_spi_flash_write_enable(void); void xc_fmc_spi_flash_write_enable(void);
void xc_fmc_spi_flash_erase_sector(uint32_t addr); void xc_fmc_spi_flash_erase_sector(uint32_t addr);
void xc_fmc_spi_flash_erase_page(uint32_t addr); void xc_fmc_spi_flash_erase_page(uint32_t addr);
void xc_fmc_spi_flash_write_16bytes(uint32_t addr, uint8_t *data);
void xc_fmc_spi_flash_write_page(uint32_t addr, uint8_t *buff, void xc_fmc_spi_flash_write_page(uint32_t addr, uint8_t *buff,
uint16_t size); uint16_t size);
void xc_fmc_spi_flash_read_page(uint32_t addr, uint8_t *buff, void xc_fmc_spi_flash_read_page(uint32_t addr, uint8_t *buff,
@@ -397,7 +397,7 @@
/// Default Device Name /// Default Device Name
#define APP_DFLT_DEVICE_NAME ("DWM22") // #define APP_DFLT_DEVICE_NAME ("PWM32EPRO") //
#define APP_DFLT_DEVICE_NAME_LEN (sizeof(APP_DFLT_DEVICE_NAME)) #define APP_DFLT_DEVICE_NAME_LEN (sizeof(APP_DFLT_DEVICE_NAME))
#define APP_DFLT_DEVICE_NAME_LEN1 (sizeof(APP_DFLT_DEVICE_NAME1)) #define APP_DFLT_DEVICE_NAME_LEN1 (sizeof(APP_DFLT_DEVICE_NAME1))
#define APP_DFLT_DEVICE_NAME2 ("Second_test") #define APP_DFLT_DEVICE_NAME2 ("Second_test")
@@ -121,6 +121,17 @@ void set_mode(){
{ {
Light_Transition_BeginModeChange(); Light_Transition_BeginModeChange();
} }
else if(choose_mode_falsg == CUSTOM_TEMPERATURE_MODE)
{
/*
* APP CCT packets can arrive continuously while the color
* ring is dragged. Restart the same 200 ms linear transition
* used by static mode changes from the current visible
* output, so the latest W/C target is followed without a
* discontinuity.
*/
Light_Transition_BeginModeChange();
}
else else
{ {
Light_Transition_ModeActive=0U; Light_Transition_ModeActive=0U;
@@ -147,6 +147,9 @@ void Bridge_Init(void);
void Bridge_Off(void); void Bridge_Off(void);
void Bridge_Service_1ms(void); void Bridge_Service_1ms(void);
void Bridge_Deadtime_Expired(void); void Bridge_Deadtime_Expired(void);
void Bridge_FlashBlank_Request(void);
uint8_t Bridge_FlashBlank_Ready(void);
void Bridge_FlashBlank_Resume(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
@@ -188,7 +188,10 @@ void scan_433();
void Lock_Pwm7xd(); void Lock_Pwm7xd();
void Delay_50us(); void Delay_50us();
void Encoder_key(); void Encoder_key();
void rf433_clear_code(void);
uint8_t rf433_start_pairing(void);
void rf433_cancel_pairing(void);
uint8_t rf433_paired_count(void);
#endif #endif
@@ -7,6 +7,8 @@
#include "light_transition.h" #include "light_transition.h"
#include "pwm.h" #include "pwm.h"
#include "rf433_decoder.h" #include "rf433_decoder.h"
#include "timeslice.h"
#include "usr_server.h"
union rf433_flag rf_flag = {0}; union rf433_flag rf_flag = {0};
unsigned char high_level_time; unsigned char high_level_time;
unsigned char low_level_time; unsigned char low_level_time;
@@ -17,6 +19,8 @@ uint32_t receive_data;
uint8_t res_data=255; //433返回的最后一个控制字节(低八位) uint8_t res_data=255; //433返回的最后一个控制字节(低八位)
static uint16_t long_time=0; //表示长按短按 该值一定要大与68,68是指68ms通过逻辑分析仪测量一帧433的时间
static uint16_t time_300ms=1; //表示:当长按的时候要300ms执行一次
static uint8_t POWER_flag; static uint8_t POWER_flag;
uint32_t flag_1h =0; uint32_t flag_1h =0;
@@ -93,22 +97,19 @@ static uint8_t pair_deferred_command;
static uint8_t pair_deferred_res_data; static uint8_t pair_deferred_res_data;
static uint32_t pair_deferred_receive_data; static uint32_t pair_deferred_receive_data;
static uint8_t pair_command_replay; static uint8_t pair_command_replay;
static uint8_t app_pairing_requested;
#define PAIR_HOLD_FRAME_COUNT 4U #define PAIR_HOLD_FRAME_COUNT 4U
#define PAIR_FRAME_SILENCE_TICKS 100U #define PAIR_FRAME_SILENCE_TICKS 100U
#define PAIRING_WINDOW_TICKS 50000UL #define PAIRING_WINDOW_TICKS 50000UL
#define RF433_RELEASE_TIMEOUT_TICKS 1500U
#define RF433_MS_TO_SAMPLE_TICKS(ms) ((uint16_t)((ms) * (1000U / RF433_DECODER_SAMPLE_US))) #define RF433_MS_TO_SAMPLE_TICKS(ms) ((uint16_t)((ms) * (1000U / RF433_DECODER_SAMPLE_US)))
#define RF433_HOLD_GAP_TICKS ((uint32_t)RF433_MS_TO_SAMPLE_TICKS(250U)) #define RF433_MODE_REPEAT_TICKS ((uint32_t)RF433_MS_TO_SAMPLE_TICKS(500U))
#define RF433_REPEAT_TICKS ((uint32_t)RF433_MS_TO_SAMPLE_TICKS(500U))
uint8_t long_flag_s=0; uint8_t long_flag_s=0;
static volatile uint32_t rf433_sample_ticks;
static volatile uint32_t rf_sample_ticks; static uint32_t rf433_mode_last_action_tick;
static uint16_t rf_dispatch_sequence; static uint8_t rf433_mode_last_key;
static uint32_t rf_hold_code; static uint8_t rf433_mode_action_valid;
static uint32_t rf_hold_last_frame_tick;
static uint32_t rf_hold_next_repeat_tick;
static uint8_t rf_hold_key;
static uint8_t rf_hold_active;
void _433_fun(void); void _433_fun(void);
@@ -259,12 +260,84 @@ static void Pairing_Candidate_Reset(void)
pair_deferred_command = 0U; pair_deferred_command = 0U;
} }
uint8_t rf433_paired_count(void)
{
uint8_t count = 0U;
uint8_t i;
for(i = 0U; i < 5U; i++)
{
if(!Pairing_Address_IsEmpty(adress_H_array[i], adress_L_array[i]))
count++;
}
return count;
}
uint8_t rf433_start_pairing(void)
{
if(pairing_feedback_active)
{
ble_remote_event_notify(0x0DU, 0U, rf433_paired_count());
return 0U;
}
ssse = 0U;
time_5s = 1U;
pair_last_frame_sequence = rf_frame_sequence;
Pairing_Candidate_Reset();
app_pairing_requested = 1U;
ble_remote_event_notify(0x0DU, 1U, rf433_paired_count());
return 1U;
}
void rf433_cancel_pairing(void)
{
ssse = 1U;
time_5s = PAIRING_WINDOW_TICKS + 1U;
Pairing_Candidate_Reset();
if(app_pairing_requested)
{
app_pairing_requested = 0U;
ble_remote_event_notify(0x0DU, 0U, rf433_paired_count());
}
}
void rf433_clear_code(void)
{
uint8_t i;
for(i = 0U; i < 5U; i++)
{
adress_H_array[i] = 0xffU;
adress_L_array[i] = 0xffU;
}
adress = 0U;
adress_H = 0U;
adress_L = 0U;
match_success = 0U;
ssse = 1U;
time_5s = PAIRING_WINDOW_TICKS + 1U;
Pairing_Candidate_Reset();
Pairing_Feedback_Start(200U);
app_pairing_requested = 0U;
set_TaskComps_timer(2U, 2000U);
ble_remote_event_notify(0x0EU, 1U, 0U);
}
static void Encoder_key_NoCode(){ static void Encoder_key_NoCode(){
uint16_t times_s=0; uint16_t times_s=0;
uint8_t pairing_data_changed=0U; uint8_t pairing_data_changed=0U;
if(app_pairing_requested &&
(ssse != 0U || time_5s > PAIRING_WINDOW_TICKS))
{
app_pairing_requested = 0U;
ble_remote_event_notify(0x0DU, 0U, rf433_paired_count());
}
if(pair_frame_silence_ticks < 0xffU) pair_frame_silence_ticks++; if(pair_frame_silence_ticks < 0xffU) pair_frame_silence_ticks++;
if(pair_frame_silence_ticks > PAIR_FRAME_SILENCE_TICKS) if(pair_frame_silence_ticks > PAIR_FRAME_SILENCE_TICKS)
{ {
@@ -363,6 +436,17 @@ static void Encoder_key_NoCode(){
ssse=1; ssse=1;
if(pairing_data_changed) set_TaskComps_timer(2,2000); if(pairing_data_changed) set_TaskComps_timer(2,2000);
if(app_pairing_requested)
{
app_pairing_requested = 0U;
if(res_data==Brightness_H ||
res_data==B_Brightness_H ||
res_data==F_Brightness_10)
ble_remote_event_notify(0x0DU, 2U,
rf433_paired_count());
else
ble_remote_event_notify(0x0EU, 1U, 0U);
}
} }
} }
@@ -378,6 +462,7 @@ static void Rf433_Decoder_Frame_Poll(void)
res_data = frame.key; res_data = frame.key;
rf_frame_sequence++; rf_frame_sequence++;
rf_flag.rf_receive_flag.receive_finish = 1U; rf_flag.rf_receive_flag.receive_finish = 1U;
long_time = RF433_RELEASE_TIMEOUT_TICKS;
} }
void Encoder_key(){ void Encoder_key(){
@@ -387,11 +472,84 @@ void Encoder_key(){
} }
typedef struct {
uint32_t KEY_STATE_Click; // 单击
uint32_t KEY_STATE_LONG_PRESS; // 长按
} _Key_TypeDef;
_Key_TypeDef Key_TypeDef={0,0};
uint32_t KEY_STATE_re=0; // 长按
//该函数选择那个按键为单击,哪个为长按按键
static void set_click(){
if(res_data==Mode_add||res_data==Mode_dow||res_data==F_ON_OFF||res_data==F_Mode_choose||res_data==ON||res_data==OFF){
Key_TypeDef.KEY_STATE_Click=1; //单击
}else{
Key_TypeDef.KEY_STATE_LONG_PRESS=1; //长按
KEY_STATE_re=1;
}
}
static uint8_t rf433_is_mode_step_command(uint8_t command)
{
return command == Mode_add || command == Mode_dow;
}
/*
* Act immediately on the first valid mode frame. Repeated frames carrying
* the same key are accepted at most once every 500 ms. Keep this independent
* from the generic 150 ms release detector so an occasional missing RF frame
* cannot turn one physical hold into several rapid short presses.
*/
static uint8_t rf433_mode_step_ready(uint8_t command)
{
uint32_t now = rf433_sample_ticks;
if(!rf433_mode_action_valid ||
rf433_mode_last_key != command ||
(uint32_t)(now - rf433_mode_last_action_tick) >=
RF433_MODE_REPEAT_TICKS)
{
rf433_mode_last_key = command;
rf433_mode_last_action_tick = now;
rf433_mode_action_valid = 1U;
return 1U;
}
return 0U;
}
void rf433_receive(void)//RF433 sample, called every 100 us void rf433_receive(void)//RF433 sample, called every 100 us
{ {
rf433_sample_ticks++;
rf433_decoder_sample((RF_DATA == HIGH_LEVEL) ? 1U : 0U); rf433_decoder_sample((RF_DATA == HIGH_LEVEL) ? 1U : 0U);
rf_sample_ticks++;
if(long_time > 0U)
{
long_time--;
long_flag_s = 0U; long_flag_s = 0U;
if(KEY_STATE_re == 1U)
{
if(time_300ms == 0U)
{
time_300ms = RF433_MS_TO_SAMPLE_TICKS(Short_time);
long_flag_s = 1U;
KEY_STATE_re = 0U;
}
else
{
time_300ms--;
}
}
}
else
{
time_300ms = RF433_MS_TO_SAMPLE_TICKS(LongPress_time);
long_flag_s = 0U;
Key_TypeDef.KEY_STATE_Click = 0U;
KEY_STATE_re = 0U;
}
if(time_5s <= PAIRING_WINDOW_TICKS) if(time_5s <= PAIRING_WINDOW_TICKS)
{ {
@@ -414,8 +572,15 @@ void _433_fun(){
pair_deferred_receive_data = receive_data; pair_deferred_receive_data = receive_data;
return; return;
} }
if(rf433_is_mode_step_command(res_data))
sss=1;//记忆标志位 {
if(!rf433_mode_step_ready(res_data)) return;
}
else
{
if(Key_TypeDef.KEY_STATE_Click==1||KEY_STATE_re==1) return;
set_click();
}
switch(res_data){ switch(res_data){
//椭圆 //椭圆
case ON://单击 case ON://单击
@@ -496,91 +661,33 @@ void _433_fun(){
} }
break; break;
} }
set_TaskComps_timer(2U, 1000U);
} }
//3748 //3748
static uint8_t Rf433_Address_Matched(uint32_t code)
{
uint8_t high = (uint8_t)((code >> 16) & 0xffU);
uint8_t low = (uint8_t)((code >> 8) & 0xffU);
uint8_t i;
if(match_success == 0U) return 1U;
for(i = 0U; i < 5U; i++)
{
if(adress_H_array[i] == high && adress_L_array[i] == low)
return 1U;
}
return 0U;
}
static uint8_t Rf433_Time_Reached(uint32_t now, uint32_t deadline)
{
return ((int32_t)(now - deadline) >= 0) ? 1U : 0U;
}
static void Rf433_Run_Command(uint32_t code, uint8_t key)
{
receive_data = code;
res_data = key;
_433_fun();
}
void scan_433(){ void scan_433(){
uint32_t now = rf_sample_ticks;
if(power != 0U) return; if(power==0){
if(rf_flag.rf_receive_flag.receive_finish==1){
if(rf_hold_active && if(match_success==1){
(uint32_t)(now - rf_hold_last_frame_tick) > RF433_HOLD_GAP_TICKS) if((adress_H_array[0]==((receive_data >> 16) & 0xff)&&adress_L_array[0]==((receive_data >> 8) & 0xff))||
{ (adress_H_array[1]==((receive_data >> 16) & 0xff)&&adress_L_array[1]==((receive_data >> 8) & 0xff))||
rf_hold_active = 0U; (adress_H_array[2]==((receive_data >> 16) & 0xff)&&adress_L_array[2]==((receive_data >> 8) & 0xff))||
(adress_H_array[3]==((receive_data >> 16) & 0xff)&&adress_L_array[3]==((receive_data >> 8) & 0xff))||
(adress_H_array[4]==((receive_data >> 16) & 0xff)&&adress_L_array[4]==((receive_data >> 8) & 0xff))
){
_433_fun();
} }
}else if(match_success==0){
if(rf_dispatch_sequence != rf_frame_sequence) _433_fun();
{
uint32_t code = receive_data;
uint8_t key = res_data;
uint32_t frame_gap = (uint32_t)(now - rf_hold_last_frame_tick);
rf_dispatch_sequence = rf_frame_sequence;
rf_flag.rf_receive_flag.receive_finish = 0U;
if(!Rf433_Address_Matched(code))
{
rf_hold_active = 0U;
}
else if(key >= 16U)
{
/* Color-ring frames stay unthrottled for smooth sliding. */
rf_hold_active = 0U;
Rf433_Run_Command(code, key);
}
else if(!rf_hold_active || rf_hold_code != code ||
frame_gap > RF433_HOLD_GAP_TICKS)
{
/* The first valid frame is an immediate short-press action. */
rf_hold_active = 1U;
rf_hold_code = code;
rf_hold_key = key;
rf_hold_last_frame_tick = now;
rf_hold_next_repeat_tick = now + RF433_REPEAT_TICKS;
Rf433_Run_Command(code, key);
}
else
{
rf_hold_last_frame_tick = now;
} }
} }
rf_flag.rf_receive_flag.receive_finish=0;
if(rf_hold_active &&
(uint32_t)(now - rf_hold_last_frame_tick) <= RF433_HOLD_GAP_TICKS &&
Rf433_Time_Reached(now, rf_hold_next_repeat_tick))
{
Rf433_Run_Command(rf_hold_code, rf_hold_key);
rf_hold_next_repeat_tick = now + RF433_REPEAT_TICKS;
} }
} }
@@ -57,6 +57,7 @@
#include "mode.h" #include "mode.h"
#include "RF433.h" #include "RF433.h"
#include "rf433_decoder.h" #include "rf433_decoder.h"
#include "external_key.h"
#include "rgblight.h" #include "rgblight.h"
#include "timer.h" #include "timer.h"
#include "fmc_spi.h" #include "fmc_spi.h"
@@ -389,7 +390,6 @@ int main(void)
#endif #endif
wdt_init();
/* Set the broadcast address of the device. */ /* Set the broadcast address of the device. */
board_init(); board_init();
xc_fmc_spi_init_oprt( ); xc_fmc_spi_init_oprt( );
@@ -397,6 +397,8 @@ int main(void)
fmc_spi_read(); fmc_spi_read();
power_restore_apply_on_boot(); power_restore_apply_on_boot();
/* Start the watchdog after the optional boot-time Flash update. */
wdt_init();
timer0_2_init(); timer0_2_init();
bluetooth_init(); bluetooth_init();
@@ -450,8 +452,10 @@ int main(void)
#endif #endif
// gpio_pullup_input_inter_test(); // gpio_pullup_input_inter_test();
adc_Init(); adc_Init();
rf433_decoder_init(); /* Keep RF433 GPIO initialization after the other input setup. */
rf433_gpio_init(); rf433_gpio_init();
/* Clear any startup transition pulses after RF433 GPIO is stable. */
rf433_decoder_init();
while (1){ while (1){
//DEBUG("222\r\n"); //DEBUG("222\r\n");
//printf("ddd=%d---%d---%d\r\n",W_PWM_duty,C_PWM_duty,(2*deadTime)); //printf("ddd=%d---%d---%d\r\n",W_PWM_duty,C_PWM_duty,(2*deadTime));
@@ -16,7 +16,7 @@
* Dual-color output uses one fixed 500 us frame: * Dual-color output uses one fixed 500 us frame:
* OFF -> W pulse -> OFF -> C pulse -> OFF to frame end. * OFF -> W pulse -> OFF -> C pulse -> OFF to frame end.
* The available OFF time is distributed around both direction changes and * The available OFF time is distributed around both direction changes and
* each W/C transition retains at least 25 us protection. * each W/C transition retains at least 50 us protection.
* Normal dual-color output produces one pulse per color per frame (2 kHz). * Normal dual-color output produces one pulse per color per frame (2 kHz).
* Only the low-output neutral section of three-color breathing uses PDM. * Only the low-output neutral section of three-color breathing uses PDM.
*/ */
@@ -24,8 +24,8 @@
#define BRIDGE_PWM_PERIOD 6U #define BRIDGE_PWM_PERIOD 6U
#define BRIDGE_MIX_SCALE 1000U #define BRIDGE_MIX_SCALE 1000U
#define BRIDGE_FRAME_US 500U #define BRIDGE_FRAME_US 500U
#define BRIDGE_DEADTIME_US 25U #define BRIDGE_DEADTIME_US 50U
#define BRIDGE_DUAL_ACTIVE_US 450U #define BRIDGE_DUAL_ACTIVE_US 400U
#define BRIDGE_MIN_DUAL_PULSE_US 1U #define BRIDGE_MIN_DUAL_PULSE_US 1U
#define BRIDGE_NEUTRAL_PDM_PULSE_US 50U #define BRIDGE_NEUTRAL_PDM_PULSE_US 50U
#define BRIDGE_TIMER_TICKS_PER_US 16U #define BRIDGE_TIMER_TICKS_PER_US 16U
@@ -54,9 +54,14 @@
#define BRIDGE_STAGE_START_C 4U #define BRIDGE_STAGE_START_C 4U
#define BRIDGE_STAGE_END_C 5U #define BRIDGE_STAGE_END_C 5U
#define BRIDGE_FLASH_BLANK_IDLE 0U
#define BRIDGE_FLASH_BLANK_REQUEST 1U
#define BRIDGE_FLASH_BLANK_READY 2U
static volatile uint8_t active_state; static volatile uint8_t active_state;
static volatile uint8_t output_mode; static volatile uint8_t output_mode;
static volatile uint8_t timer_stage; static volatile uint8_t timer_stage;
static volatile uint8_t flash_blank_state;
static volatile uint8_t pending_single_state; static volatile uint8_t pending_single_state;
static volatile uint16_t pending_single_duty; static volatile uint16_t pending_single_duty;
static volatile uint16_t frame_w_us; static volatile uint16_t frame_w_us;
@@ -212,6 +217,7 @@ void Bridge_Init(void)
NVIC_SetPriority((IRQn_Type)TIMER3_IRQn, 0); NVIC_SetPriority((IRQn_Type)TIMER3_IRQn, 0);
NVIC_EnableIRQ(TIMER3_IRQn); NVIC_EnableIRQ(TIMER3_IRQn);
flash_blank_state = BRIDGE_FLASH_BLANK_IDLE;
bridge_ready = 1U; bridge_ready = 1U;
Bridge_Off(); Bridge_Off();
} }
@@ -244,6 +250,57 @@ void Bridge_Off(void)
cached_c_mix = 0xFFFFU; cached_c_mix = 0xFFFFU;
bridge_force_off(); bridge_force_off();
output_mode = BRIDGE_MODE_OFF; output_mode = BRIDGE_MODE_OFF;
if (flash_blank_state == BRIDGE_FLASH_BLANK_REQUEST)
flash_blank_state = BRIDGE_FLASH_BLANK_READY;
}
void Bridge_FlashBlank_Request(void)
{
if (!bridge_ready ||
flash_blank_state != BRIDGE_FLASH_BLANK_IDLE)
return;
if (output_mode == BRIDGE_MODE_DUAL &&
timer_stage != BRIDGE_STAGE_IDLE) {
flash_blank_state = BRIDGE_FLASH_BLANK_REQUEST;
return;
}
flash_blank_state = BRIDGE_FLASH_BLANK_READY;
}
uint8_t Bridge_FlashBlank_Ready(void)
{
return (flash_blank_state == BRIDGE_FLASH_BLANK_READY) ? 1U : 0U;
}
void Bridge_FlashBlank_Resume(void)
{
if (flash_blank_state != BRIDGE_FLASH_BLANK_READY)
return;
flash_blank_state = BRIDGE_FLASH_BLANK_IDLE;
}
/*
* Flash page-program keeps global interrupts disabled. Poll Timer3 from the
* RAM-resident Flash busy loop so the software H-bridge frame continues.
*/
__RAM_CODE void xc_fmc_spi_flash_busy_hook(void)
{
if (!bridge_ready ||
(deviceStatus == POWEROFF && !Light_Transition_FadeActive) ||
output_mode != BRIDGE_MODE_DUAL ||
timer_stage < BRIDGE_STAGE_START_W ||
timer_stage > BRIDGE_STAGE_END_C)
return;
if (timer_tis_get(TIMER3_IDX) != 0U) {
NVIC_ClearPendingIRQ((IRQn_Type)TIMER3_IRQn);
(void)timer_tic_get(TIMER3_IDX);
Bridge_Deadtime_Expired();
}
} }
__RAM_CODE void Bridge_Deadtime_Expired(void) __RAM_CODE void Bridge_Deadtime_Expired(void)
@@ -260,6 +317,10 @@ __RAM_CODE void Bridge_Deadtime_Expired(void)
} }
if (timer_stage == BRIDGE_STAGE_START_W) { if (timer_stage == BRIDGE_STAGE_START_W) {
if (flash_blank_state == BRIDGE_FLASH_BLANK_REQUEST) {
flash_blank_state = BRIDGE_FLASH_BLANK_READY;
}
/* /*
* Latch all four durations together at the W boundary. A brightness * Latch all four durations together at the W boundary. A brightness
* update can then never mix old and new timings inside one frame. * update can then never mix old and new timings inside one frame.
@@ -355,6 +416,9 @@ __RAM_CODE void Bridge_Service_1ms(void)
uint16_t pwm_duty; uint16_t pwm_duty;
uint8_t single_state; uint8_t single_state;
if (flash_blank_state != BRIDGE_FLASH_BLANK_IDLE)
return;
if (!bridge_ready || if (!bridge_ready ||
(deviceStatus == POWEROFF && !Light_Transition_FadeActive)) { (deviceStatus == POWEROFF && !Light_Transition_FadeActive)) {
if (output_mode != BRIDGE_MODE_OFF || timer_stage != BRIDGE_STAGE_IDLE) { if (output_mode != BRIDGE_MODE_OFF || timer_stage != BRIDGE_STAGE_IDLE) {
@@ -457,15 +521,13 @@ __RAM_CODE void Bridge_Service_1ms(void)
pwm_duty = (uint16_t)((total * BRIDGE_PWM_SCALE + pwm_duty = (uint16_t)((total * BRIDGE_PWM_SCALE +
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE); (BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE);
/* /*
* A mixed H-bridge frame has 450 us of active time after deadtime. * Use the same 400 us maximum energy as mixed light for every
* Use the same 450/500 energy at both single-color endpoints of the * single-color output. Switching between the hardware-PWM and
* continuous gradient so its total brightness does not jump there. * Timer3 mixed-light paths therefore does not change total energy.
*/ */
if (Mode == mode3 && choose_mode_falsg == 7U) {
pwm_duty = (uint16_t)( pwm_duty = (uint16_t)(
((uint32_t)pwm_duty * BRIDGE_DUAL_ACTIVE_US + ((uint32_t)pwm_duty * BRIDGE_DUAL_ACTIVE_US +
(BRIDGE_FRAME_US / 2U)) / BRIDGE_FRAME_US); (BRIDGE_FRAME_US / 2U)) / BRIDGE_FRAME_US);
}
if (output_mode == BRIDGE_MODE_SINGLE && if (output_mode == BRIDGE_MODE_SINGLE &&
active_state == single_state && active_state == single_state &&
@@ -488,26 +550,12 @@ __RAM_CODE void Bridge_Service_1ms(void)
if (cached_w_mix != w_mix || cached_c_mix != c_mix || if (cached_w_mix != w_mix || cached_c_mix != c_mix ||
output_mode != BRIDGE_MODE_DUAL) { output_mode != BRIDGE_MODE_DUAL) {
/* /*
* Keep 50 us OFF at maximum dual-color brightness. The OFF time is * Keep 100 us OFF at maximum dual-color brightness. The OFF time is
* split evenly between W->C and C->W, which both absorbs interrupt * split evenly into 50 us for W->C and 50 us for C->W. This absorbs
* latency and spreads the two optical pulses across the 500 us frame. * interrupt latency and spreads both optical pulses across the frame.
*/ */
if (Mode == mode3 && choose_mode_falsg == 8U) {
/*
* The overlap gradient intentionally carries only 40% combined
* output through its crossover. Base that section on the complete
* 500 us frame so entering/leaving dual output does not create a
* 10% brightness step. The 450 us safety ceiling still applies.
*/
total_on_us = (BRIDGE_FRAME_US * total +
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE;
if (total_on_us > BRIDGE_DUAL_ACTIVE_US) {
total_on_us = BRIDGE_DUAL_ACTIVE_US;
}
} else {
total_on_us = (BRIDGE_DUAL_ACTIVE_US * total + total_on_us = (BRIDGE_DUAL_ACTIVE_US * total +
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE; (BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE;
}
/* Keep a non-zero timer interval without imposing a brightness floor. */ /* Keep a non-zero timer interval without imposing a brightness floor. */
if (total_on_us < (2U * BRIDGE_MIN_DUAL_PULSE_US)) { if (total_on_us < (2U * BRIDGE_MIN_DUAL_PULSE_US)) {
total_on_us = 2U * BRIDGE_MIN_DUAL_PULSE_US; total_on_us = 2U * BRIDGE_MIN_DUAL_PULSE_US;
@@ -0,0 +1,278 @@
#include "external_key.h"
#include "xc_drv_gpio.h"
#include "Mode.h"
#include "PWM.h"
#include "RF433.h"
#include "timer.h"
#include "timeslice.h"
#define EXTERNAL_KEY_PIN GPIO_5
#define EXTERNAL_KEY_PRESSED_LEVEL GPIO_PIN_RESET
/* external_key_scan is called every 10 ms. */
#define EXT_KEY_DEBOUNCE_TICKS 2U
#define EXT_KEY_DOUBLE_TICKS 15U
#define EXT_KEY_LONG_TICKS 40U
#define EXT_KEY_BRIGHTNESS_STEP_TICKS 5U
#define EXT_KEY_SPEED_STEP_TICKS 15U
#define EXT_KEY_CLEAR_CODE_TICKS 3000U
#define EXT_KEY_BRIGHTNESS_STEP 3U
#define EXT_KEY_SPEED_STEP 1U
#define EXT_KEY_SAVE_DELAY_MS 1000U
typedef enum
{
EXT_KEY_IDLE = 0,
EXT_KEY_DOWN,
EXT_KEY_WAIT_SECOND,
EXT_KEY_SECOND_DOWN,
EXT_KEY_LONG
} EXT_KEY_STATE;
static EXT_KEY_STATE ext_key_state = EXT_KEY_IDLE;
static uint16_t ext_key_press_ticks;
static uint16_t ext_key_wait_ticks;
static uint16_t ext_key_step_ticks;
static uint8_t ext_key_direction_up = 1U;
static uint8_t ext_key_adjust_speed;
static uint8_t ext_key_clear_triggered;
static uint8_t external_key_is_pressed(void)
{
return xc_gpio_read_pin(EXTERNAL_KEY_PIN) ==
EXTERNAL_KEY_PRESSED_LEVEL;
}
static void external_key_save_later(void)
{
set_TaskComps_timer(2U, EXT_KEY_SAVE_DELAY_MS);
}
static void external_key_power_toggle(void)
{
if(deviceStatus == POWEROFF)
Start_PWM();
else
Stop_PWM();
external_key_save_later();
}
static void external_key_mode_next(void)
{
if(deviceStatus == POWEROFF)
Start_PWM();
if(choose_mode_falsg >= EFFECT_MODE_MAX)
choose_mode_falsg = EFFECT_MODE_MIN;
else
choose_mode_falsg++;
choose_mode_bh = 0U;
startTimer(&timer1, 1U);
external_key_save_later();
}
static void external_key_brightness_step(void)
{
if(ext_key_direction_up)
{
if(Brightness >=
(BRIGHTNESS_MAX_PERCENT - EXT_KEY_BRIGHTNESS_STEP))
Brightness = BRIGHTNESS_MAX_PERCENT;
else
Brightness += EXT_KEY_BRIGHTNESS_STEP;
}
else
{
if(Brightness <=
(BRIGHTNESS_MIN_PERCENT + EXT_KEY_BRIGHTNESS_STEP))
Brightness = BRIGHTNESS_MIN_PERCENT;
else
Brightness -= EXT_KEY_BRIGHTNESS_STEP;
}
}
static void external_key_speed_step(void)
{
/*
* A smaller Speed value is faster in the current effect tables.
* Keep the same direction convention used by DWM11.
*/
if(ext_key_direction_up)
{
if(Speed > SPEED_MIN_LEVEL)
Speed -= EXT_KEY_SPEED_STEP;
}
else
{
if(Speed < SPEED_MAX_LEVEL)
Speed += EXT_KEY_SPEED_STEP;
}
}
static void external_key_adjust_step(void)
{
if(deviceStatus == POWEROFF)
Start_PWM();
if(ext_key_adjust_speed)
external_key_speed_step();
else
external_key_brightness_step();
}
static void external_key_long_start(void)
{
ext_key_adjust_speed = (Mode == mode0) ? 0U : 1U;
ext_key_step_ticks = 0U;
external_key_adjust_step();
}
static void external_key_long_stop(void)
{
if(ext_key_clear_triggered)
{
ext_key_clear_triggered = 0U;
ext_key_adjust_speed = 0U;
return;
}
external_key_save_later();
ext_key_direction_up = ext_key_direction_up ? 0U : 1U;
ext_key_adjust_speed = 0U;
}
void external_key_init(void)
{
GPIO_InitCfg_t gpio_cfg = {0};
gpio_cfg.Mux = GPIO_Mux0;
gpio_cfg.FunSel = GPIO_Dx;
gpio_cfg.Pull = GPIO_PULLUP;
gpio_cfg.Dir = GPIO_DIR_INPUT;
gpio_cfg.Int = NOT_INT;
gpio_cfg.Pin = EXTERNAL_KEY_PIN;
xc_gpio_init(&gpio_cfg);
}
void external_key_scan(void)
{
uint8_t pressed = external_key_is_pressed();
uint16_t step_period;
switch(ext_key_state)
{
case EXT_KEY_IDLE:
if(pressed)
{
ext_key_press_ticks = 1U;
ext_key_step_ticks = 0U;
ext_key_clear_triggered = 0U;
ext_key_state = EXT_KEY_DOWN;
}
break;
case EXT_KEY_DOWN:
if(pressed)
{
if(ext_key_press_ticks < 0xFFFFU)
ext_key_press_ticks++;
if(ext_key_press_ticks >= EXT_KEY_LONG_TICKS)
{
external_key_long_start();
ext_key_state = EXT_KEY_LONG;
}
}
else
{
if(ext_key_press_ticks >= EXT_KEY_DEBOUNCE_TICKS)
{
ext_key_wait_ticks = 0U;
ext_key_state = EXT_KEY_WAIT_SECOND;
}
else
{
ext_key_state = EXT_KEY_IDLE;
}
}
break;
case EXT_KEY_WAIT_SECOND:
if(pressed)
{
ext_key_press_ticks = 1U;
ext_key_step_ticks = 0U;
ext_key_clear_triggered = 0U;
ext_key_state = EXT_KEY_SECOND_DOWN;
}
else
{
ext_key_wait_ticks++;
if(ext_key_wait_ticks >= EXT_KEY_DOUBLE_TICKS)
{
external_key_power_toggle();
ext_key_state = EXT_KEY_IDLE;
}
}
break;
case EXT_KEY_SECOND_DOWN:
if(pressed)
{
if(ext_key_press_ticks < 0xFFFFU)
ext_key_press_ticks++;
if(ext_key_press_ticks >= EXT_KEY_LONG_TICKS)
{
external_key_long_start();
ext_key_state = EXT_KEY_LONG;
}
}
else
{
if(ext_key_press_ticks >= EXT_KEY_DEBOUNCE_TICKS)
external_key_mode_next();
ext_key_state = EXT_KEY_IDLE;
}
break;
case EXT_KEY_LONG:
if(pressed)
{
if(ext_key_press_ticks < 0xFFFFU)
ext_key_press_ticks++;
if(!ext_key_clear_triggered &&
ext_key_press_ticks >= EXT_KEY_CLEAR_CODE_TICKS)
{
ext_key_clear_triggered = 1U;
rf433_clear_code();
}
else if(!ext_key_clear_triggered)
{
step_period = ext_key_adjust_speed ?
EXT_KEY_SPEED_STEP_TICKS :
EXT_KEY_BRIGHTNESS_STEP_TICKS;
ext_key_step_ticks++;
if(ext_key_step_ticks >= step_period)
{
ext_key_step_ticks = 0U;
external_key_adjust_step();
}
}
}
else
{
external_key_long_stop();
ext_key_state = EXT_KEY_IDLE;
}
break;
default:
ext_key_state = EXT_KEY_IDLE;
break;
}
}
@@ -0,0 +1,7 @@
#ifndef _EXTERNAL_KEY_H_
#define _EXTERNAL_KEY_H_
void external_key_init(void);
void external_key_scan(void);
#endif
@@ -33,6 +33,7 @@
#include "PWM.h" #include "PWM.h"
#include "RF433.h" #include "RF433.h"
#include "xc60xx.h" #include "xc60xx.h"
#include "timeslice.h"
/*------------------------------------------------------------------------------------ /*------------------------------------------------------------------------------------
Macros Macros
@@ -77,9 +78,11 @@ unsigned char get_checksum(unsigned char *ptrdata, unsigned char length)
#define FLASH_POWER_MODE_INDEX 28U #define FLASH_POWER_MODE_INDEX 28U
#define FLASH_POWER_CYCLE_INDEX 29U #define FLASH_POWER_CYCLE_INDEX 29U
#define FLASH_POWER_MODE_MARK 0xA7U #define FLASH_POWER_MODE_MARK 0xA7U
#define POWER_POLICY_SAVE_DELAY_MS 100U
#define USER_DATA_FLASH_ADDR 0x1E000UL
uint8_t power_restore_policy = POWER_RESTORE_CYCLE_STATIC; uint8_t power_restore_policy = POWER_RESTORE_CYCLE_STATIC;
static uint8_t power_cycle_next_color; static uint8_t power_cycle_next_mode;
void read_user_data(void) void read_user_data(void)
{ {
@@ -153,14 +156,14 @@ void read_user_data(void)
power_restore_policy = r_data[FLASH_POWER_MODE_INDEX]; power_restore_policy = r_data[FLASH_POWER_MODE_INDEX];
if(power_restore_policy > POWER_RESTORE_CYCLE_STATIC) if(power_restore_policy > POWER_RESTORE_CYCLE_STATIC)
power_restore_policy = POWER_RESTORE_CYCLE_STATIC; power_restore_policy = POWER_RESTORE_CYCLE_STATIC;
power_cycle_next_color = r_data[FLASH_POWER_CYCLE_INDEX]; power_cycle_next_mode = r_data[FLASH_POWER_CYCLE_INDEX];
if(power_cycle_next_color > 2U) if(power_cycle_next_mode > 2U)
power_cycle_next_color = 0U; power_cycle_next_mode = 0U;
} }
else else
{ {
power_restore_policy = POWER_RESTORE_CYCLE_STATIC; power_restore_policy = POWER_RESTORE_CYCLE_STATIC;
power_cycle_next_color = 0U; power_cycle_next_mode = 0U;
} }
//choose_mode_bh=r_data[31]; //choose_mode_bh=r_data[31];
driveMode=r_data[32]; driveMode=r_data[32];
@@ -210,7 +213,7 @@ void wright_user_data(void)
app_data[FLASH_MODE_LAYOUT_INDEX]=FLASH_MODE_LAYOUT_MARK; app_data[FLASH_MODE_LAYOUT_INDEX]=FLASH_MODE_LAYOUT_MARK;
app_data[FLASH_POWER_MODE_MARK_INDEX]=FLASH_POWER_MODE_MARK; app_data[FLASH_POWER_MODE_MARK_INDEX]=FLASH_POWER_MODE_MARK;
app_data[FLASH_POWER_MODE_INDEX]=power_restore_policy; app_data[FLASH_POWER_MODE_INDEX]=power_restore_policy;
app_data[FLASH_POWER_CYCLE_INDEX]=power_cycle_next_color; app_data[FLASH_POWER_CYCLE_INDEX]=power_cycle_next_mode;
app_data[30]=choose_mode_falsg; app_data[30]=choose_mode_falsg;
app_data[31]=choose_mode_bh; app_data[31]=choose_mode_bh;
app_data[32]=driveMode; app_data[32]=driveMode;
@@ -240,33 +243,37 @@ void power_restore_policy_set(uint8_t policy)
{ {
if(policy > POWER_RESTORE_CYCLE_STATIC) return; if(policy > POWER_RESTORE_CYCLE_STATIC) return;
if(policy == POWER_RESTORE_CYCLE_STATIC &&
power_restore_policy != POWER_RESTORE_CYCLE_STATIC)
power_cycle_next_mode = 0U;
if(policy == power_restore_policy) return;
power_restore_policy = policy; power_restore_policy = policy;
if(policy == POWER_RESTORE_CYCLE_STATIC) set_TaskComps_timer(2U, POWER_POLICY_SAVE_DELAY_MS);
power_cycle_next_color = 0U;
sss = 1U;
} }
void power_restore_apply_on_boot(void) void power_restore_apply_on_boot(void)
{ {
uint8_t color; uint8_t mode_index;
if(power_restore_policy != POWER_RESTORE_CYCLE_STATIC) return; if(power_restore_policy != POWER_RESTORE_CYCLE_STATIC) return;
color = power_cycle_next_color; mode_index = power_cycle_next_mode;
if(color > 2U) color = 0U; if(mode_index > 2U) mode_index = 0U;
deviceStatus = POWERON; deviceStatus = POWERON;
Mode = mode0; Mode = mode0;
choose_mode_falsg = color; choose_mode_falsg = mode_index;
choose_mode_bh = 0U; choose_mode_bh = 0U;
if(color == 0U) if(mode_index == 0U)
{ {
W_PWM = 100U; W_PWM = 100U;
C_PWM = 0U; C_PWM = 0U;
driveMode = 1U; driveMode = 1U;
} }
else if(color == 1U) else if(mode_index == 1U)
{ {
W_PWM = 0U; W_PWM = 0U;
C_PWM = 100U; C_PWM = 100U;
@@ -279,6 +286,12 @@ void power_restore_apply_on_boot(void)
driveMode = 0U; driveMode = 0U;
} }
power_cycle_next_color = (uint8_t)((color + 1U) % 3U); power_cycle_next_mode = (uint8_t)((mode_index + 1U) % 3U);
sss = 1U;
/*
* Cycle-static is also a remembered state. Start PWM, BLE and the
* H-bridge through the same path as full-memory restore, then persist
* the next static mode through the normal deferred Flash state machine.
*/
set_TaskComps_timer(2U, POWER_POLICY_SAVE_DELAY_MS);
} }
@@ -9,7 +9,11 @@ volatile uint32_t Light_Transition_C_Output_Q12;
#define BRIGHTNESS_SMOOTH_SHIFT 4U #define BRIGHTNESS_SMOOTH_SHIFT 4U
#define OUTPUT_SMOOTH_SHIFT 4U #define OUTPUT_SMOOTH_SHIFT 4U
#define MODE_TRANSITION_TICKS 40U #define MODE_TRANSITION_TICKS 100U
#define CCT_RING_TRANSITION_TICKS 40U
#define TRANSITION_CURVE_LINEAR 0U
#define TRANSITION_CURVE_GAMMA_S 1U
#define TRANSITION_CURVE_GAMMA_OUT 2U
#define LIGHT_OUTPUT_SCALE 1000U #define LIGHT_OUTPUT_SCALE 1000U
#define BREATH_MIN_OUTPUT (LIGHT_OUTPUT_SCALE / 100U) #define BREATH_MIN_OUTPUT (LIGHT_OUTPUT_SCALE / 100U)
#define DUAL_MIN_STABLE_CHANNEL_OUTPUT 102U #define DUAL_MIN_STABLE_CHANNEL_OUTPUT 102U
@@ -78,6 +82,29 @@ static const uint16_t power_fade_gamma_q12[101] = {
4096U 4096U
}; };
/*
* Symmetric Gamma 1.8 transition curve:
* q = p^1.8 / (p^1.8 + (1-p)^1.8)
*
* Unlike applying Gamma independently to W and C, q and (1-q) remain
* complementary. The transition therefore eases in and out without causing
* a brightness dip in the middle. A table keeps the 5 ms task free of
* floating-point and power calculations.
*/
static const uint16_t transition_gamma_s_q12[101] = {
0U, 1U, 4U, 8U, 13U, 20U, 29U, 39U, 50U, 63U,
77U, 93U, 110U, 130U, 150U, 173U, 197U, 223U, 251U, 281U,
312U, 345U, 381U, 418U, 457U, 498U, 541U, 586U, 633U, 681U,
732U, 784U, 839U, 895U, 953U, 1012U, 1073U, 1136U, 1200U, 1265U,
1332U, 1400U, 1469U, 1539U, 1610U, 1682U, 1754U, 1827U, 1901U, 1974U,
2048U, 2122U, 2195U, 2269U, 2342U, 2414U, 2486U, 2557U, 2627U, 2696U,
2764U, 2831U, 2896U, 2960U, 3023U, 3084U, 3143U, 3201U, 3257U, 3312U,
3364U, 3415U, 3463U, 3510U, 3555U, 3598U, 3639U, 3678U, 3715U, 3751U,
3784U, 3815U, 3845U, 3873U, 3899U, 3923U, 3946U, 3966U, 3986U, 4003U,
4019U, 4033U, 4046U, 4057U, 4067U, 4076U, 4083U, 4088U, 4092U, 4095U,
4096U
};
static uint16_t current_brightness_q12; static uint16_t current_brightness_q12;
static uint16_t power_fade_progress_q12; static uint16_t power_fade_progress_q12;
static uint16_t power_fade_remainder; static uint16_t power_fade_remainder;
@@ -86,6 +113,8 @@ static uint8_t transition_sync_pending;
static uint16_t mode_transition_start_w; static uint16_t mode_transition_start_w;
static uint16_t mode_transition_start_c; static uint16_t mode_transition_start_c;
static uint8_t mode_transition_tick; static uint8_t mode_transition_tick;
static uint8_t mode_transition_total_ticks;
static uint8_t mode_transition_gamma_curve;
static volatile uint8_t feedback_active; static volatile uint8_t feedback_active;
static volatile uint8_t feedback_on; static volatile uint8_t feedback_on;
@@ -153,24 +182,54 @@ static uint16_t approach_target(uint16_t current, uint16_t target)
return current - step; return current - step;
} }
static uint16_t transition_gamma_s_scale(uint8_t tick, uint8_t total_ticks)
{
uint16_t index;
if(total_ticks == 0U || tick >= total_ticks) return 4096U;
index = (uint16_t)(((uint16_t)tick * 100U +
(total_ticks / 2U)) / total_ticks);
if(index > 100U) index = 100U;
return transition_gamma_s_q12[index];
}
static uint16_t transition_gamma_out_scale(uint8_t tick, uint8_t total_ticks)
{
uint16_t index;
if(total_ticks == 0U || tick >= total_ticks) return 4096U;
index = (uint16_t)(((uint16_t)tick * 100U +
(total_ticks / 2U)) / total_ticks);
if(index > 100U) index = 100U;
return (uint16_t)(4096U - power_fade_gamma_q12[100U - index]);
}
static uint16_t interpolate_mode_output(uint16_t start, uint16_t target, static uint16_t interpolate_mode_output(uint16_t start, uint16_t target,
uint8_t tick) uint8_t tick)
{ {
uint32_t delta; uint32_t delta;
uint16_t progress_q12;
uint8_t total_ticks = mode_transition_total_ticks;
if(total_ticks == 0U || tick >= total_ticks) return target;
if(mode_transition_gamma_curve == TRANSITION_CURVE_GAMMA_S)
progress_q12 = transition_gamma_s_scale(tick, total_ticks);
else if(mode_transition_gamma_curve == TRANSITION_CURVE_GAMMA_OUT)
progress_q12 = transition_gamma_out_scale(tick, total_ticks);
else
progress_q12 = (uint16_t)(
((uint32_t)tick * 4096U + (total_ticks / 2U)) / total_ticks);
if(tick >= MODE_TRANSITION_TICKS) return target;
if(target >= start) if(target >= start)
{ {
delta = (uint32_t)(target - start) * tick; delta = (uint32_t)(target - start) * progress_q12;
return (uint16_t)(start + return (uint16_t)(start +
((delta + (MODE_TRANSITION_TICKS / 2U)) / ((delta + 2048U) >> 12));
MODE_TRANSITION_TICKS));
} }
delta = (uint32_t)(start - target) * tick; delta = (uint32_t)(start - target) * progress_q12;
return (uint16_t)(start - return (uint16_t)(start -
((delta + (MODE_TRANSITION_TICKS / 2U)) / ((delta + 2048U) >> 12));
MODE_TRANSITION_TICKS));
} }
static uint16_t effect_gamma_output(uint16_t level) static uint16_t effect_gamma_output(uint16_t level)
@@ -265,6 +324,16 @@ void Light_Transition_BeginModeChange(void)
mode_transition_start_w = W_PWM_duty; mode_transition_start_w = W_PWM_duty;
mode_transition_start_c = C_PWM_duty; mode_transition_start_c = C_PWM_duty;
mode_transition_tick = 0U; mode_transition_tick = 0U;
mode_transition_total_ticks =
(choose_mode_falsg == CUSTOM_TEMPERATURE_MODE)
? CCT_RING_TRANSITION_TICKS : MODE_TRANSITION_TICKS;
if(Mode == mode0 && choose_mode_falsg <= 2U)
mode_transition_gamma_curve = TRANSITION_CURVE_GAMMA_S;
else if(Mode == mode0 &&
choose_mode_falsg == CUSTOM_TEMPERATURE_MODE)
mode_transition_gamma_curve = TRANSITION_CURVE_GAMMA_OUT;
else
mode_transition_gamma_curve = TRANSITION_CURVE_GAMMA_S;
Light_Transition_ModeActive = 1U; Light_Transition_ModeActive = 1U;
} }
@@ -302,6 +371,7 @@ void Light_Transition_Task(void)
uint16_t weak_mix; uint16_t weak_mix;
uint16_t required_total; uint16_t required_total;
uint16_t floor_w; uint16_t floor_w;
uint16_t color_progress_q12;
uint32_t scaled_w_q12; uint32_t scaled_w_q12;
uint32_t scaled_c_q12; uint32_t scaled_c_q12;
uint8_t power_transitioning; uint8_t power_transitioning;
@@ -344,18 +414,28 @@ void Light_Transition_Task(void)
/* /*
* Continuous CCT uses one shared brightness envelope. Derive one * Continuous CCT uses one shared brightness envelope. Derive one
* side from the other so every visible step is strictly complementary * side from the other so every visible step is strictly complementary
* and W + C remains constant throughout the sweep. * and W + C remains constant throughout the sweep. Map the color
* position through the same symmetric Gamma curve used by static
* transitions so the ends of each sweep are also eased.
*/ */
target_total = (uint16_t)( target_total = (uint16_t)(
((uint32_t)LIGHT_OUTPUT_SCALE * brightness_scale + 2048U) >> 12); ((uint32_t)LIGHT_OUTPUT_SCALE * brightness_scale + 2048U) >> 12);
target_w = (uint16_t)( color_progress_q12 =
((uint32_t)target_total * W_PWM + 50U) / 100U); transition_gamma_s_q12[(C_PWM <= 100U) ? C_PWM : 100U];
if(target_w > target_total) target_c = (uint16_t)(
target_w = target_total; ((uint32_t)target_total * color_progress_q12 + 2048U) >> 12);
target_c = target_total - target_w; if(target_c > target_total)
target_c = target_total;
target_w = target_total - target_c;
} }
else if(Mode == mode1) else if(Mode == mode1 ||
(Mode == mode3 && choose_mode_falsg == 8U))
{ {
/*
* Breathing and overlap-gradient amplitudes are perceptual light
* transitions, so both use the Gamma table instead of raw linear
* channel levels. Jump/flash modes remain outside this branch.
*/
target_w = (uint16_t)( target_w = (uint16_t)(
((uint32_t)effect_gamma_output(W_PWM) * ((uint32_t)effect_gamma_output(W_PWM) *
brightness_scale + 2048U) >> 12); brightness_scale + 2048U) >> 12);
@@ -435,9 +515,11 @@ void Light_Transition_Task(void)
C_PWM_duty = C_PWM_duty =
interpolate_mode_output(mode_transition_start_c, target_c, interpolate_mode_output(mode_transition_start_c, target_c,
mode_transition_tick); mode_transition_tick);
if(mode_transition_tick >= MODE_TRANSITION_TICKS) if(mode_transition_tick >= mode_transition_total_ticks)
{
Light_Transition_ModeActive = 0U; Light_Transition_ModeActive = 0U;
} }
}
else if(((Mode == mode2 || Mode == mode3) && powered_on) || else if(((Mode == mode2 || Mode == mode3) && powered_on) ||
power_transitioning || power_transitioning ||
transition_sync_pending) transition_sync_pending)
@@ -4,6 +4,14 @@
// extern uint8_t ble_flash_operation_can_check(void); // extern uint8_t ble_flash_operation_can_check(void);
#include "ota_protocol.h" #include "ota_protocol.h"
#include "fmc_spi.h" #include "fmc_spi.h"
#include "PWM.h"
#define USER_DATA_FLASH_ADDR 0x1E000UL
#define USER_FLASH_WRITE_CHUNKS 16U
#define USER_FLASH_CHUNK_GAP_MS 20U
static uint8_t user_flash_write_chunk;
static uint8_t user_flash_chunk_gap_ms;
op_flash_t op_flash = { op_flash_t op_flash = {
OP_IDEL, OP_IDEL,
}; };
@@ -62,9 +70,43 @@ void ble_flash_handle(void)
{ {
// LOGI("FMC_SPI_Flash_WritePage: op_flash.op_addr=%x\n", // LOGI("FMC_SPI_Flash_WritePage: op_flash.op_addr=%x\n",
// op_flash.op_addr); // op_flash.op_addr);
if(op_flash.op_addr == USER_DATA_FLASH_ADDR)
{
if(user_flash_chunk_gap_ms != 0U)
{
user_flash_chunk_gap_ms--;
return;
}
uint32_t chunk_offset =
(uint32_t)user_flash_write_chunk * 16U;
Bridge_FlashBlank_Request();
if(Bridge_FlashBlank_Ready() == 0U)
return;
GLOBAL_INT_DISABLE();
FMC_SPI_Flash_Write16Bytes(
op_flash.op_addr + chunk_offset,
&op_flash.op_buff[chunk_offset]);
GLOBAL_INT_RESTORE();
Bridge_FlashBlank_Resume();
user_flash_write_chunk++;
if(user_flash_write_chunk < USER_FLASH_WRITE_CHUNKS) {
user_flash_chunk_gap_ms = USER_FLASH_CHUNK_GAP_MS;
return;
}
user_flash_write_chunk = 0U;
user_flash_chunk_gap_ms = 0U;
}
else
{
GLOBAL_INT_DISABLE(); GLOBAL_INT_DISABLE();
FMC_SPI_Flash_WritePage(op_flash.op_addr, op_flash.op_buff, 256); FMC_SPI_Flash_WritePage(op_flash.op_addr, op_flash.op_buff, 256);
GLOBAL_INT_RESTORE(); GLOBAL_INT_RESTORE();
}
op_flash.op_state = OP_IDEL; op_flash.op_state = OP_IDEL;
app_op_flash_flag = 2; app_op_flash_flag = 2;
@@ -83,29 +125,39 @@ void ble_flash_handle(void)
} }
} else if (op_flash.op_state == OP_WIAT_PAGE_ERASE) { } else if (op_flash.op_state == OP_WIAT_PAGE_ERASE) {
{ {
if(op_flash.op_addr == USER_DATA_FLASH_ADDR) {
Bridge_FlashBlank_Request();
if(Bridge_FlashBlank_Ready() == 0U)
return;
}
GLOBAL_INT_DISABLE(); GLOBAL_INT_DISABLE();
FMC_SPI_Flash_Erase_Page(op_flash.op_addr); FMC_SPI_Flash_Erase_Page(op_flash.op_addr);
GLOBAL_INT_RESTORE(); GLOBAL_INT_RESTORE();
if(op_flash.op_addr == USER_DATA_FLASH_ADDR) {
Bridge_FlashBlank_Resume();
user_flash_write_chunk = 0U;
user_flash_chunk_gap_ms = 0U;
}
op_flash.op_state = OP_IDEL; op_flash.op_state = OP_IDEL;
app_op_flash_flag = 1; app_op_flash_flag = 1;
} }
} }
} }
uint8_t app_data[128] = {0}; uint8_t app_data[FLASH_PAGE_SIZE] = {0};
//uint16_t app_op_flash_start = 10000; //uint16_t app_op_flash_start = 10000;
void app_op_flash(void) void app_op_flash(void)
{ {
if(op_flash.op_state == OP_IDEL&&app_op_flash_flag ==0) if(op_flash.op_state == OP_IDEL && app_op_flash_flag == 0U)
{ {
ble_flash_later_page_erase(0x1E000); ble_flash_later_page_erase(USER_DATA_FLASH_ADDR);
} }
else if(op_flash.op_state == OP_IDEL &&app_op_flash_flag ==1) else if(op_flash.op_state == OP_IDEL && app_op_flash_flag == 1U)
{ {
ble_flash_later_write_page(app_data,0x1E000); ble_flash_later_write_page(app_data, USER_DATA_FLASH_ADDR);
} }
} }
@@ -7,7 +7,9 @@
#endif // (USE_ROM_FLASH) #endif // (USE_ROM_FLASH)
#endif // !(USE_XIP) #endif // !(USE_XIP)
#include <stdint.h> #include <stdint.h>
void xc_fmc_spi_flash_write_16bytes(uint32_t addr, uint8_t *data);
#define FMC_SPI_Flash_WritePage xc_fmc_spi_flash_write_page #define FMC_SPI_Flash_WritePage xc_fmc_spi_flash_write_page
#define FMC_SPI_Flash_Write16Bytes xc_fmc_spi_flash_write_16bytes
#define FMC_SPI_Flash_ReadPage xc_fmc_spi_flash_read_page #define FMC_SPI_Flash_ReadPage xc_fmc_spi_flash_read_page
#define FMC_SPI_Flash_Erase_Sector FMC_SPI_Flash_Erase_Sector #define FMC_SPI_Flash_Erase_Sector FMC_SPI_Flash_Erase_Sector
#define FMC_SPI_Flash_Erase_Page xc_fmc_spi_flash_erase_page #define FMC_SPI_Flash_Erase_Page xc_fmc_spi_flash_erase_page
@@ -42,5 +44,3 @@ int ble_flash_later_write_page(uint8_t *buff, uint32_t PageAddR);
int ble_flash_later_sector_erase(uint32_t addr); int ble_flash_later_sector_erase(uint32_t addr);
#endif // __OTA_FLASH_INTERFACE_H_ #endif // __OTA_FLASH_INTERFACE_H_
@@ -1,657 +1,179 @@
#include "rf433_decoder.h" #include "rf433_decoder.h"
#include "rf433_decoder_port.h" #include "rf433_decoder_port.h"
#define RF433_FIFO_SIZE 256u /*
* DWM11 fixed-width 24-bit RF433 decoder.
*
* The input is sampled every 100 us. A complete pulse pair is evaluated on
* each rising edge, exactly like the proven DWM11 implementation.
*/
#define RF433_SYNC_HIGH_MIN_EXCLUSIVE 1u
#define RF433_SYNC_HIGH_MAX_EXCLUSIVE 7u
#define RF433_SYNC_LOW_MIN_EXCLUSIVE 115u
#define RF433_SYNC_LOW_MAX_EXCLUSIVE 130u
#define RF433_SYNC_LOW_MIN 35u //45改35 #define RF433_ZERO_HIGH_MIN 1u
#define RF433_SYNC_LOW_MAX 200u //180改200 #define RF433_ZERO_HIGH_MAX 7u
#define RF433_SYNC_HIGH_MIN 1u #define RF433_ZERO_LOW_MIN 7u
#define RF433_SYNC_HIGH_MAX 15u //12改15 #define RF433_ZERO_LOW_MAX 16u
#define RF433_ONE_HIGH_MIN 7u
#define RF433_ONE_HIGH_MAX 16u
#define RF433_ONE_LOW_MIN 2u
#define RF433_ONE_LOW_MAX 7u
#define RF433_BIT_LEN 24u #define RF433_BIT_LEN 24u
#define RF433_DIRECT_CONFIRM 1u
#define RF433_WEAK_CONFIRM 2u
#define RF433_LEVEL_TIMEOUT 300u //300
#define RF433_BIT_TOTAL_MIN 3u //4改3
#define RF433_BIT_TOTAL_MAX 40u //35改40
#define RF433_PROCESS_MAX_ONCE 32u
#define RF433_FRAME_SCORE_DIRECT_MIN 50u
#define RF433_FRAME_SCORE_WEAK_MIN 35u
#define RF433_BIT_SCORE_GOOD 4u
#define RF433_BIT_SCORE_NORMAL 3u
#define RF433_BIT_SCORE_POOR 1u
#define RF433_WINDOW_TIGHT 0u
#define RF433_WINDOW_NORMAL 1u
#define RF433_WINDOW_LOOSE 2u
// 新增:连发屏蔽间隔(单位:100us采样tick,200=20ms内相同码只输出一次)
#define RF433_ANTI_REPEAT_TICK 200u
#if RF433_DECODER_DEBUG_DETAIL
#define RF433_DETAIL_LOG(fmt, ...) RF433_DECODER_LOG(fmt, ##__VA_ARGS__)
#else
#define RF433_DETAIL_LOG(fmt, ...)
#endif
typedef enum
{
RF433_STATE_IDLE = 0,
RF433_STATE_DATA,
} Rf433State_t;
typedef struct typedef struct
{ {
uint8_t level; volatile uint16_t high_ticks;
uint16_t width; volatile uint16_t low_ticks;
} Rf433Pulse_t; volatile uint8_t current_level;
volatile uint8_t sync_found;
typedef struct volatile uint8_t bit_count;
{ volatile uint32_t data;
volatile Rf433Pulse_t fifo[RF433_FIFO_SIZE]; volatile uint8_t frame_ready;
volatile uint16_t w;
volatile uint16_t r;
volatile uint16_t lost;
uint8_t last_level;
uint16_t width;
uint8_t inited;
} Rf433Fifo_t;
typedef struct
{
Rf433State_t state;
uint16_t last_high;
uint16_t last_low;
uint16_t t;
uint16_t short_min;
uint16_t short_max;
uint16_t long_min;
uint16_t long_max;
uint32_t data;
uint8_t bit_cnt;
uint8_t bit_score_sum;
uint8_t frame_score;
uint8_t ppl_locked;
uint8_t window_mode;
uint32_t last_code;
uint8_t same_cnt;
Rf433DecoderFrame_t frame; Rf433DecoderFrame_t frame;
bool frame_ready; } Rf433Dwm11Decoder_t;
static Rf433Dwm11Decoder_t s_dec;
} Rf433Decode_t; static void rf433_increment_saturated(volatile uint16_t *value)
static Rf433Fifo_t s_fifo;
static Rf433Decode_t s_dec;
static uint16_t rf433_limit_t(uint16_t t)
{ {
if (t < 2u) if (*value < 0xffffu)
{ {
t = 2u; (*value)++;
}
if (t > 12u)
{
t = 12u;
}
return t;
}
static void rf433_update_range_by_t(uint16_t t)
{
t = rf433_limit_t(t);
s_dec.t = t;
if (s_dec.window_mode == RF433_WINDOW_TIGHT)
{
s_dec.short_min = 1u;
s_dec.short_max = (uint16_t)(t + t / 2u + 2u);
s_dec.long_min = (uint16_t)(t * 2u);
s_dec.long_max = (uint16_t)(t * 4u + 2u);
}
else if (s_dec.window_mode == RF433_WINDOW_LOOSE)
{
s_dec.short_min = 1u;
s_dec.short_max = (uint16_t)(t * 2u + 4u);
s_dec.long_min = (uint16_t)(t + t / 2u);
if (s_dec.long_min < 3u)
{
s_dec.long_min = 3u;
}
s_dec.long_max = (uint16_t)(t * 7u + 4u);
}
else
{
s_dec.short_min = 1u;
s_dec.short_max = (uint16_t)(t * 2u + 3u);
s_dec.long_min = (uint16_t)(t + t / 2u);
if (s_dec.long_min < 3u)
{
s_dec.long_min = 3u;
}
s_dec.long_max = (uint16_t)(t * 7u + 3u);
} }
} }
static void rf433_decode_reset(void) static uint8_t rf433_in_range(uint16_t value, uint16_t min, uint16_t max)
{ {
s_dec.state = RF433_STATE_IDLE; return (value >= min && value <= max) ? 1u : 0u;
s_dec.last_high = 0;
s_dec.last_low = 0;
s_dec.data = 0;
s_dec.bit_cnt = 0;
s_dec.bit_score_sum = 0;
s_dec.frame_score = 0;
s_dec.window_mode = RF433_WINDOW_NORMAL;
rf433_update_range_by_t(4u);
} }
static void rf433_debug_reset(const char *reason, uint16_t high, uint16_t low) static uint8_t rf433_is_sync(uint16_t high, uint16_t low)
{ {
RF433_DETAIL_LOG("[RF433 RESET] %s bits=%d high=%d low=%d data=0x%06X T=%d win=%d lost=%d\r\n", return (high > RF433_SYNC_HIGH_MIN_EXCLUSIVE &&
reason, high < RF433_SYNC_HIGH_MAX_EXCLUSIVE &&
s_dec.bit_cnt, low > RF433_SYNC_LOW_MIN_EXCLUSIVE &&
high, low < RF433_SYNC_LOW_MAX_EXCLUSIVE) ? 1u : 0u;
low, }
(unsigned int)s_dec.data,
s_dec.t, static void rf433_publish_frame(uint32_t code)
s_dec.window_mode, {
s_fifo.lost); s_dec.frame.code = code;
s_dec.frame.bit_len = RF433_BIT_LEN;
s_dec.frame.addr_h = (uint8_t)((code >> 16) & 0xffu);
s_dec.frame.addr_l = (uint8_t)((code >> 8) & 0xffu);
s_dec.frame.key = (uint8_t)(code & 0xffu);
s_dec.frame.score = 100u;
s_dec.frame_ready = 1u;
RF433_DECODER_LOG("[RF433 DWM11 OK] code=0x%06X key=0x%02X\r\n",
(unsigned int)code,
s_dec.frame.key);
}
static void rf433_decode_bit(uint8_t bit)
{
s_dec.data <<= 1;
if (bit != 0u)
{
s_dec.data |= 1u;
}
s_dec.bit_count++;
if (s_dec.bit_count >= RF433_BIT_LEN)
{
rf433_publish_frame(s_dec.data);
s_dec.sync_found = 0u;
s_dec.bit_count = 0u;
}
} }
void rf433_decoder_init(void) void rf433_decoder_init(void)
{ {
s_fifo.w = 0; s_dec.high_ticks = 0u;
s_fifo.r = 0; s_dec.low_ticks = 0u;
s_fifo.lost = 0; s_dec.current_level = 0u;
s_fifo.last_level = 0; s_dec.sync_found = 0u;
s_fifo.width = 0; s_dec.bit_count = 0u;
s_fifo.inited = 0; s_dec.data = 0u;
s_dec.frame_ready = 0u;
s_dec.last_code = 0;
s_dec.same_cnt = 0;
s_dec.frame_ready = false;
s_dec.ppl_locked = 0;
s_dec.window_mode = RF433_WINDOW_NORMAL;
rf433_decode_reset();
} }
void rf433_decoder_sample(uint8_t level) void rf433_decoder_sample(uint8_t level)
{ {
uint16_t next; uint16_t high;
Rf433Pulse_t pulse; uint16_t low;
level = level ? 1u : 0u; level = level ? 1u : 0u;
if (!s_fifo.inited) if (level == 0u)
{ {
s_fifo.last_level = level; rf433_increment_saturated(&s_dec.low_ticks);
s_fifo.width = 1; s_dec.current_level = 0u;
s_fifo.inited = 1;
return; return;
} }
if (level == s_fifo.last_level) rf433_increment_saturated(&s_dec.high_ticks);
if (s_dec.current_level == 0u)
{ {
if (s_fifo.width < 0xFFFFu) high = s_dec.high_ticks;
low = s_dec.low_ticks;
if (rf433_is_sync(high, low))
{ {
s_fifo.width++; s_dec.sync_found = 1u;
s_dec.bit_count = 0u;
s_dec.data = 0u;
} }
return; else if (s_dec.sync_found != 0u)
}
pulse.level = s_fifo.last_level;
pulse.width = s_fifo.width;
s_fifo.last_level = level;
s_fifo.width = 1;
next = (uint16_t)((s_fifo.w + 1u) % RF433_FIFO_SIZE);
if (next != s_fifo.r)
{ {
s_fifo.fifo[s_fifo.w] = pulse; if (rf433_in_range(high, RF433_ZERO_HIGH_MIN, RF433_ZERO_HIGH_MAX) &&
s_fifo.w = next; rf433_in_range(low, RF433_ZERO_LOW_MIN, RF433_ZERO_LOW_MAX))
}
else if (s_fifo.lost < 0xFFFFu)
{ {
s_fifo.lost++; rf433_decode_bit(0u);
} }
} else if (rf433_in_range(high, RF433_ONE_HIGH_MIN, RF433_ONE_HIGH_MAX) &&
rf433_in_range(low, RF433_ONE_LOW_MIN, RF433_ONE_LOW_MAX))
static bool rf433_fifo_pop(Rf433Pulse_t *pulse)
{
if (pulse == 0 || s_fifo.r == s_fifo.w)
{ {
return false; rf433_decode_bit(1u);
}
*pulse = s_fifo.fifo[s_fifo.r];
s_fifo.r = (uint16_t)((s_fifo.r + 1u) % RF433_FIFO_SIZE);
return true;
}
static bool rf433_is_sync(uint16_t high, uint16_t low)
{
if (high == 0u || low == 0u)
{
return false;
}
if (high < RF433_SYNC_HIGH_MIN || high > RF433_SYNC_HIGH_MAX)
{
return false;
}
if (low < RF433_SYNC_LOW_MIN || low > RF433_SYNC_LOW_MAX)
{
return false;
}
if (low < (uint16_t)(high * 10u)) //12
{
return false;
}
return true;
}
static void rf433_ppl_update_by_sync(uint16_t sync_low)
{
uint16_t t_new = rf433_limit_t((uint16_t)(sync_low / 31u));
uint16_t t_filter;
if (s_dec.ppl_locked)
{
t_filter = (uint16_t)((s_dec.t * 7u + t_new) / 8u);
} }
else else
{ {
t_filter = (uint16_t)((s_dec.t * 3u + t_new) / 4u); s_dec.sync_found = 0u;
} s_dec.bit_count = 0u;
s_dec.data = 0u;
rf433_update_range_by_t(t_filter);
}
static void rf433_update_t_by_bit(uint16_t high, uint16_t low, uint8_t bit)
{
uint16_t t_new;
uint16_t t_filter;
if (bit == 0u)
{
t_new = (uint16_t)((high + low / 3u) / 2u);
}
else
{
t_new = (uint16_t)((high / 3u + low) / 2u);
}
t_new = rf433_limit_t(t_new);
if (s_dec.ppl_locked)
{
t_filter = (uint16_t)((s_dec.t * 7u + t_new) / 8u);
}
else
{
t_filter = (uint16_t)((s_dec.t * 3u + t_new) / 4u);
}
rf433_update_range_by_t(t_filter);
}
static bool rf433_is_short(uint16_t width)
{
return ((width >= s_dec.short_min) && (width <= s_dec.short_max));
}
static bool rf433_is_long(uint16_t width)
{
return ((width >= s_dec.long_min) && (width <= s_dec.long_max));
}
static bool rf433_total_valid(uint16_t high, uint16_t low)
{
uint16_t total = (uint16_t)(high + low);
return ((total >= RF433_BIT_TOTAL_MIN) && (total <= RF433_BIT_TOTAL_MAX));
}
static bool rf433_decode_bit(uint16_t high, uint16_t low, uint8_t *bit)
{
if (bit == 0 || !rf433_total_valid(high, low))
{
return false;
}
if (rf433_is_short(high) && rf433_is_long(low))
{
*bit = 0;
return true;
}
if (rf433_is_long(high) && rf433_is_short(low))
{
*bit = 1;
return true;
}
return false;
}
#if RF433_DECODER_DEBUG_DETAIL
static const char *rf433_bit_fail_reason(uint16_t high, uint16_t low)
{
if (!rf433_total_valid(high, low))
{
return "total";
}
if (!rf433_is_short(high) && !rf433_is_long(high))
{
return "high";
}
if (!rf433_is_short(low) && !rf433_is_long(low))
{
return "low";
}
return "pair";
}
#endif
static uint16_t rf433_abs_diff_u16(uint16_t a, uint16_t b)
{
return (a > b) ? (uint16_t)(a - b) : (uint16_t)(b - a);
}
static uint8_t rf433_score_bit(uint16_t high, uint16_t low, uint8_t bit)
{
uint16_t ideal_high;
uint16_t ideal_low;
uint16_t err;
if (bit == 0u)
{
ideal_high = s_dec.t;
ideal_low = (uint16_t)(s_dec.t * 3u);
}
else
{
ideal_high = (uint16_t)(s_dec.t * 3u);
ideal_low = s_dec.t;
}
err = (uint16_t)(rf433_abs_diff_u16(high, ideal_high) +
rf433_abs_diff_u16(low, ideal_low));
if (err <= 2u)
{
return RF433_BIT_SCORE_GOOD;
}
if (err <= 5u)
{
return RF433_BIT_SCORE_NORMAL;
}
return RF433_BIT_SCORE_POOR;
}
static uint8_t rf433_calc_frame_score(void)
{
uint16_t score;
if (s_dec.bit_cnt == 0u)
{
return 0u;
}
score = (uint16_t)s_dec.bit_score_sum * 100u;
score = score / (uint16_t)(RF433_BIT_LEN * RF433_BIT_SCORE_GOOD);
return (score > 100u) ? 100u : (uint8_t)score;
}
static void rf433_update_window_by_score(uint8_t score)
{
if (score >= 90u)
{
s_dec.window_mode = RF433_WINDOW_TIGHT;
s_dec.ppl_locked = 1u;
}
else if (score >= 60u)
{
s_dec.window_mode = RF433_WINDOW_NORMAL;
}
else
{
s_dec.window_mode = RF433_WINDOW_LOOSE;
s_dec.ppl_locked = 0u;
}
rf433_update_range_by_t(s_dec.t);
}
static void rf433_output_code(uint32_t code, uint8_t required_count)
{
if (code == s_dec.last_code)
{
if (s_dec.same_cnt < 255u)
{
s_dec.same_cnt++;
} }
} }
else
{
s_dec.last_code = code;
s_dec.same_cnt = 1;
s_dec.low_ticks = 0u;
s_dec.high_ticks = 1u;
} }
RF433_DETAIL_LOG("[RF433 REPEAT] code=0x%06X same=%d/%d\r\n", s_dec.current_level = 1u;
(unsigned int)code,
s_dec.same_cnt,
required_count);
if (s_dec.same_cnt >= required_count)
{
s_dec.frame.code = code;
s_dec.frame.bit_len = RF433_BIT_LEN;
s_dec.frame.addr_h = (uint8_t)((code >> 16) & 0xFFu);
s_dec.frame.addr_l = (uint8_t)((code >> 8) & 0xFFu);
s_dec.frame.key = (uint8_t)(code & 0xFFu);
s_dec.frame.score = s_dec.frame_score;
s_dec.frame_ready = true;
s_dec.same_cnt = 0;
RF433_DECODER_LOG("[RF433 OK] code=0x%06X addr_h=0x%02X addr_l=0x%02X key=0x%02X score=%d\r\n",
(unsigned int)s_dec.frame.code,
s_dec.frame.addr_h,
s_dec.frame.addr_l,
s_dec.frame.key,
s_dec.frame.score);
}
}
static void rf433_process_clean_pulse(Rf433Pulse_t pulse)
{
uint8_t bit;
uint8_t bit_score;
if (pulse.width == 0u)
{
return;
}
if (pulse.width > RF433_LEVEL_TIMEOUT)
{
rf433_debug_reset("timeout", s_dec.last_high, pulse.width);
rf433_decode_reset();
return;
}
if (pulse.level)
{
s_dec.last_high = pulse.width;
return;
}
s_dec.last_low = pulse.width;
if (rf433_is_sync(s_dec.last_high, s_dec.last_low))
{
s_dec.window_mode = s_dec.ppl_locked ? RF433_WINDOW_TIGHT : RF433_WINDOW_NORMAL;
rf433_ppl_update_by_sync(s_dec.last_low);
RF433_DETAIL_LOG("[RF433 SYNC] high=%d low=%d T=%d short=%d-%d long=%d-%d win=%d lock=%d\r\n",
s_dec.last_high,
s_dec.last_low,
s_dec.t,
s_dec.short_min,
s_dec.short_max,
s_dec.long_min,
s_dec.long_max,
s_dec.window_mode,
s_dec.ppl_locked);
s_dec.state = RF433_STATE_DATA;
s_dec.data = 0;
s_dec.bit_cnt = 0;
s_dec.bit_score_sum = 0;
s_dec.frame_score = 0;
s_dec.last_high = 0;
s_dec.last_low = 0;
return;
}
if (s_dec.state != RF433_STATE_DATA ||
s_dec.last_high == 0u ||
s_dec.last_low == 0u)
{
return;
}
if (rf433_decode_bit(s_dec.last_high, s_dec.last_low, &bit))
{
bit_score = rf433_score_bit(s_dec.last_high, s_dec.last_low, bit);
if (s_dec.bit_score_sum <= (uint8_t)(255u - bit_score))
{
s_dec.bit_score_sum += bit_score;
}
rf433_update_t_by_bit(s_dec.last_high, s_dec.last_low, bit);
s_dec.data <<= 1;
if (bit)
{
s_dec.data |= 1u;
}
s_dec.bit_cnt++;
RF433_DETAIL_LOG("[RF433 BIT] idx=%02d bit=%d high=%d low=%d score=%d T=%d data=0x%06X\r\n",
s_dec.bit_cnt,
bit,
s_dec.last_high,
s_dec.last_low,
bit_score,
s_dec.t,
(unsigned int)s_dec.data);
if (s_dec.bit_cnt >= RF433_BIT_LEN)
{
s_dec.frame_score = rf433_calc_frame_score();
rf433_update_window_by_score(s_dec.frame_score);
RF433_DECODER_LOG("[RF433 FRAME] score=%3d T=%2d win=%d lock=%d bits=%2d code=0x%06X addr_h=0x%02X addr_l=0x%02X key=0x%02X\r\n",
s_dec.frame_score,
s_dec.t,
s_dec.window_mode,
s_dec.ppl_locked,
s_dec.bit_cnt,
(unsigned int)s_dec.data,
(unsigned int)((s_dec.data >> 16) & 0xFFu),
(unsigned int)((s_dec.data >> 8) & 0xFFu),
(unsigned int)(s_dec.data & 0xFFu));
if (s_dec.frame_score >= RF433_FRAME_SCORE_DIRECT_MIN)
{
rf433_output_code(s_dec.data, RF433_DIRECT_CONFIRM);
}
else if (s_dec.frame_score >= RF433_FRAME_SCORE_WEAK_MIN)
{
rf433_output_code(s_dec.data, RF433_WEAK_CONFIRM);
}
else
{
RF433_DECODER_LOG("[RF433 BAD] score=%d code=0x%06X\r\n",
s_dec.frame_score,
(unsigned int)s_dec.data);
}
rf433_decode_reset();
}
}
else
{
#if RF433_DECODER_DEBUG_DETAIL
RF433_DETAIL_LOG("[RF433 BIT_ERR] reason=%s idx=%02d high=%d low=%d total=%d T=%d short=%d-%d long=%d-%d data=0x%06X\r\n",
rf433_bit_fail_reason(s_dec.last_high, s_dec.last_low),
(uint8_t)(s_dec.bit_cnt + 1u),
s_dec.last_high,
s_dec.last_low,
(uint16_t)(s_dec.last_high + s_dec.last_low),
s_dec.t,
s_dec.short_min,
s_dec.short_max,
s_dec.long_min,
s_dec.long_max,
(unsigned int)s_dec.data);
#endif
rf433_debug_reset("bit", s_dec.last_high, s_dec.last_low);
rf433_decode_reset();
}
} }
void rf433_decoder_process(void) void rf433_decoder_process(void)
{ {
Rf433Pulse_t pulse; /* DWM11 decodes directly in the 100 us sampling callback. */
uint8_t cnt = 0;
while ((cnt < RF433_PROCESS_MAX_ONCE) && rf433_fifo_pop(&pulse))
{
rf433_process_clean_pulse(pulse);
cnt++;
}
} }
bool rf433_decoder_get_frame(Rf433DecoderFrame_t *frame) bool rf433_decoder_get_frame(Rf433DecoderFrame_t *frame)
{ {
if (frame == 0 || !s_dec.frame_ready) if (frame == 0 || s_dec.frame_ready == 0u)
{ {
return false; return false;
} }
*frame = s_dec.frame; *frame = s_dec.frame;
s_dec.frame_ready = false; s_dec.frame_ready = 0u;
return true; return true;
} }
uint16_t rf433_decoder_get_lost_count(void) uint16_t rf433_decoder_get_lost_count(void)
{ {
return s_fifo.lost; return 0u;
} }
@@ -15,6 +15,7 @@
#include "pwm.h" #include "pwm.h"
#include "light_transition.h" #include "light_transition.h"
#include "usr_server.h" #include "usr_server.h"
#include "external_key.h"
/*********************************************************************************************************************/ /*********************************************************************************************************************/
void rwip_schedule(void); void rwip_schedule(void);
@@ -26,8 +27,8 @@ TASK_COMPONENTS TaskComps[] =
{0,1,1,choice_mode}, {0,1,1,choice_mode},
{0,5,5,set_mode}, {0,5,5,set_mode},
{0,1,1,Set_timing}, {0,1,1,Set_timing},
{0,10,10,scan_433}, {0,100,100,scan_433},
{0,3,3,Encoder_key}, {0, 100,3, Encoder_key},
{0,1,1,My_ADC_Get_Value}, {0,1,1,My_ADC_Get_Value},
{0,50,50,ble_state_sync_poll}, {0,50,50,ble_state_sync_poll},
{0, 311, 1, app_op_flash}, //用户数据持久化 fmc_spi_read9 {0, 311, 1, app_op_flash}, //用户数据持久化 fmc_spi_read9
@@ -84,7 +84,6 @@ void uart_receive_cb(uint8_t *buff, uint16_t len)
void scan_uar_data(uint8_t *frame){ void scan_uar_data(uint8_t *frame){
} }
extern uint8_t sss;
uint8_t rx_date; uint8_t rx_date;
void scan_uart(uint8_t *arr) void scan_uart(uint8_t *arr)
{ {
@@ -106,8 +105,7 @@ void scan_uart(uint8_t *arr)
checksum += user_rx_buf[i]; checksum += user_rx_buf[i];
} }
user_rx_buf[5] = checksum; // УÑéλ user_rx_buf[5] = checksum; // УÑéλ
sss=1; set_TaskComps_timer(2U, 1000U);
// printf("sss=%d\r\n",sss);
switch (user_rx_buf[4]) switch (user_rx_buf[4])
{ {
@@ -135,11 +133,13 @@ void scan_uart(uint8_t *arr)
break; break;
case 3: case 3:
if(POWEROFF==deviceStatus)break; if(POWEROFF==deviceStatus)break;
if(Mode==mode0){
if(user_rx_buf[1] < BRIGHTNESS_MIN_PERCENT) if(user_rx_buf[1] < BRIGHTNESS_MIN_PERCENT)
user_rx_buf[1] = BRIGHTNESS_MIN_PERCENT; user_rx_buf[1] = BRIGHTNESS_MIN_PERCENT;
else if(user_rx_buf[1] > BRIGHTNESS_MAX_PERCENT) else if(user_rx_buf[1] > BRIGHTNESS_MAX_PERCENT)
user_rx_buf[1] = BRIGHTNESS_MAX_PERCENT; user_rx_buf[1] = BRIGHTNESS_MAX_PERCENT;
Brightness = user_rx_buf[1]; Brightness = user_rx_buf[1];
}
break; break;
case 4: case 4:
if(POWEROFF==deviceStatus)break; if(POWEROFF==deviceStatus)break;
@@ -174,6 +174,17 @@ void scan_uart(uint8_t *arr)
case 12: case 12:
power_restore_policy_set(user_rx_buf[1]); power_restore_policy_set(user_rx_buf[1]);
break; break;
case 13:
if(user_rx_buf[1] == 0x01U)
rf433_start_pairing();
else
rf433_cancel_pairing();
break;
case 14:
/* A5 guard prevents accidental clear. */
if(user_rx_buf[1] == 0xA5U)
rf433_clear_code();
break;
case 9: case 9:
break; break;
@@ -102,6 +102,10 @@ static uint8_t ble_last_brightness;
static uint8_t ble_last_speed; static uint8_t ble_last_speed;
static uint8_t ble_last_temperature; static uint8_t ble_last_temperature;
static uint8_t ble_last_power_mode; static uint8_t ble_last_power_mode;
static volatile uint8_t ble_remote_event_pending;
static volatile uint8_t ble_remote_event_command;
static volatile uint8_t ble_remote_event_status;
static volatile uint8_t ble_remote_event_paired_count;
static uint8_t ble_temperature_value(void) static uint8_t ble_temperature_value(void)
{ {
@@ -112,10 +116,22 @@ static uint8_t ble_temperature_value(void)
void ble_state_disconnect(void) void ble_state_disconnect(void)
{ {
custom_svc_tx_char_notify = DISABLE; custom_svc_tx_char_notify = DISABLE;
ble_remote_event_pending = 0U;
send_flag = 1U; send_flag = 1U;
ble_state_dirty = BLE_STATE_DIRTY_ALL; ble_state_dirty = BLE_STATE_DIRTY_ALL;
} }
void ble_remote_event_notify(uint8_t command, uint8_t status,
uint8_t paired_count)
{
if(!custom_svc_tx_char_notify) return;
ble_remote_event_command = command;
ble_remote_event_status = status;
ble_remote_event_paired_count = paired_count;
ble_remote_event_pending = 1U;
}
void ble_state_sync_poll(void) void ble_state_sync_poll(void)
{ {
uint8_t data[4] = {0U, 0U, 0U, 0U}; uint8_t data[4] = {0U, 0U, 0U, 0U};
@@ -138,7 +154,24 @@ void ble_state_sync_poll(void)
if(power_restore_policy != ble_last_power_mode) if(power_restore_policy != ble_last_power_mode)
ble_state_dirty |= BLE_STATE_DIRTY_POWER_MODE; ble_state_dirty |= BLE_STATE_DIRTY_POWER_MODE;
if(!send_flag || !ble_state_dirty) return; if(!send_flag) return;
/*
* Remote pairing/clear acknowledgements have priority over periodic
* state synchronization so the APP receives operation results promptly.
*/
if(ble_remote_event_pending)
{
data[0] = ble_remote_event_status;
data[1] = ble_remote_event_paired_count;
data[3] = ble_remote_event_command;
if(slave_send_data(data, sizeof(data),
CUSTOM_SVC_TX_CHAR_VAL) == GATT_NO_ERROR)
ble_remote_event_pending = 0U;
return;
}
if(!ble_state_dirty) return;
if(ble_state_dirty & BLE_STATE_DIRTY_POWER) if(ble_state_dirty & BLE_STATE_DIRTY_POWER)
{ {
@@ -49,4 +49,6 @@ uint8_t custom_svc_add(void);
uint8_t slave_send_data(uint8_t *data, uint8_t len, uint8_t att_idx); uint8_t slave_send_data(uint8_t *data, uint8_t len, uint8_t att_idx);
void ble_state_sync_poll(void); void ble_state_sync_poll(void);
void ble_state_disconnect(void); void ble_state_disconnect(void);
void ble_remote_event_notify(uint8_t command, uint8_t status,
uint8_t paired_count);
#endif // _USR_SERVER_H_ #endif // _USR_SERVER_H_
File diff suppressed because it is too large Load Diff
@@ -22,44 +22,249 @@ Dialog DLL: TARMCM1.DLL V1.14.6.0
<h2>Project:</h2> <h2>Project:</h2>
D:\workplace\工作文件\程序\新向远XC6517蓝牙芯片\PWM32EPRO\project\example\ble\ble_peripheral\mdk\ble_peripheral.uvprojx D:\workplace\工作文件\程序\新向远XC6517蓝牙芯片\PWM32EPRO\project\example\ble\ble_peripheral\mdk\ble_peripheral.uvprojx
Project File Date: 07/26/2026 Project File Date: 07/29/2026
<h2>Output:</h2> <h2>Output:</h2>
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\Keil_v5\ARM\ARMCC\Bin' *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\Keil_v5\ARM\ARMCC\Bin'
Build target 'ble-sdk-xip_scan' Build target 'ble-sdk-xip_scan'
Note: source file '..\app\src\uart.c' - object file renamed from '.\Objects\uart.o' to '.\Objects\uart_1.o'. Note: source file '..\app\src\uart.c' - object file renamed from '.\Objects\uart.o' to '.\Objects\uart_1.o'.
compiling light_transition.c... compiling Rf433.c...
..\app\src\pwm.h(134): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types ..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void _PWM_INIT(); void rf433_receive();
..\app\src\pwm.h(140): warning: #1295-D: Deprecated declaration adc_Init - give arg types ..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void adc_Init(); void rf433_gpio_init();
..\app\src\pwm.h(141): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types ..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void My_ADC_Get_Value(); void scan_433();
..\app\src\pwm.h(142): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types ..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void gpio_pullup_input_inter_test(); void Lock_Pwm7xd();
..\app\src\mode.h(39): warning: #1295-D: Deprecated declaration choice_mode - give arg types ..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode(); void choice_mode();
..\app\src\mode.h(40): warning: #1295-D: Deprecated declaration set_mode - give arg types ..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode(); void set_mode();
..\app\src\mode.h(41): warning: #1295-D: Deprecated declaration Start_PWM - give arg types ..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM(); void Start_PWM();
..\app\src\mode.h(42): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types ..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM(); void Stop_PWM();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration Set_timing - give arg types ..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing(); void Set_timing();
..\app\src\light_transition.c: 9 warnings, 0 errors ..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\Rf433.c(659): warning: #223-D: function "temperature" declared implicitly
temperature((uint8_t)(((uint16_t)(255U - res_data) * 255U + 119U) / 239U));
..\app\src\Rf433.c(24): warning: #177-D: variable "POWER_flag" was declared but never referenced
static uint8_t POWER_flag;
..\app\src\Rf433.c: 17 warnings, 0 errors
compiling app_sec.c...
..\app\src\app_sec.c(414): warning: #177-D: variable "param" was declared but never referenced
struct gapc_encrypt_req_ind const *param = (struct gapc_encrypt_req_ind const *)p_param;
..\app\src\app_sec.c: 1 warning, 0 errors
compiling app_task.c...
..\app\src\app_task.c(450): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SECOND_ADV_START, TASK_APP, 400); // start open noconnect adv
..\app\src\app_task.c(463): warning: #61-D: integer operation result is out of range
value &= ~(0xff << 24);
..\app\src\app_task.c(473): warning: #223-D: function "custom_svc_add" declared implicitly
if (!custom_svc_add()) {
..\app\src\app_task.c(496): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SCAN_START, TASK_APP, 10);
..\app\src\app_task.c(640): warning: #177-D: variable "p_param" was declared but never referenced
struct gapm_ext_adv_report_ind *p_param = (struct gapm_ext_adv_report_ind *)param;
..\app\src\app_task.c(688): warning: #223-D: function "xc_ble_gatt_cli_mtu_exch" declared implicitly
xc_ble_gatt_cli_mtu_exch(conidx, app_env.user_lid);
..\app\src\app_task.c(804): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SCAN_STOP, TASK_APP, 200); // start open noconnect adv
..\app\src\app_task.c(818): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SCAN_START, TASK_APP, 900); // start open noconnect adv
..\app\src\app_task.c(835): warning: #223-D: function "app_switch_mode" declared implicitly
app_switch_mode(app_mode);
..\app\src\app_task.c(836): warning: #940-D: missing return statement at end of non-void function "app_mode_switch_handler"
}
..\app\src\app_task.c(837): warning: #159-D: declaration is incompatible with previous "app_switch_mode" (declared at line 835)
void app_switch_mode(uint8_t mode)
..\app\src\app_task.c(845): warning: #223-D: function "ke_timer_set" declared implicitly
ke_timer_set(APP_SECOND_ADV_START, TASK_APP, 400); // start open noconnect adv
..\app\src\app_task.c(306): warning: #177-D: function "app_get_handler" was declared but never referenced
static uint8_t app_get_handler(const struct app_subtask_handlers *handler_list_desc, ke_msg_id_t msgid, void *p_param,
..\app\src\app_task.c: 13 warnings, 0 errors
compiling ota_protocol.c...
..\app\src\ota_protocol.c(35): warning: #120-D: return value type does not match the function type
return &fota_env;
..\app\src\ota_protocol.c(149): warning: #550-D: variable "sw_ver" was set but never used
uint16_t sw_ver;
..\app\src\ota_protocol.c(150): warning: #550-D: variable "rom_ver" was set but never used
uint16_t rom_ver;
..\app\src\ota_protocol.c(292): warning: #177-D: label "defult" was declared but never referenced
defult:
..\app\src\ota_protocol.c(320): warning: #223-D: function "ble_flash_later_page_erase" declared implicitly
ble_flash_later_page_erase(OTA_PARAM_ADDR);
..\app\src\ota_protocol.c: 5 warnings, 0 errors
compiling rgblight.c...
compiling ota_server.c...
compiling app_batt.c...
compiling arch_main.c...
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\arch_main.c(163): warning: #223-D: function "xc_fmc_spi_init_oprt" declared implicitly
xc_fmc_spi_init_oprt();
..\app\src\arch_main.c(164): warning: #223-D: function "xc_fmc_spi_flash_wake_up" declared implicitly
xc_fmc_spi_flash_wake_up();
..\app\src\arch_main.c(166): warning: #223-D: function "xc_fmc_spi_flash_rdid" declared implicitly
xc_fmc_spi_flash_rdid((uint8_t *)&mid);
..\app\src\arch_main.c(171): warning: #223-D: function "xc_fmc_spi_flash_ruid" declared implicitly
xc_fmc_spi_flash_ruid(ruid);
..\app\src\arch_main.c(188): warning: #223-D: function "xc_unique_identification_read" declared implicitly
if (false == xc_unique_identification_read(co_default_bdaddr.addr)) {
..\app\src\arch_main.c(161): warning: #177-D: variable "flash_size" was declared but never referenced
uint32_t flash_size;
..\app\src\arch_main.c(162): warning: #177-D: variable "flash_type" was declared but never referenced
uint16_t flash_type;
..\app\src\arch_main.c(215): warning: #144-D: a value of type "uint32_t *" cannot be used to initialize an entity of type "uint8_t *"
uint8_t *ptr = (uint32_t *)(0x10000800);
..\app\src\arch_main.c(375): warning: #188-D: enumerated type mixed with another type
wdt_cfg.ReloadValue = WDT_CLK_32K_RESET_MODE0_8192MS;
..\app\src\arch_main.c(395): warning: #223-D: function "xc_fmc_spi_init_oprt" declared implicitly
xc_fmc_spi_init_oprt( );
..\app\src\arch_main.c(396): warning: #223-D: function "xc_fmc_spi_flash_wake_up" declared implicitly
xc_fmc_spi_flash_wake_up();
..\app\src\arch_main.c(462): warning: #223-D: function "TaskProcess" declared implicitly
TaskProcess();
..\app\src\arch_main.c: 27 warnings, 0 errors
compiling Mode.c...
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\Mode.c: 15 warnings, 0 errors
compiling timeslice.c...
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
void rf433_receive();
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
void rf433_gpio_init();
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
void scan_433();
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
void Lock_Pwm7xd();
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
void Delay_50us();
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
void Encoder_key();
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\timeslice.c: 15 warnings, 0 errors
compiling usr_server.c...
..\app\src\Mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
void choice_mode();
..\app\src\Mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
void set_mode();
..\app\src\Mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
void Start_PWM();
..\app\src\Mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
void Stop_PWM();
..\app\src\Mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
void Set_timing();
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
void _PWM_INIT();
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
void adc_Init();
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
void My_ADC_Get_Value();
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
void gpio_pullup_input_inter_test();
..\app\src\usr_server.c(275): warning: #223-D: function "ble_callback" declared implicitly
ble_callback(co_buf_data(p_data)[0],co_buf_data(p_data)[1],co_buf_data(p_data)[2],co_buf_data(p_data)[3]);
..\app\src\usr_server.c: 10 warnings, 0 errors
linking... linking...
Program Size: Code=27716 RO-data=1380 RW-data=2740 ZI-data=3700 Program Size: Code=32064 RO-data=2208 RW-data=2804 ZI-data=3856
FromELF: creating hex file... FromELF: creating hex file...
After Build - User command #1: fromelf --bin --output=app.bin .\Objects\Xinc_ble_sdk.axf After Build - User command #1: fromelf --bin --output=app.bin .\Objects\Xinc_ble_sdk.axf
After Build - User command #2: .\output_tool\ge_ota_scan.bat After Build - User command #2: .\output_tool\ge_ota_scan.bat
Size of file: 29380 bytes. Size of file: 34532 bytes.
all_size=29380 all_size=34532
dual_xip dual_xip
Addr:13000 Addr:13000
Size:0x72c4 Size:0x86e4
BAddr:0x40000 BAddr:0x40000
Acheck:0x42b99760 Acheck:0x36596580
SoftVer:0x10 SoftVer:0x10
RomVer:0x20 RomVer:0x20
LoadAddr:0x11013000 LoadAddr:0x11013000
@@ -87,7 +292,7 @@ status2=1
updata file success ! updata file success !
已复制 1 个文件。 已复制 1 个文件。
已复制 1 个文件。 已复制 1 个文件。
".\Objects\Xinc_ble_sdk.axf" - 0 Error(s), 9 Warning(s). ".\Objects\Xinc_ble_sdk.axf" - 0 Error(s), 103 Warning(s).
<h2>Software Packages used:</h2> <h2>Software Packages used:</h2>
@@ -100,7 +305,7 @@ Package Vendor: ARM
D:/Program Files/Keil_v5/ARM/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM0/Include D:/Program Files/Keil_v5/ARM/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM0/Include
<h2>Collection of Component Files used:</h2> <h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:07 Build Time Elapsed: 00:00:09
</pre> </pre>
</body> </body>
</html> </html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -42,9 +42,11 @@
".\objects\rgblight.o" ".\objects\rgblight.o"
".\objects\mode.o" ".\objects\mode.o"
".\objects\rf433.o" ".\objects\rf433.o"
".\objects\rf433_decoder.o"
".\objects\pwm.o" ".\objects\pwm.o"
".\objects\bridge_pwm.o" ".\objects\bridge_pwm.o"
".\objects\light_transition.o" ".\objects\light_transition.o"
".\objects\external_key.o"
".\objects\fmc_spi.o" ".\objects\fmc_spi.o"
--strict --scatter ".\Linker\cpu_xip_scan.scat" --strict --scatter ".\Linker\cpu_xip_scan.scat"
--feedback fb.txt --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols --feedback fb.txt --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
Binary file not shown.
@@ -132,6 +132,8 @@
.\objects\arch_main.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h .\objects\arch_main.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
.\objects\arch_main.o: ..\app\src\mode.h .\objects\arch_main.o: ..\app\src\mode.h
.\objects\arch_main.o: ..\app\src\RF433.h .\objects\arch_main.o: ..\app\src\RF433.h
.\objects\arch_main.o: ..\app\src\rf433_decoder.h
.\objects\arch_main.o: ..\app\src\external_key.h
.\objects\arch_main.o: ..\app\src\rgblight.h .\objects\arch_main.o: ..\app\src\rgblight.h
.\objects\arch_main.o: ..\app\src\timer.h .\objects\arch_main.o: ..\app\src\timer.h
.\objects\arch_main.o: ..\app\src\fmc_spi.h .\objects\arch_main.o: ..\app\src\fmc_spi.h
File diff suppressed because one or more lines are too long
@@ -0,0 +1,63 @@
.\objects\external_key.o: ..\app\src\external_key.c
.\objects\external_key.o: ..\app\src\external_key.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_gpio.h
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc6xxx.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc60xx.h
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cm0.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cmInstr.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cmFunc.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_conf.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_cpr.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_offset.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_cprao.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_rf.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_adc.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_aotimer.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc6xxx.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_dma.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_fmc.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_fmc_cache.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_gpio.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_i2c.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_qdec.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_pwm.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_pwm_comn.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_rtc.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cm0.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_spi.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_timer.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_uart.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_wdt.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_pwm_timer.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_calib.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_clock.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_systick.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_pwr.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_gpio.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_aotimer.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_timer.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_rtc.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_uart.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\ringbuffer.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_dma.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_spi.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_spi_dma.h
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
.\objects\external_key.o: ..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi_dma.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_uart_dma.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_i2c.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_sw_i2c.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_wdt.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_adc.h
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_pwm.h
.\objects\external_key.o: ..\app\src\Mode.h
.\objects\external_key.o: ..\app\src\PWM.h
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
.\objects\external_key.o: ..\app\src\RF433.h
.\objects\external_key.o: ..\app\src\timer.h
.\objects\external_key.o: ..\app\src\timeslice.h
@@ -60,3 +60,4 @@
.\objects\fmc_spi.o: ..\app\src\PWM.h .\objects\fmc_spi.o: ..\app\src\PWM.h
.\objects\fmc_spi.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h .\objects\fmc_spi.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
.\objects\fmc_spi.o: ..\app\src\RF433.h .\objects\fmc_spi.o: ..\app\src\RF433.h
.\objects\fmc_spi.o: ..\app\src\timeslice.h
@@ -97,3 +97,5 @@
.\objects\ota_flash_interface.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_trc.h .\objects\ota_flash_interface.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_trc.h
.\objects\ota_flash_interface.o: ..\app\src\ota_protocol.h .\objects\ota_flash_interface.o: ..\app\src\ota_protocol.h
.\objects\ota_flash_interface.o: ..\app\src\fmc_spi.h .\objects\ota_flash_interface.o: ..\app\src\fmc_spi.h
.\objects\ota_flash_interface.o: ..\app\src\PWM.h
.\objects\ota_flash_interface.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
Binary file not shown.
@@ -58,5 +58,80 @@
.\objects\rf433.o: ..\app\src\uart.h .\objects\rf433.o: ..\app\src\uart.h
.\objects\rf433.o: ..\app\src\mode.h .\objects\rf433.o: ..\app\src\mode.h
.\objects\rf433.o: ..\app\src\timer.h .\objects\rf433.o: ..\app\src\timer.h
.\objects\rf433.o: ..\app\src\light_transition.h
.\objects\rf433.o: ..\app\src\pwm.h .\objects\rf433.o: ..\app\src\pwm.h
.\objects\rf433.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h .\objects\rf433.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
.\objects\rf433.o: ..\app\src\rf433_decoder.h
.\objects\rf433.o: ..\app\src\timeslice.h
.\objects\rf433.o: ..\app\src\usr_server.h
.\objects\rf433.o: ..\app\api\app_task.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_bt_defines.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip_config.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\ll\api\rwble_config.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip_config.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\inc\rwble_hl_config.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\rwble_hl_error.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\inc\rwprf_config.h
.\objects\rf433.o: ..\app\api\rwapp_config.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_swdiag.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_trc.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gap\gapm\gapm_int.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapm.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapm_msg.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip_task.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gap.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_bt.h
.\objects\rf433.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_lmp.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_bt.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_hci.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_error.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_list.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\ke\api\ke_task.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\ke\api\ke_msg.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\ll\gnuarm\ll.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\reg_intc.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_intc.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\driver\reg\reg_access.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_utils.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\em\api\em_map.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_math.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_et.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\ll\api\em_map_ble.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_llcp.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_cs.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_tx_desc.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_rx_desc.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_rx_cte_desc.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_wpal.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_ral.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_msg_int.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gatt.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gatt_msg.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\l2cap.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\l2cap_msg.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_buf.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\ke\api\ke_mem.h
.\objects\rf433.o: ..\app\src\ota_server.h
.\objects\rf433.o: ..\app\api\app_task.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gatt_server_api.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_db.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gap_api.h
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapc_msg.h
@@ -0,0 +1,5 @@
.\objects\rf433_decoder.o: ..\app\src\rf433_decoder.c
.\objects\rf433_decoder.o: ..\app\src\rf433_decoder.h
.\objects\rf433_decoder.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
.\objects\rf433_decoder.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\rf433_decoder.o: ..\app\src\rf433_decoder_port.h
@@ -60,6 +60,7 @@
.\objects\timeslice.o: ..\app\src\timer.h .\objects\timeslice.o: ..\app\src\timer.h
.\objects\timeslice.o: ..\app\src\mode.h .\objects\timeslice.o: ..\app\src\mode.h
.\objects\timeslice.o: ..\app\src\RF433.h .\objects\timeslice.o: ..\app\src\RF433.h
.\objects\timeslice.o: ..\app\src\rf433_decoder.h
.\objects\timeslice.o: ..\app\src\ota_flash_interface.h .\objects\timeslice.o: ..\app\src\ota_flash_interface.h
.\objects\timeslice.o: ..\app\src\ota_protocol.h .\objects\timeslice.o: ..\app\src\ota_protocol.h
.\objects\timeslice.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h .\objects\timeslice.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
@@ -137,3 +138,4 @@
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_db.h .\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_db.h
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gap_api.h .\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gap_api.h
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapc_msg.h .\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapc_msg.h
.\objects\timeslice.o: ..\app\src\external_key.h
@@ -63,3 +63,4 @@
.\objects\uart_1.o: ..\app\src\rgblight.h .\objects\uart_1.o: ..\app\src\rgblight.h
.\objects\uart_1.o: ..\app\src\mode.h .\objects\uart_1.o: ..\app\src\mode.h
.\objects\uart_1.o: ..\app\src\timeslice.h .\objects\uart_1.o: ..\app\src\timeslice.h
.\objects\uart_1.o: ..\app\src\fmc_spi.h
@@ -128,3 +128,4 @@
.\objects\usr_server.o: ..\app\src\Mode.h .\objects\usr_server.o: ..\app\src\Mode.h
.\objects\usr_server.o: ..\app\src\PWM.h .\objects\usr_server.o: ..\app\src\PWM.h
.\objects\usr_server.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h .\objects\usr_server.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
.\objects\usr_server.o: ..\app\src\fmc_spi.h

Some files were not shown because too many files have changed in this diff Show More