From 9d1baca216a7697c95a9f68cdd0e768e0e7842e5 Mon Sep 17 00:00:00 2001 From: AceVest Date: Mon, 18 Jun 2018 17:48:35 +0800 Subject: [PATCH] ... --- arduino/hardware/ace/avr/cores/avr/kernel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/arduino/hardware/ace/avr/cores/avr/kernel.cpp b/arduino/hardware/ace/avr/cores/avr/kernel.cpp index 17b1cd6..95495ee 100644 --- a/arduino/hardware/ace/avr/cores/avr/kernel.cpp +++ b/arduino/hardware/ace/avr/cores/avr/kernel.cpp @@ -70,6 +70,7 @@ void create_task(void (*handler)(), uint8_t *stack, uint8_t priority) t->stack = stack + TASK_STACK_SIZE - 3; uint8_t *p = t->stack; + // 貌似atmega328p执行RET会弹出3个字节给到PC寄存器 *(p+0) = (((uint32_t)handler) >> 16); *(p+1) = (((uint32_t)handler) >> 8); *(p+2) = (((uint32_t)handler) >> 0); -- 2.44.0