Implement interrupt status register
Upon an interrupt, you can read from the interrupt status register to see what caused the interrupt.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "sevenseg.h"
|
||||
#include "uart.h"
|
||||
#include "interrupt.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@@ -75,5 +76,14 @@ int main(void)
|
||||
printf("Done!\n\n");
|
||||
|
||||
|
||||
printf("Testing irq_get_status...\n");
|
||||
*(uint8_t*)0x7fff = 0xa5;
|
||||
if (irq_get_status() != 0xa5) {
|
||||
printf("Incorrect value!\n", i);
|
||||
retval++;
|
||||
}
|
||||
printf("Done!\n\n");
|
||||
|
||||
|
||||
return retval != 0;
|
||||
}
|
||||
Reference in New Issue
Block a user