From 9c625c817debcbc38e34c0bdb3c83290b3ff362a Mon Sep 17 00:00:00 2001 From: AceVest Date: Mon, 18 Jun 2018 12:24:02 +0800 Subject: [PATCH] ... --- arduino/hardware/ace/avr/cores/avr/a.sh | 2 - arduino/hardware/ace/avr/cores/avr/kernel.cpp | 284 ++++++++++++++++++ arduino/hardware/ace/avr/cores/avr/kernel.h | 32 ++ arduino/hardware/ace/avr/cores/avr/main | Bin 8528 -> 0 bytes arduino/hardware/ace/avr/cores/avr/main.cpp | 76 ++++- arduino/hardware/ace/avr/cores/avr/main.cpp.d | 4 - arduino/hardware/ace/avr/cores/avr/main.d | 3 - arduino/hardware/ace/avr/cores/avr/timer.cpp | 36 +-- 8 files changed, 393 insertions(+), 44 deletions(-) delete mode 100755 arduino/hardware/ace/avr/cores/avr/a.sh create mode 100644 arduino/hardware/ace/avr/cores/avr/kernel.cpp create mode 100644 arduino/hardware/ace/avr/cores/avr/kernel.h delete mode 100755 arduino/hardware/ace/avr/cores/avr/main delete mode 100644 arduino/hardware/ace/avr/cores/avr/main.cpp.d delete mode 100644 arduino/hardware/ace/avr/cores/avr/main.d diff --git a/arduino/hardware/ace/avr/cores/avr/a.sh b/arduino/hardware/ace/avr/cores/avr/a.sh deleted file mode 100755 index 1b4c2d8..0000000 --- a/arduino/hardware/ace/avr/cores/avr/a.sh +++ /dev/null @@ -1,2 +0,0 @@ -avr-gcc -g -O0 -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_ACE_AVR -DARDUINO_ARCH_AVR "-I/Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr" "-I/Users/ace/workspace/Arduino/hardware/ace/avr/variants/avr" "/Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/main.cpp" -o "main" -avr-gcc -c -g -O0 -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10804 -DARDUINO_ACE_AVR -DARDUINO_ARCH_AVR "-I/Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr" "-I/Users/ace/workspace/Arduino/hardware/ace/avr/variants/avr" "/Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/main.cpp" -o "main.cpp.o" diff --git a/arduino/hardware/ace/avr/cores/avr/kernel.cpp b/arduino/hardware/ace/avr/cores/avr/kernel.cpp new file mode 100644 index 0000000..8488fe5 --- /dev/null +++ b/arduino/hardware/ace/avr/cores/avr/kernel.cpp @@ -0,0 +1,284 @@ +/* + * ------------------------------------------------------------------------ + * File Name: kernel.cpp + * Author: Zhao Yanbai + * 2018-06-17 16:42:56 Sunday CST + * Description: none + * ------------------------------------------------------------------------ + */ +#include +#include + +void delay(unsigned long ms); + +struct task *current_task = 0; +const uint8_t max_task_cnt = 8; +struct task tasks[max_task_cnt]; +uint8_t idle_task_stack[TASK_STACK_SIZE]; +uint32_t ticks = 0; +void task_scheduler(); + +#define IDLE_TASK (tasks+max_task_cnt-1) +#define LED_TASK (task+0); +#define DEBUG_TASK (task+1); + +uint8_t debug_task_stack[TASK_STACK_SIZE]; +void debug_task() { + uint8_t pin = 12; + set_digital_pin_mode(pin, OUTPUT); + + while(1) { + digital_write(pin, HIGH); + task_delay(20); + digital_write(pin, LOW); + task_delay(20); + } +} + +uint8_t led_task_stack[TASK_STACK_SIZE]; +void led_task() { + while(1) task_delay(1000); + uint8_t pin = 13; + set_digital_pin_mode(pin, OUTPUT); + + while(1) { + digital_write(pin, HIGH); + task_delay(30); + digital_write(pin, LOW); + task_delay(30); + } +} + + +// idle_task 在没有进程READY的情况下都会调度运行 +// 所以task_delay不能在此进程生效 +void idle_task() { + sei(); + static uint32_t idle_cnt = 0; + uint8_t pin = 13; + set_digital_pin_mode(pin, OUTPUT); + uint8_t state = LOW; + while(1) { + idle_cnt++; + state = state == LOW ? HIGH : LOW; + digital_write(pin, state); + delay(1000); + } +} + +void task_delay(uint16_t ticks) +{ + cli(); + current_task->state = TASK_STATE_SLEEP; + current_task->delay_ticks = ticks; + sei(); + task_scheduler(); +} + + +void create_task(void (*handler)(), uint8_t *stack, uint8_t priority) +{ + if(priority >= max_task_cnt) { + return; + } + + struct task *t = tasks + priority; + t->handler = handler; + t->state = TASK_STATE_READY; +#if 0 + t->stack = stack + TASK_STACK_SIZE - 3; + uint8_t *p = t->stack; + *(p+0) = 0x00; + *(p+1) = (((uint16_t)handler) >> 8); + *(p+2) = (((uint16_t)handler) >> 0); +#else + t->stack = stack + TASK_STACK_SIZE - 2; + uint8_t *p = t->stack; + *(p+0) = (((uint16_t)handler) >> 0); + *(p+1) = (((uint16_t)handler) >> 8); +#endif + + *(--(t->stack)) = 0x00; // SREG + *(--(t->stack)) = 0x00; // R0 + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; // R10 + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; // 20 + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; + *(--(t->stack)) = 0x00; // 30 + *(--(t->stack)) = 0x00; + + --(t->stack); + // AVR 的PUSH是先存值再SP-1 + // AVR 的POP 是先SP+1再取值 +} + +void task_switch(struct task *prev, struct task *next) { + if(prev == next) { + return; + } + + __asm__ __volatile__( + "PUSH R31\n" + "PUSH R30\n" + "PUSH R29\n" + "PUSH R28\n" + "PUSH R27\n" + "PUSH R26\n" + "PUSH R25\n" + "PUSH R24\n" + "PUSH R23\n" + "PUSH R22\n" + "PUSH R21\n" + "PUSH R20\n" + "PUSH R19\n" + "PUSH R18\n" + "PUSH R17\n" + "PUSH R16\n" + "PUSH R15\n" + "PUSH R14\n" + "PUSH R13\n" + "PUSH R12\n" + "PUSH R11\n" + "PUSH R10\n" + "PUSH R09\n" + "PUSH R08\n" + "PUSH R07\n" + "PUSH R06\n" + "PUSH R05\n" + "PUSH R04\n" + "PUSH R03\n" + "PUSH R02\n" + "PUSH R01\n" + "PUSH R00\n" + "IN R00, __SREG__\n" + "PUSH R00\n" + ); + + prev->stack = (uint8_t *) SP; + SP = ((uint16_t)next->stack); + current_task = next; + + __asm__ __volatile__( + "POP R00\n" + "OUT __SREG__, R00\n" + "POP R00\n" + "POP R01\n" + "POP R02\n" + "POP R03\n" + "POP R04\n" + "POP R05\n" + "POP R06\n" + "POP R07\n" + "POP R08\n" + "POP R09\n" + "POP R10\n" + "POP R11\n" + "POP R12\n" + "POP R13\n" + "POP R14\n" + "POP R15\n" + "POP R16\n" + "POP R17\n" + "POP R18\n" + "POP R19\n" + "POP R20\n" + "POP R21\n" + "POP R22\n" + "POP R23\n" + "POP R24\n" + "POP R25\n" + "POP R26\n" + "POP R27\n" + "POP R28\n" + "POP R29\n" + "POP R30\n" + "POP R31\n" + "reti\n" + ); +} + +void init_tasks() { + cli(); + for(uint8_t i=0; ipid = i; + t->handler = 0; + t->stack = 0; + t->state = TASK_STATE_EMPTY; + t->delay_ticks = 0; + } + + + current_task = IDLE_TASK; + + create_task(idle_task, idle_task_stack, max_task_cnt-1); +// create_task(led_task, led_task_stack, 0); +// create_task(debug_task, debug_task_stack, 1); + IDLE_TASK->stack = idle_task_stack+TASK_STACK_SIZE-2-2; + SP = (uint16_t)(IDLE_TASK->stack); + asm("ret;"); +} + +void task_scheduler() { + return; + struct task *next = IDLE_TASK; + for(uint8_t i=0; istate) { + next = t; + break; + } + } + + task_switch(current_task, next); +} + +extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal,used, externally_visible)); +void TIMER1_COMPA_vect() +{ + ticks++; + + return; + + for(uint8_t i=0; istate) { + continue; + } + + if(t->delay_ticks > 0) { + t->delay_ticks--; + } + + if(t->delay_ticks == 0) { + t->state = TASK_STATE_READY; + } + } + + task_scheduler(); +} diff --git a/arduino/hardware/ace/avr/cores/avr/kernel.h b/arduino/hardware/ace/avr/cores/avr/kernel.h new file mode 100644 index 0000000..63606e4 --- /dev/null +++ b/arduino/hardware/ace/avr/cores/avr/kernel.h @@ -0,0 +1,32 @@ +/* + * ------------------------------------------------------------------------ + * File Name: kernel.h + * Author: Zhao Yanbai + * 2018-06-17 16:42:52 Sunday CST + * Description: none + * ------------------------------------------------------------------------ + */ + +#pragma once +#include + +#define TASK_STACK_SIZE 64 + +enum task_state { + TASK_STATE_EMPTY = 0, + TASK_STATE_READY = 1, + TASK_STATE_SLEEP = 2, +}; + +struct task { + uint8_t pid; + enum task_state state; + void (*handler)(); + uint8_t* stack; + uint16_t delay_ticks; +}; + +void init_tasks(); +void create_task(void (*handler)(), char *stack, uint8_t priority); +void task_switch(struct task *prev, struct task *next); +void task_delay(uint16_t ticks); diff --git a/arduino/hardware/ace/avr/cores/avr/main b/arduino/hardware/ace/avr/cores/avr/main deleted file mode 100755 index 03272662d9575912362c33356bd7cb87c5ac36e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8528 zcmbuEdvF`Y9mn@1*^*;Nj^mIQc_@jKI1o#+V>`|}vLri-UqX@zbV`LRpKW1T5|aFY zW{6Fg4#_ZsUxc>d5i$(W8Opn*g_Z!rP&zG5JLM0U=@9q9w1o~Olqqyd>wbTGch+Xf z(9U#|-TnPOzu)fuc6GOVc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 --- a/arduino/hardware/ace/avr/cores/avr/main.cpp +++ b/arduino/hardware/ace/avr/cores/avr/main.cpp @@ -6,38 +6,90 @@ * Description: none * ------------------------------------------------------------------------ */ - #include + void init_timer0(); void init_timer1(); +void init_tasks(); +#if 1 void init() { - sei(); + cli(); init_timer0(); - init_timer1(); + //init_timer1(); + //init_tasks(); + sei(); } -extern uint8_t tick; int main() { init(); - uint8_t pin = 12; + uint8_t pin = 13; set_digital_pin_mode(pin, OUTPUT); + digital_write(pin, LOW); - int n = 0; uint8_t state = LOW; while(1) { - n++; + state = state == LOW ? HIGH : LOW; + digital_write(pin, state); + delay(1000); + } + + + return 0; +} +#else + +uint8_t stack[128]; + +void handler() { + uint8_t pin = 12; + set_digital_pin_mode(pin, OUTPUT); + digital_write(pin, LOW); - if(tick > 100) { - state = state == LOW ? HIGH : LOW; - tick = 0; - } + uint8_t state = LOW; + while(1) { + state = state == LOW ? HIGH : LOW; digital_write(pin, state); - delay(10); + delay(1000); } +} + + +uint8_t * volatile p = 0; +int main() +{ + sei(); + init_timer0(); + + p = stack+64; + + *(p+0) = 0; + *(p+1) = 0; //(((uint16_t)handler) >> 8); + *(p+2) = (((uint16_t)handler) >> 0); + *(p+3) = (((uint16_t)handler) >> 8); + + + asm("nop"); + asm("nop"); + #if 1 + SP = (uint16_t) p; + #else + asm volatile ( + "lds r26, p\n" + "lds r27, p+1\n" + "out __SP_L__, r26\n" + "out __SP_H__, r27\n" + ); + #endif + asm("nop"); + asm("nop"); + + asm("ret"); return 0; } + +#endif diff --git a/arduino/hardware/ace/avr/cores/avr/main.cpp.d b/arduino/hardware/ace/avr/cores/avr/main.cpp.d deleted file mode 100644 index ded7b7e..0000000 --- a/arduino/hardware/ace/avr/cores/avr/main.cpp.d +++ /dev/null @@ -1,4 +0,0 @@ -main.cpp.o: \ - /Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/main.cpp \ - /Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/Arduino.h \ - /Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/AceAvr.h diff --git a/arduino/hardware/ace/avr/cores/avr/main.d b/arduino/hardware/ace/avr/cores/avr/main.d deleted file mode 100644 index cade3be..0000000 --- a/arduino/hardware/ace/avr/cores/avr/main.d +++ /dev/null @@ -1,3 +0,0 @@ -main: /Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/main.cpp \ - /Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/Arduino.h \ - /Users/ace/workspace/Arduino/hardware/ace/avr/cores/avr/AceAvr.h diff --git a/arduino/hardware/ace/avr/cores/avr/timer.cpp b/arduino/hardware/ace/avr/cores/avr/timer.cpp index 9a3092c..5ebc6e2 100644 --- a/arduino/hardware/ace/avr/cores/avr/timer.cpp +++ b/arduino/hardware/ace/avr/cores/avr/timer.cpp @@ -65,22 +65,20 @@ void init_timer0() { sbi(TIMSK0, TOIE0); } - - - void init_timer1() { - //set timer1 interrupt at 100Hz - TCCR1A = 0;// set entire TCCR1A register to 0 - TCCR1B = 0;// same for TCCR1B - TCNT1 = 0;//initialize counter value to 0 - // set compare match register for 100Hz increments - OCR1A = 155; // = (16*10^6) / (1024*100Hz) - 1 (must be <65536) - // turn on CTC mode - TCCR1B |= (1 << WGM12); - // Set CS10 and CS12 bits for 1024 prescaler - TCCR1B |= (1 << CS12) | (1 << CS10); - // enable timer compare interrupt - TIMSK1 |= (1 << OCIE1A); + //set timer1 interrupt at 100Hz + TCCR1A = 0;// set entire TCCR1A register to 0 + TCCR1B = 0;// same for TCCR1B + TCNT1 = 0;//initialize counter value to 0 + // set compare match register for 100Hz increments + //OCR1A = 155; // = (16*10^6) / (1024*100Hz) - 1 (must be <65536) + OCR1A = 15500; // = (16*10^6) / (1024*100Hz) - 1 (must be <65536) + // turn on CTC mode + TCCR1B |= (1 << WGM12); + // Set CS10 and CS12 bits for 1024 prescaler + TCCR1B |= (1 << CS12) | (1 << CS10); + // enable timer compare interrupt + TIMSK1 |= (1 << OCIE1A); } extern "C" void TIMER0_OVF_vect() __attribute__ ((signal,used, externally_visible)); @@ -88,11 +86,3 @@ void TIMER0_OVF_vect() { timer0_overflow_count++; } - - -extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal,used, externally_visible)); -uint8_t tick = 0; -void TIMER1_COMPA_vect() -{ - tick++; -} -- 2.44.0