void main(void) { SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_1); GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3); GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0); /* led */ GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); GPIOIntTypeSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_RISING_EDGE); GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_RISING_EDGE); GPIOPinIntEnable(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3); GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_1); IntMasterEnable(); IntEnable(INT_GPIOE); IntEnable(INT_GPIOF); GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3); GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_1); while(1) { } }
void Keypad(void*data) { while (1) { // RIT128x96x4StringDraw(" KKEYPAD ", 20, 80, 15); keypad *myKey = (keypad*) data; if (UpFlag){ *myKey->driveMotorSpeedInc=TRUE; UpFlag=FALSE; } if(globalCounter%500==0) { GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_2); IntEnable(INT_GPIOE); } if(DownFlag){ *myKey->driveMotorSpeedDec=TRUE;DownFlag=FALSE; } if(globalCounter%500==0) { GPIOPinIntClear(GPIO_PORTD_BASE, GPIO_PIN_5); IntEnable(INT_GPIOD); } vTaskDelay(500); } }
//ISR INIT void ctl_buttons_isr_init(CTL_ISR_FN_t fn) { int en; int32u proba; en=ctl_global_interrupts_set(0); buttons_isr=fn; SysCtlPeripheralEnable(PUSHBUTTON_PERIPH); //UNLOCKOLNI KELL A PF0 REGISZTERT MERT NMI-RE VAN ALLITVA HWREG(PUSHBUTTON_PORT + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD; HWREG(PUSHBUTTON_PORT + GPIO_O_CR) |= 0x01; HWREG(PUSHBUTTON_PORT + GPIO_O_LOCK) = 0; GPIODirModeSet(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH , GPIO_DIR_MODE_IN); GPIOPadConfigSet(PUSHBUTTON_PORT,LEFT_SWITCH | RIGHT_SWITCH , GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); GPIOPinIntDisable(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH); if((GPIOPinIntStatus(PUSHBUTTON_PORT, 1)) == LEFT_SWITCH ) { GPIOPinIntClear(PUSHBUTTON_PORT, LEFT_SWITCH ); } if((GPIOPinIntStatus(PUSHBUTTON_PORT, 1)) == RIGHT_SWITCH ) { GPIOPinIntClear(PUSHBUTTON_PORT, RIGHT_SWITCH ); } ctl_set_priority(PUSHBUTTON_IRQ_PRIORITY, 1); ctl_unmask_isr(PUSHBUTTON_IRQ_PRIORITY); ctl_global_interrupts_set(en); GPIOIntTypeSet(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH , GPIO_BOTH_EDGES); //GPIO_BOTH_EDGES GPIOPinIntEnable(PUSHBUTTON_PORT, LEFT_SWITCH | RIGHT_SWITCH ); }
void IntWheelSensor() { CPU_INT32U ulStatusR_A; CPU_INT32U ulStatusL_A; static CPU_INT08U CountL = 0; static CPU_INT08U CountR = 0; static CPU_INT08U data = 0; ulStatusR_A = GPIOPinIntStatus(RIGHT_IR_SENSOR_A_PORT, DEF_TRUE); ulStatusL_A = GPIOPinIntStatus(LEFT_IR_SENSOR_A_PORT, DEF_TRUE); if (ulStatusR_A & RIGHT_IR_SENSOR_A_PIN) { GPIOPinIntClear(RIGHT_IR_SENSOR_A_PORT, RIGHT_IR_SENSOR_A_PIN); /* Clear interrupt.*/ CountR = CountR + 1; } if (ulStatusL_A & LEFT_IR_SENSOR_A_PIN) { GPIOPinIntClear(LEFT_IR_SENSOR_A_PORT, LEFT_IR_SENSOR_A_PIN); CountL = CountL + 1; } if((CountL >= Left_tgt) && (CountR >= Right_tgt)) { data = 0x11; Left_tgt = 0; Right_tgt = 0; CountL = 0; CountR = 0; BSP_MotorStop(LEFT_SIDE); BSP_MotorStop(RIGHT_SIDE); } else if(CountL >= Left_tgt) { data = 0x10; Left_tgt = 0; CountL = 0; BSP_MotorStop(LEFT_SIDE); } else if(CountR >= Right_tgt) { data = 0x01; Right_tgt = 0; CountR = 0; BSP_MotorStop(RIGHT_SIDE); } return; }
// Interrupt handler void PinChangeIntHandler (void) { unsigned long ul_A_Val; unsigned long ul_B_Val; int current_state; // Clear the interrupt (documentation recommends doing this early) GPIOPinIntClear (GPIO_PORTF_BASE, GPIO_PIN_7); GPIOPinIntClear (GPIO_PORTF_BASE, GPIO_PIN_5); ul_A_Val = GPIOPinRead (GPIO_PORTF_BASE, GPIO_PIN_7); // Read the pin ul_B_Val = GPIOPinRead (GPIO_PORTF_BASE, GPIO_PIN_5); if (!ul_A_Val){ //Check what state the pins at and assign that state to "current state" if(!ul_B_Val){ current_state = 1; } else{ current_state = 2; } } else{ if(ul_B_Val){ current_state = 3; } else{ current_state = 4; } } // Check if the previous state is different from the current state. // Determine what direction the encoder is spinning if (current_state != prev_state){ if (abs(prev_state-current_state) == 1){ if(current_state>prev_state){ encoder_1 --; } else{ encoder_1 ++; } } else{ if(current_state<prev_state){ encoder_1 --; } else{ encoder_1 ++; } } } prev_state = current_state; // Assign current state for next time the interrupt runs }
/* The handler for the GPIOPortB Pin4, Pin5 & Pin6 state change interrupt. */ void portBIntHandler(void) { //clear the interrupt GPIOPinIntClear (GPIO_PORTB_BASE, (GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6)); int button; //Read the state of the pins //Select icon clicked to start/stop heli if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_4 )) { xSemaphoreGiveFromISR( xBinarySelectSemaphore, pdFALSE ); } //Up icon clicked if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_5 )) { button = UP; xQueueSendFromISR( xButtonQueue, &button, NULL ); } //Down icon clicked if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_6 )) { button = DOWN; xQueueSendFromISR( xButtonQueue, &button, NULL ); } //Reset icon clicked if (!GPIOPinRead( GPIO_PORTB_BASE, GPIO_PIN_1 )) { SysCtlReset(); } }
/** * Configures the used button as input source * Registers gpio_c interrupt.. */ void button_init(){ GPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_USER_BUTTON); GPIOIntTypeSet(BSP_BUTTON_BASE,BSP_USER_BUTTON,GPIO_FALLING_EDGE); GPIOPortIntRegister(BSP_BUTTON_BASE,GPIO_C_Isr_Handler); GPIOPinIntClear(BSP_BUTTON_BASE, BSP_USER_BUTTON); GPIOPinIntEnable(BSP_BUTTON_BASE, BSP_USER_BUTTON); }
// *************** GPIO_SetInterruptTask *************** void GPIO_SetInterruptTask( GPIO_PORT_T port, GPIO_PIN_T pins, unsigned long int_type, unsigned long priority, void (*task)( void ) ) { unsigned long port_base = GPIO_PortBase[port]; // Set the interrupt task for the specified port and pins if ( pins & 0x01 ) GPIO_PinISR[port][0] = task; else if( pins & 0x02 ) GPIO_PinISR[port][1] = task; else if( pins & 0x04 ) GPIO_PinISR[port][2] = task; else if( pins & 0x08 ) GPIO_PinISR[port][3] = task; else if( pins & 0x10 ) GPIO_PinISR[port][4] = task; else if( pins & 0x20 ) GPIO_PinISR[port][5] = task; else if( pins & 0x40 ) GPIO_PinISR[port][6] = task; else if( pins & 0x80 ) GPIO_PinISR[port][7] = task; // Set the event type and priority, and clear the interrupt IntPrioritySet( GPIO_IntAssignment[port], priority ); GPIOIntTypeSet( port_base, pins, int_type ); GPIOPinIntClear( port_base, pins); // Enable interrupts IntEnable( GPIO_IntAssignment[port] ); GPIOPinIntEnable( port_base, pins ); }
void vs_requesthandler(void) { unsigned int len, tail; GPIOPinIntClear(GPIO_PORTA_BASE, GPIO_PIN_1); len = vs_buflen(); if(len != 0) { if(len > 16) { len = 16; } vs_ssi_writewait(); //ssi transmit fifo full? VS_DCS_DISABLE(); tail = vs_buftail; VS_DCS_ENABLE(); for(; len!=0; len--) { vs_ssi_write(vs_buf.b8[tail]); if(++tail == VS_BUFSIZE) { tail = 0; } } vs_buftail = tail; } else { vs_pause(); } return; }
void vs_pause(void) { GPIOPinIntDisable(GPIO_PORTA_BASE, GPIO_PIN_1); //disable dreq irq GPIOPinIntClear(GPIO_PORTA_BASE, GPIO_PIN_1); return; }
void GPIO_PortG_ISR( void ) { unsigned char int_status = 0; GPIO_PIN_T pin = 0; // Figure out which pin caused the interrupt int_status = GPIOPinIntStatus( GPIO_PORTG_BASE, true ); if( int_status & 0x01 ) pin = 0; else if( int_status & 0x02 ) pin = 1; else if( int_status & 0x04 ) pin = 2; else if( int_status & 0x08 ) pin = 3; else if( int_status & 0x10 ) pin = 4; else if( int_status & 0x20 ) pin = 5; else if( int_status & 0x40 ) pin = 6; else if( int_status & 0x80 ) pin = 7; // Acknowledge and diable interrupts for this pin. // GPIOPinIntDisable( GPIO_PORTG_BASE, int_status ); GPIOPinIntClear( GPIO_PORTG_BASE, int_status ); // Call the task function for this pin's interrupt GPIO_PinISR[GPIO_PORT_G][pin](); // Enable interrupts for the pin. XXX Does this provide enough // debouncing for GPIO interrupts? If not, we can set a flag in // main that enables interrupts after a set amount of time. //GPIOPinIntEnable( GPIO_PORTG_BASE, int_status ); }
void GPIOFIntHandler(void) { // Clear the GPIO interrupt. GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_1); y = 0; // Counter for how long the snooze button was pressed while (GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_1)==0){ y++; } // If the snooze button was held long enough, add 5 minutes to the alarm if (y>500000){ int z; for (z=0; z<5; z++){ IncrementTimeA(); } } // Clear the screen RIT128x96x4Clear(); // Turn off the LED GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2); // Turn off the alarm PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT | PWM_OUT_1_BIT, false); PWMGenDisable(PWM0_BASE, PWM_GEN_0); // Disable the interrupt so that snooze and turn off alarm cannot be used GPIOPinIntDisable(GPIO_PORTF_BASE, GPIO_PIN_1); }
void PortBIntHandler (void) // Interrupt handler called upon IR receive { // Reset delay counter waitTime=0; // Turn on Status light upon first IR receive GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_0,0x01); // skip repeating IR pulse sequences if(!checkProtocol()) return; // 2 second delay between button presses if(waitTime2 < 20000) { flag = 1; } else { flag = 0; } // parse IR pulse sequence data getData(); // concatenate corresponding character to display buffer decodeLetter(decode(string)); // clear interrupt GPIOPinIntClear(GPIO_PORTB_BASE, GPIO_PIN_1); // reset delay between button presses waitTime2=0; }
void GPIO_PortF_IntHandler(void) { GPIOPinIntClear(GPIO_PORTF_BASE, GPIO_PIN_4); GPIOPinIntDisable(GPIO_PORTF_BASE, GPIO_PIN_4); Encoder_Count++; GPIOPinIntEnable(GPIO_PORTF_BASE, GPIO_PIN_4); }
void GpioIn::enableInterrupts(void) { // Clear the interrupt GPIOPinIntClear(gpio_.port, gpio_.pin); // Enable the interrupt GPIOPinIntEnable(gpio_.port, gpio_.pin); }
void SW_IntHandler(void) { GPIOPinIntClear(GPIO_PORTC_BASE, GPIO_PIN_5); printf("Switch PUSH\r\n"); QEIPositionSet(QEI0_BASE, 0); }
void RF22_PinIntHandler(void) { if(GPIOPinIntStatus(RFM_22_PORT_INT, false) & RFM_22_PIN_INT) { RF22_isr0(); } GPIOPinIntClear(RFM_22_PORT_INT, RFM_22_PIN_INT); }
void EncoderInterruptHandler(void) { int temp = 0; unsigned char pin, pinA, pinB; unsigned port; signed dir; volatile encoder_count_t *p_encCount; if((GPIOPinIntStatus(port=GPIO_PORTC_BASE, false) & (pin=GPIO_PIN_5))) { // encoder 0 fired! pinA = GPIO_PIN_5; pinB = GPIO_PIN_4; dir = dir0; p_encCount = &enc0; } else if(GPIOPinIntStatus(port=GPIO_PORTB_BASE, false) & (pin=GPIO_PIN_4)) { // encoder 0 fired! pinA = GPIO_PIN_5; pinB = GPIO_PIN_4; dir = -dir0; p_encCount = &enc0; } else if(GPIOPinIntStatus(port=GPIO_PORTC_BASE, false) & (pin=GPIO_PIN_6)) { // encoder 1 fired! pinA = GPIO_PIN_6; pinB = GPIO_PIN_6; dir = dir1; p_encCount = &enc1; } else if (GPIOPinIntStatus(port=GPIO_PORTB_BASE, false) & (pin=GPIO_PIN_6)) { // encoder 1 fired! pinA = GPIO_PIN_6; pinB = GPIO_PIN_6; dir = -dir1; p_encCount = &enc1; } else return; GPIOPinIntClear(port, pin); if(GPIOPinRead(GPIO_PORTC_BASE, pinA)) ++temp; // channel A if(GPIOPinRead(GPIO_PORTB_BASE, pinB)) ++temp; // channel B switch(temp) { case 0: // both channels == 0 case 2: // both channels == 1 // channel A == channel B *p_encCount += dir; // --> moving forward break; case 1: // one channel == 1 and the other == 0 // channel A != channel B *p_encCount -= dir; // --> moving backward break; } }
/** Port E interrupt service routine @note Must be configured in startup_ccs.c or else will not be called. */ void IntGPIOe(void) { buttonIsr(0); // Button 0 was pressed #ifdef TIVA GPIOIntClear(GPIO_PORTE_BASE, GPIO_PIN_4); //Clear interrupts #else GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_4); //Clear interrupts #endif }
void GPIO_3A_ISR(void) { if(GPIOPinIntStatus(SOC_GPIO_3_REGS, GPIO_INT_LINE_1, LCD_INT_PIN)) { LCD_Interrupt(FALSE); LCD_SetInterruptFlag(); GPIOPinIntClear(SOC_GPIO_3_REGS, GPIO_INT_LINE_1, LCD_INT_PIN); } }
void vGPIO_ISR( void ) { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; /* Clear the interrupt. */ GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON); /* Wake the button handler task. */ xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken ); portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); }
void PortBIntHandler (void) // Interrupt handler called upon IR receive { char str[10]; // Reset delay counter waitTime=0; // skip repeating IR pulse sequences if(!checkProtocol()) { GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_0,0x00); GPIOPinIntClear(GPIO_PORTB_BASE, GPIO_PIN_1); //displayAccel(); return; } // 2 second delay between button presses if(waitTime2 < 20000) { flag = 1; } else { flag = 0; } // parse IR pulse sequence data getData(); // concatenate corresponding character to display buffer decodeLetter(decode(string)); RIT128x96x4StringDraw(display2, 0, 80, 15); GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_0,0x01); // reset delay between button presses waitTime2=0; GPIOPinIntClear(GPIO_PORTB_BASE, GPIO_PIN_1); //displayAccel(); }
void DataReadyIntHandler(void) { uint8_t p = ROM_GPIOPinIntStatus(ADS_DRY_PORT, true) & 0xFF; MAP_IntDisable(INT_GPIOC); MAP_GPIOPinIntDisable(ADS_DRY_PORT, ADS_DRY_PIN); GPIOPinIntClear(ADS_DRY_PORT, p); HWREGBITW(&g_ulFlags, FLAG_ADS_INT) = 1; }
void flipPancake(void) { GPIOPinIntDisable(GPIO_PORTA_BASE, GPIO_PIN_2); WaitUS(2000); GPIOPinIntClear(GPIO_PORTA_BASE, GPIO_PIN_2); if(!GPIOPinRead(GPIO_PORTA_BASE,GPIO_PIN_2)) { UARTprintf("Triggered.\n"); SetServoPosition(PANCAKE_POSITION,100*pancake); pancake = !pancake; } GPIOPinIntEnable(GPIO_PORTA_BASE, GPIO_PIN_2); }
/***************************************************************************** * INTERRUPT SERVICE ROUTINES *****************************************************************************/ void ISR_Bumper(void) { // TODO: Doesn't differentiate between L or R bumper // TODO: We should probably add debouncing /* Clears Interrupt */ GPIOPinIntClear(GPIO_PORTE_BASE, (1 << 0) | (1 << 1)); bBumperPressed = true; return; }
void SonarGPIOIntHandler(void) { GPIOPinIntClear(GPIO_PORTD_BASE, GPIO_PIN_3); if (GPIOPinRead(GPIO_PORTD_BASE, GPIO_PIN_3)) { status = TIMING; TIME(MAX_SONAR_TIME); } else { Sonar_Value = TimerValueGet(TIMER2_BASE, TIMER_A); status = DELAY; (*callback)(Sonar_Value); TIME(MS(10)); } }
//This will be used to handle button presses calling for a bluetooth reset void onBoardInteruptHandle(void){ //double I2C1_BIT_DELAY=(SysCtlClockGet() / (100 * 3)); //100us GPIOPinIntClear(GPIO_PORTF_BASE,GPIO_PIN_0|GPIO_PIN_4); ResetBluetooth(); //This is an attempt at an I2C hard reset of all devices. //Float SDA high, and toggle SCL through nine complete cycles at 100kHz (or slower). Then issue a STOP sequence /*GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_7,0x80); //SDA High SysCtlDelay(I2C1_BIT_DELAY); int i = 0; for(i=0; i<9; i++){ GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_6,0x40); //SCL High SysCtlDelay(I2C1_BIT_DELAY); GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_6,0x00); //SCL Low SysCtlDelay(I2C1_BIT_DELAY); } GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_6,0x00); //SCL Low SysCtlDelay(I2C1_BIT_DELAY); GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_7,0x00); //SDA Low SysCtlDelay(I2C1_BIT_DELAY); GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_6,0x40); //SCL High SysCtlDelay(I2C1_BIT_DELAY); GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_7,0x80); //SDA High SysCtlDelay(I2C1_BIT_DELAY);*/ //Serious credit to the man who made the Arduino version of this. he gave me addresses and equations. Sadly Arduino obfuscates what really is happening //Link posted on blog page //gyro address = 0x68 not 0x69 /*GPIOPinConfigure(GPIO_PA7_I2C1SDA); GPIOPinTypeI2C(GPIO_PORTA_BASE, GPIO_PIN_7); //Set GPA7 as SDA GPIOPinConfigure(GPIO_PA6_I2C1SCL); GPIOPinTypeI2CSCL(GPIO_PORTA_BASE, GPIO_PIN_6); //Set GPA6 as SCL I2CMasterInitExpClk(I2C1_MASTER_BASE,SysCtlClockGet(),false); //I think it operates at 100kbps I2CMasterEnable(I2C1_MASTER_BASE); //Initalize the accelerometer Address = 0x53 GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3,0x02); UARTSend(0xAB); I2CTransmit(0x53,0x2D,0x00); I2CTransmit(0x53,0x2D,0x10); I2CTransmit(0x53,0x2D,0x08); //Initalize the gyroscope Address = 0x68 I2CTransmit(0x68,0x3E,0x00); I2CTransmit(0x68,0x15,0x07); I2CTransmit(0x68,0x16,0x1E); I2CTransmit(0x68,0x17,0x00); UARTSend(0xAC);*/ //SysCtlReset(); //This fixes the I2C but it's way to slow to be }
/** Port F interrupt service routine @note Must be configured in startup_ccs.c or else will not be called. */ void IntGPIOf(void) { uint32_t buttonState = GPIOPinRead(GPIO_PORTF_BASE, ALL_BUTTONS); if ((~buttonState) & LEFT_BUTTON) buttonIsr(1); else if ((~buttonState) & RIGHT_BUTTON) buttonIsr(2); #ifdef TIVA GPIOIntClear(GPIO_PORTF_BASE, ALL_BUTTONS); //Clear interrupts #else GPIOPinIntClear(GPIO_PORTF_BASE, ALL_BUTTONS); //Clear interrupts #endif }
// ARM code void pinout_interrupt( void ) { GPIOPinIntClear( PINOUT_PORT, PINOUT_MASK ); ///clear interrupt flag if ( !GPIOPinRead( PINOUT_PORT, 1 << PIN_RESET ) ) { mc_reset(); } else if ( !GPIOPinRead( PINOUT_PORT, 1 << PIN_FEED_HOLD ) ) { sys.execute |= EXEC_FEED_HOLD; } else if ( !GPIOPinRead( PINOUT_PORT, 1 << PIN_CYCLE_START ) ) { sys.execute |= EXEC_CYCLE_START; } }
void Pin_Int(void) { GPIOPinIntClear(GPIO_PORTE_BASE, GPIO_PIN_0); if(g_ulcount==5) { g_ulcount=0; GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_5, 0); SysCtlDelay(SysCtlClockGet() / 12); GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_PIN_5); SysCtlDelay(SysCtlClockGet() / 12); } g_ulcount++; }