pdFALSE, // The timers will not auto-reload themselves when they expire. (void *) ApplicationFTPSendTimeout, // Assign each timer a unique id. (tmrTIMER_CALLBACK) vApplicationTimerCallback // Timer callback when it expires. ); if(xApplicationFTPSendTimeout == NULL) { // The timer was not created. LOG(“Timer Not Initialized…nr”); } } tmrTIMER_CALLBACK vApplicationTimerCallback(xTimerHandle pxTimer) { long lArrayIndex;
// Optionally do something if the pxTimer parameter is NULL.
configASSERT(pxTimer);
// Which timer expired? */
lArrayIndex = (long) pvTimerGetTimerID(pxTimer);
// If the timer has expired stop it from running.
// Do not use a block time if calling a timer API function from a
// timer callback function, as doing so could cause a deadlock!
xTimerStop(pxTimer, 0);
if(lArrayIndex == ApplicationFTPSendTimeout) stApplication.bits.APPLICATION_FTP_SEND_TIMEOUT = TRUE;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If I wanted to implement another timer to check the FTP server say every 10 minutes, I gather that I would need to create another Timer using the xTimerCreate and create another callback function for this new timer? Or can I create this new timer and use the same callback as the previous timer?
Thanks for your time.