aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-11-19 15:22:48 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-11-19 15:22:48 +0000
commitcdfd3dd254fbc77b69881a24a3bc5e3ee1a5158e (patch)
treefd068be6a50d6efb06b74ee4bd9a559050893a2d /demos
parent0ea5add1da767ae4a6b9f9b6ccaec3d3fe784fe2 (diff)
downloadChibiOS-cdfd3dd254fbc77b69881a24a3bc5e3ee1a5158e.tar.gz
ChibiOS-cdfd3dd254fbc77b69881a24a3bc5e3ee1a5158e.tar.bz2
ChibiOS-cdfd3dd254fbc77b69881a24a3bc5e3ee1a5158e.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6499 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/rt/RT-SPC56EL-EVB/Makefile2
-rw-r--r--demos/rt/RT-SPC56EL-EVB/main.c34
2 files changed, 17 insertions, 19 deletions
diff --git a/demos/rt/RT-SPC56EL-EVB/Makefile b/demos/rt/RT-SPC56EL-EVB/Makefile
index def793d89..34ed121bc 100644
--- a/demos/rt/RT-SPC56EL-EVB/Makefile
+++ b/demos/rt/RT-SPC56EL-EVB/Makefile
@@ -90,6 +90,8 @@ CSRC = $(PORTSRC) \
$(OSALSRC) \
$(PLATFORMSRC) \
$(BOARDSRC) \
+ $(CHIBIOS)/os/various/chprintf.c \
+ $(CHIBIOS)/os/various/shell.c \
main.c
# C++ sources here.
diff --git a/demos/rt/RT-SPC56EL-EVB/main.c b/demos/rt/RT-SPC56EL-EVB/main.c
index 2a460c43c..463ab1ebb 100644
--- a/demos/rt/RT-SPC56EL-EVB/main.c
+++ b/demos/rt/RT-SPC56EL-EVB/main.c
@@ -20,9 +20,8 @@
#include "shell.h"
#include "chprintf.h"
-#if 0
-#define SHELL_WA_SIZE THD_WA_SIZE(1024)
-#define TEST_WA_SIZE THD_WA_SIZE(256)
+#define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(1024)
+#define TEST_WA_SIZE THD_WORKING_AREA_SIZE(256)
static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
size_t n, size;
@@ -39,8 +38,8 @@ static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
}
static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
- static const char *states[] = {THD_STATE_NAMES};
- Thread *tp;
+ static const char *states[] = {CH_STATE_NAMES};
+ thread_t *tp;
(void)argv;
if (argc > 0) {
@@ -50,23 +49,23 @@ static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
chprintf(chp, " addr stack prio refs state time\r\n");
tp = chRegFirstThread();
do {
- chprintf(chp, "%.8lx %.8lx %4lu %4lu %9s %lu\r\n",
+ chprintf(chp, "%.8lx %.8lx %4lu %4lu %9s\r\n",
(uint32_t)tp, (uint32_t)tp->p_ctx.sp,
(uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
- states[tp->p_state], (uint32_t)tp->p_time);
+ states[tp->p_state]);
tp = chRegNextThread(tp);
} while (tp != NULL);
}
static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
- Thread *tp;
+ thread_t *tp;
(void)argv;
if (argc > 0) {
chprintf(chp, "Usage: test\r\n");
return;
}
- tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(),
+ tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(),
TestThread, chp);
if (tp == NULL) {
chprintf(chp, "out of memory\r\n");
@@ -90,7 +89,7 @@ static const ShellConfig shell_cfg1 = {
/*
* LEDs blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread1, 128);
+static THD_WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
(void)arg;
@@ -156,13 +155,12 @@ static msg_t Thread1(void *arg) {
}
return 0;
}
-#endif
/*
* Application entry point.
*/
int main(void) {
-// Thread *shelltp = NULL;
+ thread_t *shelltp = NULL;
/*
* System initializations.
@@ -171,36 +169,34 @@ int main(void) {
* - Kernel initialization, the main() function becomes a thread and the
* RTOS is active.
*/
-// halInit();
+ halInit();
chSysInit();
/*
* Shell manager initialization.
*/
-// shellInit();
+ shellInit();
/*
* Activates the serial driver 1 using the driver default configuration.
*/
-// sdStart(&SD1, NULL);
+ sdStart(&SD1, NULL);
/*
* Creates the blinker thread.
*/
-// chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/*
* Normal main() thread activity.
*/
while (TRUE) {
-#if 0
if (!shelltp)
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
- else if (chThdTerminated(shelltp)) {
+ else if (chThdTerminatedX(shelltp)) {
chThdRelease(shelltp); /* Recovers memory of the previous shell. */
shelltp = NULL; /* Triggers spawning of a new shell. */
}
-#endif
chThdSleepMilliseconds(1000);
}
return 0;