第一时间想到的就是用 Systick Timer 实现,因为之前用stm32 单片机,就是用它实现的。nrf52832 采用的也是arm 内核,应该也是有Systick Timer 。 从nordic sdk 的nrfx_systick.c中可知,默认情况下,Systick timer并没有启动。即使启动Systick timer, sdk 中也是利用Systick Timer 进行阻塞的延时处理,并没有开启...
which is used to update the event time// on the main data page.APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE,NULL);#if(MODIFICATION_TYPE == MODIFICATION_TYPE_BUTTON)/** @snippet [ANT Pulse simulator button init] */err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS,...
This seems backwards. What units are the period and duty cycle in, and how is duty cycle defined relative to period? Is {period = 100, duty cycle = 50} functionally the same as {period = 200, duty cycle = 100}?How do these numbers relate to the timer -- are they ticks?
APP_ERROR_CHECK(err_code);#endif// TRACE_UART#ifdefined(TRACE_GPIO)// Initialize timer module.APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE,false); err_code = bsp_init(BSP_INIT_LED, APP_TIMER_TICKS(100, APP_TIMER_PRESCALER),NULL); APP_ERROR_CHECK...
没有初始化app_scheduler,而直接使用app_timer的schedule模式。app_scheduler原理及使用说明见:https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Flib_scheduler.html&cp=5_1_3_38,概括来说,app_scheduler的作用就是把长长的中断代码从中断函数转到main线程中来执行。
APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), NULL); APP_ERROR_CHECK(err_code); // Set up logger err_code = NRF_LOG_INIT(NULL); APP_ERROR_CHECK(err_code); NRF_LOG_INFO("Gazell dynamic pairing example. Host mode.\r\n"); NRF_LOG_F...
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000, APP_TIMER_PRESCALER) /**< Time between each call to sd_ble_gap_conn_param_update after the first call (5 seconds). */ #define MAX_CONN_PARAMS_UPDATE_COUNT 3 /**< Number of attempts before giving up the connection parameter ...
app_timer_start(user_app_timer, APP_TIMER_TICKS(1000, 0), NULL); (void)(user_app_timer); } int main(void) { uint32_t err_code; bool erase_bonds = false; // Initialize.app_trace_init(); APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE); ...
#define DATA_THROUGHPUT_INTERVAL APP_TIMER_TICKS(5) /**< data throughput interval (ticks). */ APP_TIMER_DEF(m_timer_throughput_id); #define QUEUE_ELEMENT_NUMBERS 32 #define PKGS_PER_TIMER_PERIOD 8 uint32_t m_data_sent_length = 0; uint8_t m_data_array[QUEUE_ELEMENT_NUMBERS][BLE_NU...
Verified that none of my app's tasks is running (All are blocked), neither is the timer task. The only task that seem to run is the idle task. Verified that the idle task handler portTASK_FUNCTION() (part of freertos port) do get to the line portSUPPRESS_TICKS_AND_SLEEP() that ...