]> oss.titaniummirror.com Git - rgblamp.git/commitdiff
Fix task_get() return check in main()
authorR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Dec 2011 06:32:54 +0000 (23:32 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Dec 2011 06:32:54 +0000 (23:32 -0700)
main.c

diff --git a/main.c b/main.c
index ae9d1e193855eefbe52532ad827c3f8e620cad19..331ec58c254491d20ffd1813510e93ddf63dcec4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -32,8 +32,8 @@
 #include "btn.h"
 #include "rgb.h"
 #include "tmr.h"
-#include "adc_random.h"
 #include "task.h"
+#include "adc_random.h"
 
 #if 0
 #define AUTO_OFF_COUNT          549316UL  /*  5 hrs in 32.768 ms units */
@@ -214,7 +214,7 @@ void user_tasks(unsigned char block)
 {
   task_id_t tid;
 
-  while ((tid = task_get(block))) {
+  while ((tid = task_get(block)) >= 0) {
     switch (tid) {
       case TASK_BTN_PB:         /* pushbutton state change */
         pb_task();
@@ -237,6 +237,7 @@ void user_tasks(unsigned char block)
 
 int main(void)
 {
+  /* Platform initialization */
   pic_init();
   unused_init();
   btn_init();