diff options
-rw-r--r-- | entry.c | 9 | ||||
-rw-r--r-- | example-cdc/sys.h | 2 | ||||
-rw-r--r-- | example-led/sample.c | 32 | ||||
-rw-r--r-- | example-led/sys.h | 2 |
4 files changed, 2 insertions, 43 deletions
@@ -28,15 +28,10 @@ #include <stdint.h> #include <stdlib.h> -#include "sys.h" - -static void __attribute__ ((used)) -flash_unlock (void) -{ - (*vector[3]) (); -} #if 0 +#include "sys.h" + static void __attribute__ ((used)) clock_init (void) { diff --git a/example-cdc/sys.h b/example-cdc/sys.h index bb1ea71..1f5b602 100644 --- a/example-cdc/sys.h +++ b/example-cdc/sys.h @@ -20,13 +20,11 @@ set_led (int on) return (*func) (on); } -#if 0 static inline void flash_unlock (void) { (*vector[3]) (); } -#endif static inline int flash_program_halfword (uint32_t addr, uint16_t data) diff --git a/example-led/sample.c b/example-led/sample.c index 9441a57..c4ca7bf 100644 --- a/example-led/sample.c +++ b/example-led/sample.c @@ -6,7 +6,6 @@ static chopstx_mutex_t mtx; static chopstx_cond_t cnd0; static chopstx_cond_t cnd1; -static chopstx_cond_t cnd_intr; static uint8_t u, v; static uint8_t m; /* 0..100 */ @@ -51,34 +50,11 @@ blk (void *arg) return NULL; } -#define INTR_REQ_0 0 - -static void * -intr (void *arg) -{ - (void)arg; - chopstix_intr_t interrupt; - - chopstx_intr_register (&interrupt, INTR_REQ_0); - - while (1) - { - chopstx_wait_intr (&interrupt); - - /* process interrupt... */ - chopstx_usleep (200*1000); - } - - return NULL; -} - #define PRIO_PWM 3 #define PRIO_BLK 2 -#define PRIO_INTR 2 extern uint8_t __process1_stack_base__, __process1_stack_size__; extern uint8_t __process2_stack_base__, __process2_stack_size__; -extern uint8_t __process3_stack_base__, __process3_stack_size__; const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__; const size_t __stacksize_pwm = (size_t)&__process1_stack_size__; @@ -86,9 +62,6 @@ const size_t __stacksize_pwm = (size_t)&__process1_stack_size__; const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__; const size_t __stacksize_blk = (size_t)&__process2_stack_size__; -const uint32_t __stackaddr_intr = (uint32_t)&__process3_stack_base__; -const size_t __stacksize_intr = (size_t)&__process3_stack_size__; - int main (int argc, const char *argv[]) @@ -116,11 +89,6 @@ main (int argc, const char *argv[]) chopstx_create (&thd, &attr, blk, NULL); - chopstx_attr_setschedparam (&attr, PRIO_INTR); - chopstx_attr_setstack (&attr, __stackaddr_intr, __stacksize_intr); - - chopstx_create (&thd, &attr, intr, NULL); - chopstx_usleep (200*1000); chopstx_mutex_lock (&mtx); diff --git a/example-led/sys.h b/example-led/sys.h index bb1ea71..1f5b602 100644 --- a/example-led/sys.h +++ b/example-led/sys.h @@ -20,13 +20,11 @@ set_led (int on) return (*func) (on); } -#if 0 static inline void flash_unlock (void) { (*vector[3]) (); } -#endif static inline int flash_program_halfword (uint32_t addr, uint16_t data) |