aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-18 09:45:45 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-18 09:45:45 +0000
commit4fc627f08b942df8312ad02f24a361b18c4b790b (patch)
tree04258a6a07f8982114d883b55f71b89080e4d0bd /demos
parent195a9c7951c29828d7eddefcd77d7a98d18f75f3 (diff)
downloadChibiOS-4fc627f08b942df8312ad02f24a361b18c4b790b.tar.gz
ChibiOS-4fc627f08b942df8312ad02f24a361b18c4b790b.tar.bz2
ChibiOS-4fc627f08b942df8312ad02f24a361b18c4b790b.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@95 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARM7-LPC214x-GCC/buzzer.c4
-rw-r--r--demos/ARM7-LPC214x-GCC/chcore.c9
-rw-r--r--demos/ARM7-LPC214x-GCC/chcore.h4
-rw-r--r--demos/ARM7-LPC214x-GCC/main.c23
4 files changed, 12 insertions, 28 deletions
diff --git a/demos/ARM7-LPC214x-GCC/buzzer.c b/demos/ARM7-LPC214x-GCC/buzzer.c
index 218d920d0..7d80d8881 100644
--- a/demos/ARM7-LPC214x-GCC/buzzer.c
+++ b/demos/ARM7-LPC214x-GCC/buzzer.c
@@ -52,8 +52,8 @@ void InitBuzzer(void) {
TC *tc = T1Base;
StopCounter(tc);
tc->TC_CTCR = 0; // Clock source is PCLK.
- tc->TC_PR = 0; // Prescaler disabled.
- tc->TC_MCR = 2; // Clear TC on match MR0.
+ tc->TC_PR = 0; // Prescaler disabled.
+ tc->TC_MCR = 2; // Clear TC on match MR0.
}
static void stop(void *p) {
diff --git a/demos/ARM7-LPC214x-GCC/chcore.c b/demos/ARM7-LPC214x-GCC/chcore.c
index 2f60c9d53..bf157cf43 100644
--- a/demos/ARM7-LPC214x-GCC/chcore.c
+++ b/demos/ARM7-LPC214x-GCC/chcore.c
@@ -140,14 +140,15 @@ void hwinit(void) {
InitBuzzer();
}
-void chSysPause(void) {
-
- chThdSetPriority(IDLEPRIO);
+/*
+ * System idle thread loop.
+ */
+void _IdleThread(void *p) {
while (TRUE) {
// Note, it is disabled because it causes trouble with the JTAG probe.
// Enable it in the final code only.
-// PCON = 1; /* Stops CPU clock until next interrupt. */
+// PCON = 1;
}
}
diff --git a/demos/ARM7-LPC214x-GCC/chcore.h b/demos/ARM7-LPC214x-GCC/chcore.h
index 9a1401f1c..7aef95d12 100644
--- a/demos/ARM7-LPC214x-GCC/chcore.h
+++ b/demos/ARM7-LPC214x-GCC/chcore.h
@@ -98,6 +98,10 @@ extern void chSysUnlock(void);
#define UserStackSize(n) (sizeof(Thread) + \
sizeof(struct stackregs) + (n) + (INT_REQUIRED_STACK))
+
+#define IDLE_THREAD_STACK_SIZE 8
+void _IdleThread(void *p) __attribute__((noreturn));
+
void chSysHalt(void) __attribute__((noreturn));
void chSysPause(void) __attribute__((noreturn));
void chSysSwitchI(Context *oldp, Context *newp);
diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c
index 14e03170d..1829e6eb6 100644
--- a/demos/ARM7-LPC214x-GCC/main.c
+++ b/demos/ARM7-LPC214x-GCC/main.c
@@ -26,18 +26,6 @@
#include "evtimer.h"
/*
- * System Idle Thread, this thread only runs when on other threads in the
- * system require the CPU.
- * The role of this thread is to minimize the power consumption when idling
- * and serve the interrupts.
- */
-static BYTE8 waIdleThread[UserStackSize(16)];
-static t_msg IdleThread(void *arg) {
-
- chSysPause();
-}
-
-/*
* Red LEDs blinker thread, times are in milliseconds.
*/
static BYTE8 waThread1[UserStackSize(32)];
@@ -139,15 +127,6 @@ int main(int argc, char **argv) {
chSysInit();
/*
- * This thread has the lowest priority in the system, its role is just to
- * execute the chSysPause() and serve interrupts in its context.
- * In ChibiOS/RT at least one thread in the system *must* execute
- * chThdPause(), it can be done in a dedicated thread or in the main()
- * function (that would never exit the call).
- */
- chThdCreate(IDLEPRIO, 0, waIdleThread, sizeof(waIdleThread), IdleThread, NULL);
-
- /*
* If a button is pressed during the reset then the blinking leds threads
* are not started in order to make accurate benchmarks.
*/
@@ -163,7 +142,7 @@ int main(int argc, char **argv) {
chThdSetPriority(NORMALPRIO);
/*
- * Normal main() activity, in this demo it server events incoming from
+ * Normal main() activity, in this demo it serves events generated by
* various sources.
*/
evtInit(&evt, 500); /* Initializes an event timer object. */