/** * This function will initial LM3S board. */ void rt_hw_board_init() { // // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // FPULazyStackingEnable(); // set sysclock to 80M SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); /* init systick */ SysTickDisable(); SysTickPeriodSet(SysCtlClockGet()/RT_TICK_PER_SECOND); SysTickIntEnable(); SysTickEnable(); /* enable ssio */ //SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0); #if LM3S_EXT_SRAM == 1 /* init SDRAM */ rt_hw_sdram_init(); #endif /* init console */ rt_hw_console_init(); /* enable interrupt */ IntMasterEnable(); }
/* ********************************************************************************************************* * void SysTickInit(void) * Description: This function is to init the systick. * * Argument(s) : none * Return(s) : none * * Note(s) : none. ********************************************************************************************************* */ _BSP_EVK_V10_BSP_INIT_ void SysTickInit(void) { SysTickDisable(); SysTickClkSourceSet(NVIC_SYSTICKCTRL_CLKIN); SysTickPeriodSet(10); SysTickEnable(); }
void SystickIntHandler(){ //Samples the voltage on pin 3 if (GPIOPinRead(GPIOA1_BASE, 0x10)){ //modify the bitsequence using logic AND //Use bitwise operation here to save memory. Another option is to use an aray bitsequence = bitsequence | (1LL << (64-index)); } //Increments the next index of the bit in bitsequence to be modified index++; //Clear the GPIO interrupt GPIOIntClear(GPIOA1_BASE, 0x10); //Enables the GPIO interrupt GPIOIntEnable(GPIOA1_BASE, 0x10); if(index == 60) { //If 60 bits have been written, it's time to check what number on the remote the bit sequence reprensent. SysTickDisable(); GPIOIntDisable(GPIOA1_BASE, 0x10); } }
/************************************************************************************//** ** \brief Stops and disables the timer. ** \return none. ** ****************************************************************************************/ void TimeDeinit(void) { SysTickIntDisable(); SysTickDisable(); } /*** end of TimeDeinit ***/
void SysTick::stop(void) { SysTickDisable(); }
/** * stop timer */ void Timer::stop() { SysTickDisable(); }