已经完成了网络,DI口,RS485的数据透传,可通过RS485接收数据
This commit is contained in:
@ -83,17 +83,19 @@ static void tx_led_control(uint8_t state)
|
||||
|
||||
rf433_error_t rf433_tx_app_init(const rf433_register_t *config)
|
||||
{
|
||||
if (config == NULL) {
|
||||
return RF433_ERROR;
|
||||
}
|
||||
|
||||
// 初始化TX应用结构体
|
||||
memset(&g_tx_app, 0, sizeof(rf433_tx_app_t));
|
||||
g_tx_app.state = TX_STATE_INIT;
|
||||
g_tx_app.is_running = false;
|
||||
|
||||
// 保存配置
|
||||
memcpy(&g_tx_app.config, config, sizeof(rf433_register_t));
|
||||
if (config == NULL) {
|
||||
// 使用默认配置
|
||||
extern const rf433_register_t rf433_default_config;
|
||||
memcpy(&g_tx_app.config, &rf433_default_config, sizeof(rf433_register_t));
|
||||
} else {
|
||||
memcpy(&g_tx_app.config, config, sizeof(rf433_register_t));
|
||||
}
|
||||
|
||||
// 配置RF433模块
|
||||
rf433_error_t ret = rf433_set_config(&g_tx_app.config);
|
||||
|
||||
Reference in New Issue
Block a user