Ejemplo n.º 1
0
BOOL CMeterUploader::OnActiveThread()
{
	// Watchdog을 clear한다.
	WatchdogClear();

	if (m_bEnableAutoUpload || m_bUserRequest)
	{
		UploadMeteringData();
		m_bUserRequest = FALSE;
	}

	ReduceDataDirectory();
	return TRUE;
}
Ejemplo n.º 2
0
//*****************************************************************************
//
// Configure the SysTick and SysTick interrupt with a period of 1 second.
//
//*****************************************************************************
int
main(void)
{
    //
    // Set the clocking to run directly from the external crystal/oscillator.
    // (no ext 32k osc, no internal osc)
    //
    SysCtrlClockSet(false, false, SYS_CTRL_SYSDIV_32MHZ);

    //
    // Set IO clock to the same as system clock
    //
    SysCtrlIOClockSet(SYS_CTRL_SYSDIV_32MHZ);
    
    //
    // Set up the serial console to use for displaying messages.  This is
    // just for this example program and is not needed for Systick operation.
    //
    InitConsole();

    //
    // Display a reset message
    //
    UARTprintf("Watchdog Reset!\n");

    //
    // Enable watchdog
    //
    WatchdogEnable(WATCHDOG_INTERVAL_32768);
    
    while(1)
    {
        //
        // Delay
        //
        WdDelay(100);
      
        //
        // Clear WD such that we do not get a reset!
        //
        WatchdogClear();
    }
    
}