void main(void) { /* Turn off the watchdog timer */ WDTCTL = WDTPW + WDTHOLD; /* clear reason for reset */ SYSRSTIV = 0; /* disable DMA during read-modify-write cycles */ DMACTL4 = DMARMWDIS; unsigned char MspVersion = GetMsp430HardwareRevision(); InitializeCalibrationData(); ConfigureHardware(); OsalNvInit(0); InitializeDebugFlags(); InitializeButtons(); InitializeVibration(); InitializeOneSecondTimers(); InitializeBufferPool(); InitializeSppTask(); InitializeRealTimeClock(); InitializeBackgroundTask(); InitializeDisplayTask(); InitializeAdc(); #if 0 /* timeout is 16 seconds */ hal_SetWatchdogTimeout(16); #endif #ifdef 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; PrintString("Starting Task Scheduler\r\n"); vTaskStartScheduler(); /* if vTaskStartScheduler exits an error occured. */ PrintString("Program Error\r\n"); ForceWatchdogReset(); }
void main(void) { /* Turn off the watchdog timer */ WDTCTL = WDTPW + WDTHOLD; /* clear reason for reset */ SYSRSTIV = 0; /* disable DMA during read-modify-write cycles */ DMACTL4 = DMARMWDIS; InitializeCalibrationData(); ConfigureHardware(); osal_nv_init(0); InitializeDebugFlags(); InitializeBufferPool(); InitializeSppTask(); InitializeCommandTask(); InitializeRealTimeClock(); InitializeBackgroundTask(); InitializeDisplayTask(); InitializeAdc(); #ifdef DIGITAL InitializeSerialRamTask(); InitializeLcdTask(); #else unsigned char QueueOfZeroLength = 0; QueueHandles[SRAM_QINDEX] = xQueueCreate( QueueOfZeroLength, MESSAGE_QUEUE_ITEM_SIZE ); QueueHandles[LCD_TASK_QINDEX] = xQueueCreate( QueueOfZeroLength, MESSAGE_QUEUE_ITEM_SIZE ); #endif #if 0 InitializePedometerTask(); #endif #if 0 /* timeout is 16 seconds */ hal_SetWatchdogTimeout(16); #endif extern xSemaphoreHandle CrcMutex; CrcMutex = xSemaphoreCreateMutex(); xSemaphoreGive(CrcMutex); #if 0 SetSniffSlotParameter(MaxInterval, 8); SetSniffSlotParameter(MinInterval, 6); SetSniffModeEntryDelay(200); #endif /* Start the Task Scheduler. */ vTaskStartScheduler(); /* if vTaskStartScheduler exits an error occured. */ PrintString("Program Error\r\n"); }