/******************************************************************************
* @file
* @brief Watchdog demonstration application for the TDxxxx RF modules.
* @author Telecom Design S.A.
* @version 1.1.0
******************************************************************************
* @section License
* (C) Copyright 2014-2015 Telecom Design S.A., http://www.telecomdesign.fr
******************************************************************************
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Telecom Design SA has no
* obligation to support this Software. Telecom Design SA is providing the
* Software "AS IS", with no express or implied warranties of any kind,
* including, but not limited to, any implied warranties of merchantability
* or fitness for any particular purpose or warranties against infringement
* of any proprietary rights of a third party.
*
* Telecom Design SA will not be liable for any consequential, incidental, or
* special damages, or any other relief, or for any claim by any third party,
* arising from your use of this Software.
*
******************************************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* This file declare all "dynamic" library data. It should be last included file
* Standard size value can be override before including this file
*/
#define TD_SENSOR_USE_CODE 0
#define TD_GEOLOC_USE_CODE 0
#include
static uint32_t i=0;
/*******************************************************************************
************************** PUBLIC FUNCTIONS *******************************
******************************************************************************/
/***************************************************************************//**
* @brief
* User setup function.
******************************************************************************/
static uint8_t watchTimer;
static void WatchTimer(uint32_t arg, uint8_t repetition) {
tfp_printf("Feeding watchdog\r\n");
TD_WATCHDOG_Feed();
}
void TD_USER_Setup(void)
{
TD_UART_Options_t options = {LEUART_DEVICE, LEUART_LOCATION, 9600, 8, 'N',
1, false};
// Open an I/O stream using LEUART0
TD_UART_Open(&options, TD_STREAM_RDWR);
// Boot message
tfp_printf("Boot\r\n");
// Initialize a 128 watchdog
if (TD_WATCHDOG_Init(64)) {
tfp_printf("Watchdog started\r\n");
tfp_printf("%d\r\n",i+=1);
} else {
tfp_printf("Watchdog failed\r\n");
}
// Start watchdog with automatic feed
TD_WATCHDOG_Enable(true, false);
watchTimer = TD_SCHEDULER_AppendIrq(50, 0, 0, TD_SCHEDULER_INFINITE, WatchTimer, 0);
/* // Crash Simulation
while(1) {
;
}*/
}
/***************************************************************************//**
* @brief
* User loop function.
******************************************************************************/
void TD_USER_Loop(void)
{
}