Purpose: Simple application example with 2 threads communicating 5-byte buffers through a Mail event-object.

Dependencies:   IHM_V2

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

/media/uploads/jacquesolivierklein/mbed-os-mail-5-bytes-tx-rx.png

Purpose: Simple application example with 2 threads communicating 5-byte buffers through a Mail event-object. Target: L432KC / Nboard (from IUT-Cachan) Tested: YES (2019-01-09) Author: Jacques-Olivier Klein - IUT de CACHAN Date: 2018-02-10 rev. 2019-01-09 OS_STACK_SIZE=4096 Libraries: mbed-os rev5345:c966348(03jan2019) + IHMV2 (from IUT-Cachan) rev6:ad91067

Files at this revision

API Documentation at this revision

Comitter:
jacquesolivierklein
Date:
Wed Jan 09 12:26:12 2019 +0000
Parent:
28:9a6aff2af525
Commit message:
update for mbed-os-5.11 (and IHM-V2)

Changed in this revision

IHM_V1.lib Show diff for this revision Revisions of this file
IHM_V2.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-os.lib Show annotated file Show diff for this revision Revisions of this file
readme.txt Show annotated file Show diff for this revision Revisions of this file
diff -r 9a6aff2af525 -r e8a6f4ab0fd5 IHM_V1.lib
--- a/IHM_V1.lib	Sun Feb 11 09:05:16 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/teams/NBoard/code/IHM_V1/#a9e51ac904e2
diff -r 9a6aff2af525 -r e8a6f4ab0fd5 IHM_V2.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IHM_V2.lib	Wed Jan 09 12:26:12 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/NBoard/code/IHM_V2/#ad91067e3f6d
diff -r 9a6aff2af525 -r e8a6f4ab0fd5 main.cpp
--- a/main.cpp	Sun Feb 11 09:05:16 2018 +0000
+++ b/main.cpp	Wed Jan 09 12:26:12 2019 +0000
@@ -1,6 +1,6 @@
 // Title: mbed-os-mail-5-Bytes-tx-rx
 // Author: Jacques-Olivier Klein - IUT de CACHAN
-// Date: 2018-02-10
+// Date: 2018-02-10 rev. 2019-01-06
 
 #include "mbed.h"
 #include "IHM.h"
@@ -32,15 +32,15 @@
 {   ihm.LCD_clear();
     ihm.LCD_printf("Mail-5B-tx-rx-%s %s",__DATE__,__TIME__);
     printf("\n\rmbed-os-mail-5-Bytes-tx-rx-%s %s\n\r",__DATE__,__TIME__);
-    printf("DEFAULT_STACK_SIZE:%d\n\r", DEFAULT_STACK_SIZE); 
+    printf("DEFAULT_STACK_SIZE:%d\n\r", OS_STACK_SIZE); 
 
     Thread_TxMail.start(TxMail); 
     Thread_RxMail.start(RxMail); 
       
     while(1){
-        Thread::wait(3000);  
+        wait(3.000);  
         L0=!L0;
-        printf("M     [pid-%d]Main \n\r",Thread::gettid());
+        printf("M     [pid-%d]Main \n\r",osThreadGetId());
     }
 }
 
@@ -55,10 +55,10 @@
             if (c=='}')c='!'; 
         }
         p_buffer->message[MY_MAIL_BUFFER_SIZE-1]=0;
-        printf("   T  [pid-%d]TxMail:<%s>\n\r",Thread::gettid(),p_buffer->message);
+        printf("   T  [pid-%d]TxMail:<%s>\n\r",osThreadGetId(),p_buffer->message);
         my_mail_box.put(p_buffer);
         L1 = ! L1;
-        Thread::wait(1000);
+        wait(2.000);
     }    
 }
 
@@ -71,6 +71,6 @@
         p_mail_buffer = (Mail_Buffer_T *)evt.value.p;      
         memcpy ( &local_buffer,p_mail_buffer, MY_MAIL_BUFFER_SIZE); 
         my_mail_box.free(p_mail_buffer);
-        printf("     R[pid-%d]RxMail:<%s>\n\r",Thread::gettid(),local_buffer.message);
+        printf("     R[pid-%d]RxMail:<%s>\n\r",osThreadGetId(),local_buffer.message);
     }    
 }
diff -r 9a6aff2af525 -r e8a6f4ab0fd5 mbed-os.lib
--- a/mbed-os.lib	Sun Feb 11 09:05:16 2018 +0000
+++ b/mbed-os.lib	Wed Jan 09 12:26:12 2019 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#bcf7085d85b2811b5d68bdda192c754eadfb8f88
+https://github.com/ARMmbed/mbed-os/#c966348d3f9ca80843be7cdc9b748f06ea73ced0
diff -r 9a6aff2af525 -r e8a6f4ab0fd5 readme.txt
--- a/readme.txt	Sun Feb 11 09:05:16 2018 +0000
+++ b/readme.txt	Wed Jan 09 12:26:12 2019 +0000
@@ -3,9 +3,12 @@
 Purpose: Simple application example with 2 threads 
 communicating 5-byte buffers through a Mail event-object. 
 Target: L432KC / Nboard (from IUT-Cachan)
-Tested: yes
+Tested: YES (2019-01-09)
 Author: Jacques-Olivier Klein - IUT de CACHAN
-Date: 2018-02-10
-DEFAULT_STACK_SIZE=2048
-Libraries: mbed-os rev2741:bcf7085(26feb-2017) + IHMV1 (from IUT-Cachan) rev4:a9e51ac
+Date: 2018-02-10 rev. 2019-01-09
+OS_STACK_SIZE=4096
+Libraries: mbed-os rev5345:c966348(03jan2019) + IHMV2 (from IUT-Cachan) rev6:ad91067
 
+2019-01-06 : update mbed-os, IHMV1->V2, Thread::wait(int ms)-> wait(float s), 
+ThreadGettid->osThreadGetId, DEFLAULT_STACK_SIZE -> OS_STACK_SIZE,
+L432KC Firmare update (ST-LINK) -> test OK. 
\ No newline at end of file