Skip to content

Commit e06be3f

Browse files
committed
Revert 2.0 interrupt code.
1 parent abe3c91 commit e06be3f

File tree

2 files changed

+8
-37
lines changed

2 files changed

+8
-37
lines changed

hardware/zpuino/zpu/cores/zpuino/start.S

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ __executable_start:
2020
poppc
2121

2222
.balign 4,0
23-
.globl _Z14_zpu_interruptj
23+
.globl _Z14_zpu_interruptv
2424

2525
.type ___zpu_interrupt_vector,@function
2626
.globl ___zpu_interrupt_vector
2727
___zpu_interrupt_vector:
28-
loadsp 4
29-
im _Z14_zpu_interruptj
28+
im _memreg+0
29+
load
30+
im _Z14_zpu_interruptv
3031
call
31-
storesp 0
32+
im _memreg+0
33+
store
3234
poppc
3335
.size ___zpu_interrupt_vector, . - ___zpu_interrupt_vector
3436

@@ -46,12 +48,11 @@ _cpu_config:
4648
.weak _initIO
4749
_initIO:
4850
poppc
49-
/*
51+
5052
.globl _Z14_zpu_interruptv
5153
.weak _Z14_zpu_interruptv
5254
_Z14_zpu_interruptv:
5355
poppc
54-
*/
5556
.weak _initIO
5657
.section ".vectors"
5758

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
11
#include "zpuino.h"
2-
#include "zpuino-types.h"
2+
33
#include "HardwareSerial.h"
44
/* Most stuff is in zpuino-accel.S */
55

6-
#define ZPUINO_MAX_INTERRUPTS 16
7-
8-
typedef void(*interrupt_type_t)(void);
9-
10-
static interrupt_type_t itable[ZPUINO_MAX_INTERRUPTS]={0};
11-
12-
void attachInterrupt(unsigned int line, void (*function)(void), int mode)
13-
{
14-
if (line>=ZPUINO_MAX_INTERRUPTS)
15-
return;
16-
// cli();
17-
itable[line] = function;
18-
// sei();
19-
}
20-
void detachInterrupt(unsigned int line)
21-
{
22-
// cli();
23-
if (line>=ZPUINO_MAX_INTERRUPTS)
24-
return;
25-
itable[line] = 0;
26-
// sei();
27-
}
28-
29-
void _zpu_interrupt(unsigned int line)
30-
{
31-
if (line>=ZPUINO_MAX_INTERRUPTS)
32-
return;
33-
if (itable[line])
34-
itable[line]();
35-
}

0 commit comments

Comments
 (0)