aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-07-11 17:21:32 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-07-11 17:21:32 +0900
commit08cca6b9f8d7d3253868be758deef9280fc949c5 (patch)
treedaab7c8c552aeada6420b4cc15e7feb758ad1e0f
parentc9d59a3f3fe340909e08bbdeaca191f56c682ce7 (diff)
stackaddr/size change
-rw-r--r--ChangeLog6
-rw-r--r--example-cdc/sample.c16
-rw-r--r--example-cdc/usb-cdc.c8
-rw-r--r--example-fs-bb48/sample.c16
-rw-r--r--example-fs-bb48/usb-cdc.c8
-rw-r--r--example-fsm-55/debian-logo.c20
-rw-r--r--example-fsm-55/hh.c20
-rw-r--r--example-fsm-55/hiroshi-ayumi.c24
-rw-r--r--example-led/sample.c16
9 files changed, 70 insertions, 64 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b937d5..169634b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-11 NIIBE Yutaka <gniibe@fsij.org>
+
+ * mcu/stm32f103.h: Add more from Gnuk 1.1.9.
+ * example-cdc, example-fs-bb48, example-fsm-55, example-led:
+ Update for stack addr/size.
+
2016-07-01 NIIBE Yutaka <gniibe@fsij.org>
* VERSION: 1.1.
diff --git a/example-cdc/sample.c b/example-cdc/sample.c
index d5f45b3..d9c38c8 100644
--- a/example-cdc/sample.c
+++ b/example-cdc/sample.c
@@ -61,14 +61,14 @@ blk (void *arg)
#define PRIO_PWM 3
#define PRIO_BLK 2
-extern uint8_t __process1_stack_base__, __process1_stack_size__;
-extern uint8_t __process2_stack_base__, __process2_stack_size__;
+extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
+extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
-const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__;
-const size_t __stacksize_pwm = (size_t)&__process1_stack_size__;
+#define STACK_ADDR_PWM ((uint32_t)__process1_stack_base__)
+#define STACK_SIZE_PWM ((uint32_t)__process1_stack_size__)
-const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__;
-const size_t __stacksize_blk = (size_t)&__process2_stack_size__;
+#define STACK_ADDR_BLK ((uint32_t)__process2_stack_base__)
+#define STACK_SIZE_BLK ((uint32_t)__process2_stack_size__)
static char hexchar (uint8_t x)
@@ -98,8 +98,8 @@ main (int argc, const char *argv[])
m = 10;
- chopstx_create (PRIO_PWM, __stackaddr_pwm, __stacksize_pwm, pwm, NULL);
- chopstx_create (PRIO_BLK, __stackaddr_blk, __stacksize_blk, blk, NULL);
+ chopstx_create (PRIO_PWM, STACK_ADDR_PWM, STACK_SIZE_PWM, pwm, NULL);
+ chopstx_create (PRIO_BLK, STACK_ADDR_BLK, STACK_SIZE_BLK, blk, NULL);
chopstx_usec_wait (200*1000);
diff --git a/example-cdc/usb-cdc.c b/example-cdc/usb-cdc.c
index 1a79fbf..360023d 100644
--- a/example-cdc/usb-cdc.c
+++ b/example-cdc/usb-cdc.c
@@ -642,9 +642,9 @@ static void *tty_main (void *arg);
#define INTR_REQ_USB 20
#define PRIO_TTY 4
-extern uint8_t __process3_stack_base__, __process3_stack_size__;
-const uint32_t __stackaddr_tty = (uint32_t)&__process3_stack_base__;
-const size_t __stacksize_tty = (size_t)&__process3_stack_size__;
+extern uint8_t __process3_stack_base__[], __process3_stack_size__[];
+#define STACK_ADDR_TTY ((uint32_t)__process3_stack_base__)
+#define STACK_SIZE_TTY ((uint32_t)__process3_stack_size__)
struct tty *
tty_open (void)
@@ -659,7 +659,7 @@ tty_open (void)
tty0.device_state = UNCONNECTED;
memcpy (&tty0.line_coding, &line_coding0, sizeof (struct line_coding));
- chopstx_create (PRIO_TTY, __stackaddr_tty, __stacksize_tty, tty_main, &tty0);
+ chopstx_create (PRIO_TTY, STACK_ADDR_TTY, STACK_SIZE_TTY, tty_main, &tty0);
return &tty0;
}
diff --git a/example-fs-bb48/sample.c b/example-fs-bb48/sample.c
index 3041d7d..a91cd62 100644
--- a/example-fs-bb48/sample.c
+++ b/example-fs-bb48/sample.c
@@ -75,14 +75,14 @@ blk (void *arg)
#define PRIO_PWM 3
#define PRIO_BLK 2
-extern uint8_t __process1_stack_base__, __process1_stack_size__;
-extern uint8_t __process2_stack_base__, __process2_stack_size__;
+extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
+extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
-const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__;
-const size_t __stacksize_pwm = (size_t)&__process1_stack_size__;
+#define STACK_ADDR_PWM ((uint32_t)__process1_stack_base__)
+#define STACK_SIZE_PWM ((uint32_t)__process1_stack_size__)
-const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__;
-const size_t __stacksize_blk = (size_t)&__process2_stack_size__;
+#define STACK_ADDR_BLK ((uint32_t)__process2_stack_base__)
+#define STACK_SIZE_BLK ((uint32_t)__process2_stack_size__)
static char hexchar (uint8_t x)
@@ -114,8 +114,8 @@ main (int argc, const char *argv[])
m = 10;
- chopstx_create (PRIO_PWM, __stackaddr_pwm, __stacksize_pwm, pwm, NULL);
- chopstx_create (PRIO_BLK, __stackaddr_blk, __stacksize_blk, blk, NULL);
+ chopstx_create (PRIO_PWM, STACK_ADDR_PWM, STACK_SIZE_PWM, pwm, NULL);
+ chopstx_create (PRIO_BLK, STACK_ADDR_BLK, STACK_SIZE_BLK, blk, NULL);
chopstx_usec_wait (200*1000);
diff --git a/example-fs-bb48/usb-cdc.c b/example-fs-bb48/usb-cdc.c
index 38b16ea..f6b443f 100644
--- a/example-fs-bb48/usb-cdc.c
+++ b/example-fs-bb48/usb-cdc.c
@@ -629,9 +629,9 @@ static void *tty_main (void *arg);
#define INTR_REQ_USB 24
#define PRIO_TTY 4
-extern uint8_t __process3_stack_base__, __process3_stack_size__;
-const uint32_t __stackaddr_tty = (uint32_t)&__process3_stack_base__;
-const size_t __stacksize_tty = (size_t)&__process3_stack_size__;
+extern uint8_t __process3_stack_base__[], __process3_stack_size__[];
+#define STACK_ADDR_TTY ((uint32_t)__process3_stack_base__)
+#define STACK_SIZE_TTY ((uint32_t)__process3_stack_size__)
struct tty *
tty_open (void)
@@ -646,7 +646,7 @@ tty_open (void)
tty0.device_state = UNCONNECTED;
memcpy (&tty0.line_coding, &line_coding0, sizeof (struct line_coding));
- chopstx_create (PRIO_TTY, __stackaddr_tty, __stacksize_tty, tty_main, &tty0);
+ chopstx_create (PRIO_TTY, STACK_ADDR_TTY, STACK_SIZE_TTY, tty_main, &tty0);
return &tty0;
}
diff --git a/example-fsm-55/debian-logo.c b/example-fsm-55/debian-logo.c
index e96fb75..de7ca5c 100644
--- a/example-fsm-55/debian-logo.c
+++ b/example-fsm-55/debian-logo.c
@@ -166,14 +166,14 @@ button (void *arg)
#define PRIO_LED 3
#define PRIO_BUTTON 2
-extern uint8_t __process1_stack_base__, __process1_stack_size__;
-extern uint8_t __process2_stack_base__, __process2_stack_size__;
+extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
+extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
-const uint32_t __stackaddr_led = (uint32_t)&__process1_stack_base__;
-const size_t __stacksize_led = (size_t)&__process1_stack_size__;
+#define STACK_ADDR_LED ((uint32_t)__process1_stack_base__)
+#define STACK_SIZE_LED ((uint32_t)__process1_stack_size__)
-const uint32_t __stackaddr_button = (uint32_t)&__process2_stack_base__;
-const size_t __stacksize_button = (size_t)&__process2_stack_size__;
+#define STACK_ADDR_BUTTON ((uint32_t)__process2_stack_base__)
+#define STACK_SIZE_BUTTON ((uint32_t)__process2_stack_size__)
#define DATA55(x0,x1,x2,x3,x4) (x0<<20)|(x1<<15)|(x2<<10)|(x3<< 5)|(x4<< 0)
#define SIZE55(img) (sizeof (img) / sizeof (uint32_t))
@@ -382,10 +382,10 @@ main (int argc, const char *argv[])
chopstx_cond_init (&cnd0);
chopstx_cond_init (&cnd1);
- led_thd = chopstx_create (PRIO_LED, __stackaddr_led,
- __stacksize_led, led, NULL);
- button_thd = chopstx_create (PRIO_BUTTON, __stackaddr_button,
- __stacksize_button, button, NULL);
+ led_thd = chopstx_create (PRIO_LED, STACK_ADDR_LED,
+ STACK_SIZE_LED, led, NULL);
+ button_thd = chopstx_create (PRIO_BUTTON, STACK_ADDR_BUTTON,
+ STACK_SIZE_BUTTON, button, NULL);
chopstx_usec_wait (200*1000);
diff --git a/example-fsm-55/hh.c b/example-fsm-55/hh.c
index 8575383..fc8ad92 100644
--- a/example-fsm-55/hh.c
+++ b/example-fsm-55/hh.c
@@ -166,14 +166,14 @@ button (void *arg)
#define PRIO_LED 3
#define PRIO_BUTTON 2
-extern uint8_t __process1_stack_base__, __process1_stack_size__;
-extern uint8_t __process2_stack_base__, __process2_stack_size__;
+extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
+extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
-const uint32_t __stackaddr_led = (uint32_t)&__process1_stack_base__;
-const size_t __stacksize_led = (size_t)&__process1_stack_size__;
+#define STACK_ADDR_LED ((uint32_t)__process1_stack_base__)
+#define STACK_SIZE_LED ((uint32_t)__process1_stack_size__)
-const uint32_t __stackaddr_button = (uint32_t)&__process2_stack_base__;
-const size_t __stacksize_button = (size_t)&__process2_stack_size__;
+#define STACK_ADDR_BUTTON ((uint32_t)__process2_stack_base__)
+#define STACK_SIZE_BUTTON ((uint32_t)__process2_stack_size__)
#define DATA55(x0,x1,x2,x3,x4) (x0<<20)|(x1<<15)|(x2<<10)|(x3<< 5)|(x4<< 0)
#define SIZE55(img) (sizeof (img) / sizeof (uint32_t))
@@ -370,10 +370,10 @@ main (int argc, const char *argv[])
chopstx_cond_init (&cnd0);
chopstx_cond_init (&cnd1);
- led_thd = chopstx_create (PRIO_LED, __stackaddr_led,
- __stacksize_led, led, NULL);
- button_thd = chopstx_create (PRIO_BUTTON, __stackaddr_button,
- __stacksize_button, button, NULL);
+ led_thd = chopstx_create (PRIO_LED, STACK_ADDR_LED,
+ STACK_SIZE_LED, led, NULL);
+ button_thd = chopstx_create (PRIO_BUTTON, STACK_ADDR_BUTTON,
+ STACK_SIZE_BUTTON, button, NULL);
chopstx_usec_wait (200*1000);
diff --git a/example-fsm-55/hiroshi-ayumi.c b/example-fsm-55/hiroshi-ayumi.c
index d465208..c300316 100644
--- a/example-fsm-55/hiroshi-ayumi.c
+++ b/example-fsm-55/hiroshi-ayumi.c
@@ -88,10 +88,10 @@ led_enable_column (uint8_t col)
#define PRIO_LED 3
-extern uint8_t __process1_stack_base__, __process1_stack_size__;
+extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
-const uint32_t stackaddr_led = (uint32_t)&__process1_stack_base__;
-const size_t stacksize_led = (size_t)&__process1_stack_size__;
+#define STACK_ADDR_LED ((uint32_t)__process1_stack_base__)
+#define STACK_SIZE_LED ((uint32_t)__process1_stack_size__)
static void *
led (void *arg)
@@ -119,10 +119,10 @@ led (void *arg)
#define PRIO_SPK 4
-extern uint8_t __process2_stack_base__, __process2_stack_size__;
+extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
-const uint32_t stackaddr_spk = (uint32_t)&__process2_stack_base__;
-const size_t stacksize_spk = (size_t)&__process2_stack_size__;
+#define STACK_ADDR_SPK ((uint32_t)__process2_stack_base__)
+#define STACK_SIZE_SPK ((uint32_t)__process2_stack_size__)
static chopstx_mutex_t spk_mtx;
static chopstx_cond_t spk_cnd;
@@ -193,10 +193,10 @@ spk (void *arg)
#define PRIO_MUSIC 2
-extern uint8_t __process3_stack_base__, __process3_stack_size__;
+extern uint8_t __process3_stack_base__[], __process3_stack_size__[];
-const uint32_t stackaddr_music = (uint32_t)&__process3_stack_base__;
-const size_t stacksize_music = (size_t)&__process3_stack_size__;
+#define STACK_ADDR_MUSIC ((uint32_t)__process3_stack_base__)
+#define STACK_SIZE_MUSIC ((uint32_t)__process3_stack_size__)
#define C 0
#define D 1
@@ -254,7 +254,7 @@ music (void *arg)
chopstx_cond_init (&spk_cnd);
chopstx_cond_init (&spk_cnd_no_tone);
- chopstx_create (PRIO_SPK, stackaddr_spk, stacksize_spk, spk, NULL);
+ chopstx_create (PRIO_SPK, STACK_ADDR_SPK, STACK_SIZE_SPK, spk, NULL);
while (1)
{
@@ -350,8 +350,8 @@ main (int argc, const char *argv[])
chopstx_mutex_init (&mtx);
chopstx_cond_init (&cnd);
- chopstx_create (PRIO_LED, stackaddr_led, stacksize_led, led, NULL);
- chopstx_create (PRIO_MUSIC, stackaddr_music, stacksize_music, music, NULL);
+ chopstx_create (PRIO_LED, STACK_ADDR_LED, STACK_SIZE_LED, led, NULL);
+ chopstx_create (PRIO_MUSIC, STACK_ADDR_MUSIC, STACK_SIZE_MUSIC, music, NULL);
chopstx_usec_wait (200*1000);
diff --git a/example-led/sample.c b/example-led/sample.c
index d8a9ac6..f346676 100644
--- a/example-led/sample.c
+++ b/example-led/sample.c
@@ -72,14 +72,14 @@ blk (void *arg)
#define PRIO_BLK 2
#endif
-extern uint8_t __process1_stack_base__, __process1_stack_size__;
-extern uint8_t __process2_stack_base__, __process2_stack_size__;
+extern uint8_t __process1_stack_base__[], __process1_stack_size__[];
+extern uint8_t __process2_stack_base__[], __process2_stack_size__[];
-const uint32_t __stackaddr_pwm = (uint32_t)&__process1_stack_base__;
-const size_t __stacksize_pwm = (size_t)&__process1_stack_size__;
+#define STACK_ADDR_PWM ((uint32_t)__process1_stack_base__)
+#define STACK_SIZE_PWM ((uint32_t)__process1_stack_size__)
-const uint32_t __stackaddr_blk = (uint32_t)&__process2_stack_base__;
-const size_t __stacksize_blk = (size_t)&__process2_stack_size__;
+#define STACK_ADDR_BLK ((uint32_t)__process2_stack_base__)
+#define STACK_SIZE_BLK ((uint32_t)__process2_stack_size__)
int
@@ -94,8 +94,8 @@ main (int argc, const char *argv[])
m = 10;
- chopstx_create (PRIO_PWM, __stackaddr_pwm, __stacksize_pwm, pwm, NULL);
- chopstx_create (PRIO_BLK, __stackaddr_blk, __stacksize_blk, blk, NULL);
+ chopstx_create (PRIO_PWM, STACK_ADDR_PWM, STACK_SIZE_PWM, pwm, NULL);
+ chopstx_create (PRIO_BLK, STACK_ADDR_BLK, STACK_SIZE_BLK, blk, NULL);
chopstx_usec_wait (200*1000);