ULONG current_time; current_time= tx_time_get(); 15.2.4 绝对延迟函数实现方法 注:这里绝对延迟和周期性延迟是一个意思。 ThreadX内核只有相对延迟函数tx_thread_sleep,没有绝对延迟函数,这里简单实现一个tx_thread_sleepuntil。 条件: 1、有一个bsp_KeyScan函数,这个函数处理时间大概耗时2ms。 2、有两个任...
ULONG current_time; current_time = tx_time_get(); 1. 2. 3. 15.2.4 绝对延迟函数实现方法 注:这里绝对延迟和周期性延迟是一个意思。 ThreadX内核只有相对延迟函数tx_thread_sleep,没有绝对延迟函数,这里简单实现一个tx_thread_sleepuntil。 条件: 1、有一个bsp_KeyScan函数,这个函数处理时间大概耗时2ms。
基本上,没有人会将大段的C语言代码全部塞入 main() 函数,更好的做法是按照复用率高,耦合性低的...
if (_tx_thread_system_state == TX_INITIALIZE_IS_FINISHED) { return ((uint32_t)_tx_time_get()); } /* 如果ThreadX还没有运行,采用下面方式 */ for (i = (SystemCoreClock >> 14U); i > 0U; i--) { __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP()...
{return((uint32_t)_tx_time_get()); }/*如果ThreadX还没有运行,采用下面方式*/for(i = (SystemCoreClock >>14U); i >0U; i--) { __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP(); ...
tx_thread_sleep(). However, you got me thinking. Using tx_time_get() may be a viable solution. Per MS specs, tx_time_get() can be called from anywhere, including ISRs. Consequently, one can overwrite HAL_GetTick() and that is all what is needed because HAL_Delay(...
tx_time_get: Retrieves the current time tx_time_set: Sets the current time tx_timer_activate: Activate application timer tx_timer_change: Change application timer tx_timer_create: Create application timer tx_timer_deactivate: Deactivate application timer tx_timer_delete: Delete application timer t...
(任务切换函数)函数原形UINT _tx_thread_time_slice(VOID)返回值True,任务已经切换False,任务没有切换参数无说明进行任务切换,任务时间片到时进行同一个优先级任务切换2.1.4 定时器任务入口函数2、_tx_timer_thread_entry (定时器任务入口函数)函数原形VOID _tx_timer_thread_entry(ULONG timer_thread_input)返回...
1、_tx_thread_time_slice (任务切换函数) 函数原形 UINT _tx_thread_time_slice(VOID) 返回值 True,任务已经切换 False,任务没有切换 参数 无 说明 进行任务切换,任务时间片到时进行同一个优先级任务切换 2.1.4定时器任务入口函数 2、_tx_timer_thread_entry (定时器任务入口函数) ...
tx_low_power_enter - Enter low power mode tx_low_power_exit - Exit low power mode tx_time_increment - Increment ThreadX timers by specific amount tx_timer_get_next - Get next ThreadX timer expiration tx_low_power_enter Enter low power mode. Prototype VOID tx_low_power_enter(VOID); De...