/*~~~~~~~ Main Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ int main(void) { initModesAndClock(); /* Disable Watchdog */ disableWatchdog(); /*Initialize LEDs on TRK-MPC560xB board */ vfnGPIO_LED_Init(); /*Initialize PUSHs on TRK-MPC560xB board */ vfnGPIO_PUSH_Init(); /*Initialize Interrupts */ INTC_InitINTCInterrupts(); /*Initialize Exception Handlers */ EXCEP_InitExceptionHandlers(); PIT_device_init(); PIT_channel_configure(PIT_CHANNEL_0 , dummy_500us); PIT_channel_start(PIT_CHANNEL_0); /* Enable External Interrupts*/ enableIrq(); /* Infinite loop */ dummy_endless_loop(); for (;;) { BackgroundSubsystemTasks(); } }
/************************************************************** * Name : SchM_Start * Description : Starts the scheduler * Parameters : None * Return : * Critical/explanation : [yes / No] **************************************************************/ void SchM_Start(void) { SchController.SchStatus = SCH_RUNNING; PIT_channel_start(PIT_CHANNEL_0); enableIrq(); /* Enable External Interrupts*/ SchM_Background(); /* Scheduler controls hardware */ }
int test_timer_pit_init(void) { INTC_InitINTCInterrupts(); // Config_PLL(); init_PIT_RTI(); enableIrq(); }
int test_timer_RIT_init(void) { Config_PLL(); INTC_InitINTCInterrupts(); initPIT_RTI(); gpio_init(LED_PORT, GPIO_OUTPUT); enableIrq(); }
/*const SchMConfigType *schmconfigglobal;*/ void SchM_Start(void) { /*arrancar el timer pit*/ PIT_channel_start(PIT_CHANNEL_0); enableIrq(); SchControl.SchStatus=SCH_RUNNING; SchM_Background(); }
void MODSERIAL::init( int txSize, int rxSize, PinName rx ) { disableIrq(); callbackInfo.setSerial(this); #ifdef __LPC11UXX_H__ _base = LPC_USART; #else switch( _serial.index ) { case 0: _base = LPC_UART0; break; case 1: _base = LPC_UART1; break; case 2: _base = LPC_UART2; break; case 3: _base = LPC_UART3; break; default: _base = NULL; break; } #endif dmaSendChannel = -1; moddma_p = (void *)NULL; if ( _base != NULL ) { buffer_size[RxIrq] = rxSize; buffer[RxIrq] = rxSize > 0 ? (char *)malloc(buffer_size[RxIrq]) : (char *)NULL; buffer_in[RxIrq] = 0; buffer_out[RxIrq] = 0; buffer_count[RxIrq] = 0; buffer_overflow[RxIrq] = 0; Serial::attach( this, &MODSERIAL::isr_rx, Serial::RxIrq ); buffer_size[TxIrq] = txSize; buffer[TxIrq] = txSize > 0 ? (char *)malloc(buffer_size[TxIrq]) : (char *)NULL; buffer_in[TxIrq] = 0; buffer_out[TxIrq] = 0; buffer_count[TxIrq] = 0; buffer_overflow[TxIrq] = 0; Serial::attach( this, &MODSERIAL::isr_tx, Serial::TxIrq ); } else { error("MODSERIAL must have a defined UART to function."); } _FCR = MODSERIAL_FIFO_ENABLE | MODSERIAL_FIFO_RX_RESET | MODSERIAL_FIFO_TX_RESET; auto_detect_char = 0; enableIrq(); }
/*~~~~~~~ Main Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ int main(void) { initModesAndClock(); /* Disable Watchdog */ disableWatchdog(); /*Initialize LEDs on TRK-MPC560xB board */ MemAllocInit(&MemAllocConfig); vfnGPIO_LED_Init(); /*Initialize Interrupts */ INTC_InitINTCInterrupts(); /*Initialize Exception Handlers */ EXCEP_InitExceptionHandlers(); // PIT_device_init(); // PIT_channel_configure(PIT_CHANNEL_0 , Test); // PIT_channel_start(PIT_CHANNEL_0); /* Enable External Interrupts*/ enableIrq(); /* Infinite loop */ SchM_Init(&SchedulerConfig); SchM_Start(); for (;;) { BackgroundSubsystemTasks(); } }
/*~+:Main Code*/ int main(void) { /*Enable peri set 1 sysclk divided by 1 */ /* Mode initializations */ sysinit_InitMode(); /* Clock initializations */ sysinit_InitSysClock(); /* Memory Allcoation Initialization */ MemAllocInit(&MemAllocConfig); /*Initialize LEDs on TRK-MPC560xB board */ vfnGPIO_LED_Init(); /* SBC dependencies */ InitDSPI_1(); ConfigureMZC33905DSPI_1(); /* CAN Initialization */ CAN_Initialization(&can_driver_config); /* Initialize Interrupts */ INTC_InitINTCInterrupts(); /*Initialize Exception Handlers */ EXCEP_InitExceptionHandlers(); /* SchM Initialization */ SchM_Init(&SchMConfig); /* Enable External Interrupts*/ enableIrq(); /*Selection of type of Car*/ Light_Ctrl_HwConfig(); init_ADC0_P0(); /* SchM Start */ SchM_Start(); /* Infinite loop - Should never reach this point */ for (;;) { } }
/*~~~~~~~ Main Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ int main(void) { initModesAndClock(); /* Disable Watchdog */ disableWatchdog(); MemAllocInit(&MemAllocConfig); Init_LIN_SLV1(); /*Initialize Interrupts */ INTC_InitINTCInterrupts(); /*Initialize Exception Handlers */ EXCEP_InitExceptionHandlers(); /* Enable External Interrupts*/ enableIrq(); /* Infinite loop */ /*init del scheduler*/ SchM_Init(&SchConfig); SchM_Start(); for (;;) { BackgroundSubsystemTasks(); } }
void GPIOPin::disableIrq() { enableIrq(false); }
void GPIOPin::enableIrq() { enableIrq(true); }