mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-11-26 02:16:24 -05:00
PoC: Remove IRQ30 from fw/irqpoc_c_example
Removing IRQ30 since it us no longer exist
This commit is contained in:
parent
91625c05bb
commit
a9484d9cf4
2 changed files with 27 additions and 73 deletions
|
|
@ -10,38 +10,12 @@
|
|||
// Proof-of-concept firmware for handling syscalls.
|
||||
// This is NOT a best-practice example of secure syscall implementation.
|
||||
|
||||
#define SYSCALL_HI (1 << 31)
|
||||
#define SYSCALL_LO 0
|
||||
#define SYSCALL_SET_LED 10
|
||||
|
||||
#define SYSCALL_HI_SET_LED (SYSCALL_HI | 10)
|
||||
#define SYSCALL_LO_SET_LED (SYSCALL_LO | 10)
|
||||
|
||||
static void delay(int32_t count) {
|
||||
volatile int32_t c = count;
|
||||
while (c > 0) {
|
||||
c--;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t syscall_lo_handler(uint32_t syscall_nr, uint32_t arg1) {
|
||||
int32_t syscall_handler(uint32_t syscall_nr, uint32_t arg1) {
|
||||
switch (syscall_nr) {
|
||||
case SYSCALL_LO_SET_LED:
|
||||
case SYSCALL_SET_LED:
|
||||
set_led(arg1);
|
||||
//delay(1000000);
|
||||
return 0;
|
||||
default:
|
||||
assert(1 == 2);
|
||||
}
|
||||
|
||||
assert(1 == 2);
|
||||
return -1; // This should never run
|
||||
}
|
||||
|
||||
int32_t syscall_hi_handler(uint32_t syscall_nr, uint32_t arg1) {
|
||||
switch (syscall_nr) {
|
||||
case SYSCALL_HI_SET_LED:
|
||||
set_led(arg1);
|
||||
//delay(500000);
|
||||
return 0;
|
||||
default:
|
||||
assert(1 == 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue