#include "init4.h" void taste_irq_handler (void) __attribute__ ((interrupt)); void taste_irq_handler (void) { } int main(void) { *pmc_PCER = 0x4000; // Enable Peripheral Clock *pioB_PER = 0x118; // LED1=0x100; SW1=0x8; SW2=0x10 -> addieren *pioB_OER = 0x100; // Enable Output: LED1, WICHTIG: LED1 hier an! *aic_SVR = (int)taste_irq_handler; *aic_SMR = 1; for ( ; ; ) { if (!(*pioB_PDSR & 0x8)) // wenn SW1 dann LED1=ON (! -> low-active) { *pioB_CODR = 0x100; // Clear LED DS1 -> LED = AN *aic_EOICR = 1; } if (!(*pioB_PDSR & 0x10)) // wenn SW2 dann LED1=OFF (! -> low-active) { *pioB_SODR = 0x100; // Set LED DS1 -> LED = AUS *aic_EOICR = 1; } } return 0; }