Ejemplo n.º 1
0
void ShowWatchdogInfo(void)
{
  if (niReset == FLASH_RESET_CODE) niWdtCounter = 0;

  unsigned int ResetSource = GetResetSource();
  PrintResetSource(ResetSource);
  PrintF("SppReadyToSleep %d", WatchdogInfo.SppReadyToSleep);
  PrintF("DisplayMsgWaiting %d", WatchdogInfo.DisplayMessagesWaiting);
  PrintF("SppMsgWaiting %d", WatchdogInfo.SppMessagesWaiting);

  if (ResetSource == SYSRSTIV_WDTTO || ResetSource == SYSRSTIV_WDTKEY)
  {
    PrintF("# WDT %s", ResetSource == SYSRSTIV_WDTTO ? "Failsafe" : "Forced");
    niWdtCounter ++;
  }
  
  PrintF("Total Watchdogs: %d", niWdtCounter);
}
Ejemplo n.º 2
0
void ShowWatchdogInfo(void)
{
  if (niReset == FLASH_RESET_CODE) niWdtCounter = 0;

  unsigned int ResetSource = GetResetSource();
  PrintResetSource(ResetSource);

  if (ResetSource == SYSRSTIV_WDTTO || ResetSource == SYSRSTIV_WDTKEY)
  {
    PrintString3("# WDT ", ResetSource == SYSRSTIV_WDTTO ? "Failsafe" : "Forced", CR);
    PrintStringAndDecimal("SppReadyToSleep ", WatchdogInfo.SppReadyToSleep);
    PrintStringAndDecimal("TaskDelayLockCount ", WatchdogInfo.TaskDelayLockCount);
    PrintStringAndDecimal("DisplayMsgWaiting ", WatchdogInfo.DisplayMessagesWaiting);
    PrintStringAndDecimal("SppMsgWaiting ", WatchdogInfo.SppMessagesWaiting);
    niWdtCounter ++;
  }
  
  PrintStringAndDecimal("Total Watchdogs: ", niWdtCounter);
}
Ejemplo n.º 3
0
void main(void)
{
    ENABLE_LCD_LED();

#if ENABLE_WATCHDOG
    RestartWatchdog();
#else
    WDTCTL = WDTPW + WDTHOLD;
#endif

    /* clear shipping mode, if set to allow configuration */
    PMMCTL0_H = PMMPW_H;
    PM5CTL0 &= ~LOCKLPM5;

    /* disable DMA during read-modify-write cycles */
    DMACTL4 = DMARMWDIS;

    DetermineErrata();

#ifdef BOOTLOADER

    /*
     * enable RAM alternate interrupt vectors
     * these are defined in AltVect.s43 and copied to RAM by cstartup
     */
    SYSCTL |= SYSRIVECT;

    ClearBootloaderSignature();

#endif

    /* calibration data is used for clock setup */
    InitializeCalibrationData();

#ifndef BOOTLOADER
    SaveResetSource();
#endif

    SetupClockAndPowerManagementModule();

    OsalNvInit(0);

    /* change the mux settings according to presense of the charging clip */
    InitializeMuxMode();
    ChangeMuxMode();

    InitDebugUart();
    TestModeControl();

    /* adc is required to get the board configuration */
    InitializeAdc();
    ConfigureDefaultIO(GetBoardConfiguration());

    InitializeDebugFlags();

//  InitButton();

    InitializeVibration();
    InitializeOneSecondTimers();

    InitializeBufferPool();
    InitializeWrapperTask();
    InitializeRealTimeClock();

    InitializeDisplayTask();

    DISABLE_LCD_LED();

#if CHECK_FOR_PMM15
    /* make sure error pmm15 does not exist */
    while ( PMM15Check() );
#endif

    /* Errata PMM17 - automatic prolongation mechanism
     * SVSLOW is disabled
     */
    *(unsigned int*)(0x0110) = 0x9602;
    *(unsigned int*)(0x0112) |= 0x0800;

    WhoAmI();
    PrintResetSource();

    /* if a watchdog occurred then print and save information about the source */
    WatchdogTimeoutHandler(GetResetSource());

    PrintString("Starting Task Scheduler\r\n");
    SetUartNormalMode();

    vTaskStartScheduler();

    /* if vTaskStartScheduler exits an error occured. */
    PrintString("Program Error\r\n");
    ForceWatchdogReset();
}