SRAM demo using ST BSP driver.

Dependencies:   BSP_DISCO_L496AG

Files at this revision

API Documentation at this revision

Comitter:
Jerome Coutant
Date:
Fri Nov 22 16:06:21 2019 +0100
Parent:
2:3fbe5f24c51d
Commit message:
Update with CubeL4 V1.14.0

Changed in this revision

.hgignore Show annotated file Show diff for this revision Revisions of this file
BSP_DISCO_L496AG.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
mbed.bld Show diff for this revision Revisions of this file
diff -r 3fbe5f24c51d -r 727e0290bde8 .hgignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Fri Nov 22 16:06:21 2019 +0100
@@ -0,0 +1,2 @@
+BUILD
+mbed-os/
diff -r 3fbe5f24c51d -r 727e0290bde8 BSP_DISCO_L496AG.lib
--- a/BSP_DISCO_L496AG.lib	Wed Apr 18 08:50:07 2018 +0000
+++ b/BSP_DISCO_L496AG.lib	Fri Nov 22 16:06:21 2019 +0100
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST/code/BSP_DISCO_L496AG/#d83f1c8ca282
+https://developer.mbed.org/teams/ST/code/BSP_DISCO_L496AG/#106c7b82e064
diff -r 3fbe5f24c51d -r 727e0290bde8 main.cpp
--- a/main.cpp	Wed Apr 18 08:50:07 2018 +0000
+++ b/main.cpp	Fri Nov 22 16:06:21 2019 +0100
@@ -12,8 +12,6 @@
 __IO uint8_t  write_complete = 0;
 
 static void print_demo_title(void);
-static void print_PASS(void);
-static void print_FAIL(void);
 static void Fill_Buffer(uint16_t *pBuffer, uint32_t uwBufferLength, uint32_t uwOffset);
 static uint8_t Buffercmp(uint16_t* pBuffer1, uint16_t* pBuffer2, uint16_t BufferLength);
 
@@ -21,17 +19,16 @@
 {
     print_demo_title();
 
-    wait(0.2);
+    ThisThread::sleep_for(500);
 
     /*##-1- Configure the SRAM device ##########################################*/
     if (BSP_SRAM_Init() == SRAM_OK) {
         BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"SRAM INIT OK", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"SRAM INIT FAIL", LEFT_MODE);
-        print_FAIL();
     }
 
-    wait(0.2);
+    ThisThread::sleep_for(500);
 
     /*##-2- SRAM memory read/write access ######################################*/
 
@@ -45,31 +42,25 @@
         BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"SRAM WRITE OK", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"SRAM WRITE FAIL", LEFT_MODE);
-        print_FAIL();
     }
 
-    wait(0.2);
+    ThisThread::sleep_for(500);
 
     /* Read back data from the SRAM memory */
     if (BSP_SRAM_ReadData(SRAM_DEVICE_ADDR + SRAM_WRITE_READ_ADDR, sram_aRxBuffer, BUFFER_SIZE) == SRAM_OK) {
         BSP_LCD_DisplayStringAt(0, LINE(7), (uint8_t *)"SRAM READ OK", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(0, LINE(7), (uint8_t *)"SRAM READ FAIL", LEFT_MODE);
-        print_FAIL();
     }
 
-    wait(0.2);
+    ThisThread::sleep_for(1000);
 
     /* Check read data */
     if (Buffercmp(sram_aRxBuffer, sram_aTxBuffer, BUFFER_SIZE) == 0) {
         BSP_LCD_DisplayStringAt(0, LINE(8), (uint8_t *)"SRAM COMPARE OK", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(0, LINE(8), (uint8_t *)"SRAM COMPARE FAIL", LEFT_MODE);
-        print_FAIL();
     }
-
-    wait(0.2);
-    print_PASS();
 }
 
 static void print_demo_title(void)
@@ -90,20 +81,6 @@
     BSP_LCD_SetFont(&Font20);
 }
 
-static void print_PASS(void)
-{
-    BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
-    BSP_LCD_SetBackColor(LCD_COLOR_GREEN);
-    BSP_LCD_DisplayStringAt(0, LINE(10), (uint8_t *)"Demo OK", CENTER_MODE);
-    while(1);
-}
-
-static void print_FAIL(void)
-{
-    BSP_LCD_SetBackColor(LCD_COLOR_RED);
-    BSP_LCD_DisplayStringAt(0, LINE(10), (uint8_t *)"Demo FAILED", CENTER_MODE);
-    while(1);
-}
 
 /**
   * @brief  Fills buffer with user predefined data.
diff -r 3fbe5f24c51d -r 727e0290bde8 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Nov 22 16:06:21 2019 +0100
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#9dc0c3737eb2454184ee376f0fe8cc538b5a2ad0
diff -r 3fbe5f24c51d -r 727e0290bde8 mbed.bld
--- a/mbed.bld	Wed Apr 18 08:50:07 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file