diff options
author | oharboe <oharboe> | 2008-05-06 06:39:21 +0000 |
---|---|---|
committer | oharboe <oharboe> | 2008-05-06 06:39:21 +0000 |
commit | 6c7ee841131808466eb0c93e5c8f112771004fbf (patch) | |
tree | d329cf4cc6f115b99ce24890828bef322e2db6f1 /zpu/hdl/zpu4/test/interrupt/int.c | |
parent | 3d2b8306640ae65aa9b48f70f50c3396324455be (diff) | |
download | zpu-6c7ee841131808466eb0c93e5c8f112771004fbf.zip zpu-6c7ee841131808466eb0c93e5c8f112771004fbf.tar.gz |
* Small ZPU now supports interrupts
* added simulation example demonstrating interrupts
Diffstat (limited to 'zpu/hdl/zpu4/test/interrupt/int.c')
-rw-r--r-- | zpu/hdl/zpu4/test/interrupt/int.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/zpu/hdl/zpu4/test/interrupt/int.c b/zpu/hdl/zpu4/test/interrupt/int.c index 1b6ec01..6ab28f7 100644 --- a/zpu/hdl/zpu4/test/interrupt/int.c +++ b/zpu/hdl/zpu4/test/interrupt/int.c @@ -4,11 +4,15 @@ #include <stdio.h>
-int counter;
+volatile int counter;
/* Example of single, fixed interval non-maskable, nested interrupt. The interrupt signal is
* held high for enough cycles to guarantee that it will be noticed, i.e. longer than
* any io access + 4 cycles roughly.
+ *
+ * Any non-trivial interrupt controller would have support for
+ * acknowledging interrupts(i.e. keep interrupts asserted until
+ * software acknowledges them via memory mapped IO).
*/
void _zpu_interrupt(void)
{
@@ -29,6 +33,7 @@ int main(int argc, char **argv) } else
{
puts("Got interrupt\n");
+ t=counter;
}
}
|