Quantcast
Channel: Renesas Synergy Platform
Viewing all articles
Browse latest Browse all 23645

Forum Post: GPT timer interfering with message buffer

$
0
0
Hi all, I'm having a problem using GPT timer in my thread. I use GPT timer as a delay. The code format as shown below. I don't have any problem with I2C peripheral. It read and writes to the I2C device correctly. However when trying to acquires buffer to post message, the return status with error (SSP_ERR_NO_MORE_BUFFER). I don't have this kind of issue when using tx_thread_sleep(ms); as a delay. I don't want to use tx_thread_sleep(); because I have many other threads may use it as well and it could potentially happen when 2 threads are trying to call this delay at the same time. Does tx_thread_sleep(); put the whole system on a delay or it just put the thread that call it on hold? Thanks? uint16_t ms_counts = 0; void g_gpt4_delay_timer_callback (timer_callback_args_t *p_args) { SSP_PARAMETER_NOT_USED(p_args); ms_counts++; } void adc_thread_entry(void) { g_delay_timer4.p_api->open(g_delay_timer4.p_ctrl, g_delay_timer4.p_cfg); ms_counts = 0; while (ms_counts bufferAcquire(g_sf_message.p_ctrl, (sf_message_header_t **) &p_message, &cfg_acquire, TX_NO_WAIT); APP_ERROR_TRAP(status); p_message->header.event_b.class = SF_MESSAGE_EVENT_CLASS_APP_CALLBACK; p_message->header.event_b.class_instance = 0; p_message->header.event_b.code = SF_MESSAGE_EVENT_ADC_UPDATE; ......... } }

Viewing all articles
Browse latest Browse all 23645

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>