提交 96b0c8c3 编写于 作者: M mculover666

add deinit func in sal wrapper and ec20

上级 5656dca3
......@@ -551,3 +551,18 @@ int ec20_sal_init(hal_uart_port_t uart_port)
return 0;
}
int ec20_sal_deinit()
{
int id = 0;
for (id = 0; id < AT_DATA_CHANNEL_NUM; ++id) {
tos_sal_module_close(id);
}
tos_sal_module_register_default();
tos_at_deinit();
return 0;
}
......@@ -20,12 +20,8 @@
#include "tos_hal.h"
typedef enum sal_send_mode {
SAL_SEND_MODE_NORMAL,
SAL_SEND_MODE_TRANSPARENT,
} sal_send_mode_t;
int ec20_sal_init(hal_uart_port_t uart_port);
int ec20_sal_deinit(void);
#endif /* __EC20_H__ */
......@@ -12,6 +12,13 @@ int tos_sal_module_register(sal_module_t *module)
return -1;
}
int tos_sal_module_register_default()
{
g_sal_module = NULL;
return 0;
}
int tos_sal_module_init(void)
{
if (g_sal_module && g_sal_module->init) {
......
......@@ -63,6 +63,17 @@ typedef struct sal_module_st {
*/
int tos_sal_module_register(sal_module_t *module);
/**
* @brief Register a default sal module.
*
* @attention None
*
* @param[in] None
*
* @return errcode
*/
int tos_sal_module_register_default(void);
/**
* @brief Initialize the module.
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册