KEIS

Dependencies:   C12832_lcd mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
khayakawa
Date:
Sat Sep 28 07:11:02 2013 +0000
Commit message:
KEIS

Changed in this revision

C12832_lcd.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832_lcd.lib	Sat Sep 28 07:11:02 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/C12832_lcd/#468cdccff7af
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Sep 28 07:11:02 2013 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+#include "rtos.h"
+#include "C12832_lcd.h"
+
+C12832_LCD lcd;
+Mutex lcd_mutex; 
+
+void lcd_thread1(void const *argument) {
+    int count1;
+    while (true) {
+        Thread::signal_wait(0x1);
+        lcd_mutex.lock();
+        lcd.locate(0,3);
+        lcd.printf("%thread2 count: %d\n\r", count1);
+        lcd_mutex.unlock();
+        count1++;
+    }
+}
+
+void count_thread1(void const *argument){
+    Thread thread2(lcd_thread1);
+    while (true) {
+        Thread::wait(1000);
+        thread2.signal_set(0x1);
+    }
+}
+
+void lcd_thread2(void const *argument) {
+    int count2=0;
+    while (true) {
+        Thread::signal_wait(0x1);
+        // lcd_mutex.lock();
+        lcd.locate(0,15);
+        lcd.printf("%thread4 count: %d\n\r", count2);
+        // lcd_mutex.unlock();
+        count2++;
+    }
+}
+
+void count_thread2(void const *argument){
+    Thread thread4(lcd_thread2);
+    while (true) {
+        Thread::wait(2000);
+        thread4.signal_set(0x1);
+    }
+}
+
+int main() {
+    lcd.cls();
+    Thread thread1(count_thread1);
+//    Thread thread2(lcd_thread1);
+    Thread thread3(count_thread2);
+//    Thread thread4(lcd_thread2);
+    Thread::wait(osWaitForever);    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Sat Sep 28 07:11:02 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58b30ac3f00e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Sep 28 07:11:02 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file