aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-23 13:15:31 -0700
committerChristian Cunningham <cc@localhost>2022-01-23 13:15:31 -0700
commit13b239faf1c7f1d21fd4b0b774ea90c97c536623 (patch)
treeb0154a0039448c3a45c0965307824873e79eb88a /src
parentc3f0c731c91b6edf5d9142d07c26e7d4fca28522 (diff)
Fixed argument
Diffstat (limited to 'src')
-rw-r--r--src/cpu/irq.c7
-rw-r--r--src/sys/schedule.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index 1b5e09f..fd0cbd5 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -12,6 +12,7 @@
#include <util/time.h>
void localtest(void);
+void uarttest(unsigned char);
void c_irq_handler(void)
{
@@ -90,6 +91,7 @@ void c_irq_handler(void)
} else {
cmd[off] = (char) data;
off += 1;
+ add_thread(uarttest, (void*)data, 2);
}
} else if (off == 2048) {
if (data == 0x0D) {
@@ -246,3 +248,8 @@ unsigned long c_fiq_handler(void)
void localtest(void)
{
}
+
+void uarttest(unsigned char a)
+{
+ uart_char(a);
+}
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index ebf60bc..ad7feec 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -77,9 +77,9 @@ void add_thread(void* pc, void* arg, unsigned char priority)
if (r.sp) {
thread->sp_base = r.idx;
unsigned long* argp = r.sp;
- argp -= 1;
- *argp = (unsigned long)arg; // Set r0 to the argument
argp -= 13;
+ *argp = (unsigned long)arg; // Set r0 to the argument
+ argp -= 1;
*(unsigned long**)argp = (unsigned long*)cleanup; // Set lr to the cleanup function
thread->sp = (void*)argp;
thread->status = THREAD_READY;