Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG
Revision 0:96b25ebf5df8, committed 2020-12-16
- Comitter:
- iliatumash
- Date:
- Wed Dec 16 21:18:17 2020 +0000
- Commit message:
- Semafor
Changed in this revision
diff -r 000000000000 -r 96b25ebf5df8 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Wed Dec 16 21:18:17 2020 +0000 @@ -0,0 +1,2 @@ +BUILD +mbed-os/
diff -r 000000000000 -r 96b25ebf5df8 BSP_DISCO_F746NG.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BSP_DISCO_F746NG.lib Wed Dec 16 21:18:17 2020 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/teams/ST/code/BSP_DISCO_F746NG/#85dbcff443aa
diff -r 000000000000 -r 96b25ebf5df8 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Dec 16 21:18:17 2020 +0000
@@ -0,0 +1,84 @@
+#include "mbed.h"
+#include "stm32746g_discovery_lcd.h"
+#include "stm32746g_discovery_ts.h"
+#include <Semaphore.h>
+
+
+Semaphore semafor(1);
+Thread thread0, thread1, thread2;
+bool touch = false;
+
+void test_thread0()
+{
+ while (true) {
+ semafor.acquire();
+ BSP_LCD_Clear(LCD_COLOR_DARKBLUE);
+ BSP_LCD_SetBackColor(LCD_COLOR_DARKBLUE);
+ BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
+ BSP_LCD_DisplayStringAt(0, 50, (uint8_t *)"Jsem vlakno 1", CENTER_MODE);
+ BSP_LCD_DisplayStringAt(0, 80, (uint8_t *)"Stiskni displej", CENTER_MODE);
+ }
+}
+
+void test_thread1()
+{
+ while (true) {
+ semafor.acquire();
+ BSP_LCD_Clear(LCD_COLOR_BLUE);
+ BSP_LCD_SetBackColor(LCD_COLOR_BLUE);
+ BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
+ BSP_LCD_DisplayStringAt(0, 50, (uint8_t *)"Jsem vlakno 2", CENTER_MODE);
+ BSP_LCD_DisplayStringAt(0, 80, (uint8_t *)"Stiskni displej", CENTER_MODE);
+ }
+}
+
+void test_thread2()
+{
+ while (true) {
+ semafor.acquire();
+ BSP_LCD_Clear(LCD_COLOR_LIGHTBLUE);
+ BSP_LCD_SetBackColor(LCD_COLOR_LIGHTBLUE);
+ BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
+ BSP_LCD_DisplayStringAt(0, 50, (uint8_t *)"Jsem vlakno 3", CENTER_MODE);
+ BSP_LCD_DisplayStringAt(0, 80, (uint8_t *)"Stiskni displej", CENTER_MODE);
+ }
+}
+
+void display(){
+ BSP_LCD_Init();
+ BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS);
+ BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER);
+ BSP_LCD_Clear(LCD_COLOR_DARKBLUE);
+ BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
+ BSP_LCD_SetBackColor(LCD_COLOR_BLUE);
+ BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
+}
+
+ void touchScreen(){
+ TS_StateTypeDef TS_State;
+ uint8_t status;
+ status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
+ while(1) {
+ BSP_TS_GetState(&TS_State);
+ if (TS_State.touchDetected) {
+ if(!touch) {
+ touch = true;
+ semafor.release();
+ }
+ }else{
+ touch = false;
+ }
+ }
+}
+
+
+int main(){
+ display();
+ thread0.start(test_thread0);
+ thread1.start(test_thread1);
+ thread2.start(test_thread2);
+ touchScreen();
+ while(1){
+
+ }
+}
diff -r 000000000000 -r 96b25ebf5df8 mbed-os.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Wed Dec 16 21:18:17 2020 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#699372421a3b388fe568e9be85b1a985749a438f