support stm8

1. see: TencentOS-tiny\board\STM8L052R8T6\IAR\hello_world
2. compile/debug/run with IAR for STM8
This commit is contained in:
daishengdong
2020-02-15 16:39:00 +08:00
parent 59e403891a
commit 405e5d970a
169 changed files with 49472 additions and 550 deletions

View File

@@ -78,23 +78,23 @@ __API__ k_err_t tos_pm_cpu_lpwr_mode_set(k_cpu_lpwr_mode_t cpu_lpwr_mode);
__API__ k_err_t tos_pm_device_register(k_pm_device_t *device);
__KERNEL__ void pm_init(void);
__KNL__ void pm_init(void);
__KERNEL__ void pm_cpu_lpwr_mode_enter(k_cpu_lpwr_mode_t lpwr_mode);
__KNL__ void pm_cpu_lpwr_mode_enter(k_cpu_lpwr_mode_t lpwr_mode);
__KERNEL__ k_cpu_lpwr_mode_t pm_cpu_lpwr_mode_get(void);
__KNL__ k_cpu_lpwr_mode_t pm_cpu_lpwr_mode_get(void);
__KERNEL__ void pm_idle_pwr_mgr_mode_set(idle_pwrmgr_mode_t idle_pwrmgr_mode);
__KNL__ void pm_idle_pwr_mgr_mode_set(idle_pwrmgr_mode_t idle_pwrmgr_mode);
__KERNEL__ int pm_idle_pwr_mgr_mode_is_sleep(void);
__KNL__ int pm_idle_pwr_mgr_mode_is_sleep(void);
__KERNEL__ int pm_idle_pwr_mgr_mode_is_tickless(void);
__KNL__ int pm_idle_pwr_mgr_mode_is_tickless(void);
__KERNEL__ void pm_power_manager(void);
__KNL__ void pm_power_manager(void);
__KERNEL__ int pm_device_suspend(void);
__KNL__ int pm_device_suspend(void);
__KERNEL__ int pm_device_resume(void);
__KNL__ int pm_device_resume(void);
#endif /* TOS_CFG_PWR_MGR_EN */

View File

@@ -33,11 +33,11 @@ __API__ k_err_t tos_tickless_wkup_alarm_init(k_cpu_lpwr_mode_t mode);
__HOOK__ int tos_bsp_tickless_setup(void);
__KERNEL__ int tickless_wkup_alarm_is_installed(k_cpu_lpwr_mode_t mode);
__KNL__ int tickless_wkup_alarm_is_installed(k_cpu_lpwr_mode_t mode);
__KERNEL__ void tickless_init(void);
__KNL__ void tickless_init(void);
__KERNEL__ void tickless_proc(void);
__KNL__ void tickless_proc(void);
#endif /* TOS_CFG_TICKLESS_EN */

View File

@@ -64,7 +64,7 @@ __API__ k_err_t tos_pm_device_register(k_pm_device_t *device)
return K_ERR_NONE;
}
__KERNEL__ void pm_init(void)
__KNL__ void pm_init(void)
{
memset(&k_pm_device_ctl, 0, sizeof(k_pm_device_ctl));
k_pm_device_ctl.count = 0u;
@@ -85,7 +85,7 @@ __STATIC_INLINE__ void pm_cpu_standby_mode_enter(void)
cpu_standby_mode_enter();
}
__KERNEL__ void pm_cpu_lpwr_mode_enter(k_cpu_lpwr_mode_t lpwr_mode)
__KNL__ void pm_cpu_lpwr_mode_enter(k_cpu_lpwr_mode_t lpwr_mode)
{
if (TOS_LOW_POWER_MODE_SLEEP == lpwr_mode) {
pm_cpu_sleep_mode_enter();
@@ -100,27 +100,27 @@ __KERNEL__ void pm_cpu_lpwr_mode_enter(k_cpu_lpwr_mode_t lpwr_mode)
}
}
__KERNEL__ k_cpu_lpwr_mode_t pm_cpu_lpwr_mode_get(void)
__KNL__ k_cpu_lpwr_mode_t pm_cpu_lpwr_mode_get(void)
{
return k_cpu_lpwr_mode;
}
__KERNEL__ void pm_idle_pwr_mgr_mode_set(idle_pwrmgr_mode_t idle_pwrmgr_mode)
__KNL__ void pm_idle_pwr_mgr_mode_set(idle_pwrmgr_mode_t idle_pwrmgr_mode)
{
k_idle_pwr_mgr_mode = idle_pwrmgr_mode;
}
__KERNEL__ int pm_idle_pwr_mgr_mode_is_sleep(void)
__KNL__ int pm_idle_pwr_mgr_mode_is_sleep(void)
{
return k_idle_pwr_mgr_mode == IDLE_POWER_MANAGER_MODE_SLEEP;
}
__KERNEL__ int pm_idle_pwr_mgr_mode_is_tickless(void)
__KNL__ int pm_idle_pwr_mgr_mode_is_tickless(void)
{
return k_idle_pwr_mgr_mode == IDLE_POWER_MANAGER_MODE_TICKLESS;
}
__KERNEL__ void pm_power_manager(void)
__KNL__ void pm_power_manager(void)
{
if (pm_idle_pwr_mgr_mode_is_sleep()) {
pm_cpu_sleep_mode_enter();
@@ -133,7 +133,7 @@ __KERNEL__ void pm_power_manager(void)
#endif
}
__KERNEL__ int pm_device_suspend(void)
__KNL__ int pm_device_suspend(void)
{
uint8_t i = 0;
@@ -145,7 +145,7 @@ __KERNEL__ int pm_device_suspend(void)
return 0;
}
__KERNEL__ int pm_device_resume(void)
__KNL__ int pm_device_resume(void)
{
uint8_t i = 0;

View File

@@ -40,7 +40,7 @@ __API__ k_err_t tos_tickless_wkup_alarm_init(k_cpu_lpwr_mode_t mode)
return K_ERR_NONE;
}
__KERNEL__ int tickless_wkup_alarm_is_installed(k_cpu_lpwr_mode_t mode)
__KNL__ int tickless_wkup_alarm_is_installed(k_cpu_lpwr_mode_t mode)
{
return k_tickless_wkup_alarm[mode] != K_NULL;
}
@@ -134,7 +134,7 @@ __STATIC__ void tickless_leave(k_time_t time_sleep_ms)
tickless_systick_fix(tick_sleep);
}
__KERNEL__ void tickless_proc(void)
__KNL__ void tickless_proc(void)
{
k_time_t time_sleep;
k_cpu_lpwr_mode_t lpwr_mode;
@@ -150,7 +150,7 @@ __KERNEL__ void tickless_proc(void)
tickless_leave(time_sleep);
}
__KERNEL__ void tickless_init(void)
__KNL__ void tickless_init(void)
{
pm_idle_pwr_mgr_mode_set(IDLE_POWER_MANAGER_MODE_TICKLESS);