ce program est un test non fini
Dependencies: mbed BSP_DISCO_F746NG
main.cpp@2:3e54ffabcc47, 2020-11-18 (annotated)
- Committer:
- guillaume_m
- Date:
- Wed Nov 18 08:07:27 2020 +0000
- Revision:
- 2:3e54ffabcc47
azertyuiop
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
guillaume_m | 2:3e54ffabcc47 | 1 | #include "mbed.h" |
guillaume_m | 2:3e54ffabcc47 | 2 | #include "stm32746g_discovery_lcd.h" |
guillaume_m | 2:3e54ffabcc47 | 3 | #include "stm32746g_discovery_ts.h" |
guillaume_m | 2:3e54ffabcc47 | 4 | |
guillaume_m | 2:3e54ffabcc47 | 5 | |
guillaume_m | 2:3e54ffabcc47 | 6 | #include "header.h" |
guillaume_m | 2:3e54ffabcc47 | 7 | |
guillaume_m | 2:3e54ffabcc47 | 8 | int main(){ |
guillaume_m | 2:3e54ffabcc47 | 9 | uint8_t status; |
guillaume_m | 2:3e54ffabcc47 | 10 | |
guillaume_m | 2:3e54ffabcc47 | 11 | BSP_LCD_Init(); |
guillaume_m | 2:3e54ffabcc47 | 12 | BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS); |
guillaume_m | 2:3e54ffabcc47 | 13 | BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER); |
guillaume_m | 2:3e54ffabcc47 | 14 | status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize()); |
guillaume_m | 2:3e54ffabcc47 | 15 | if (status != TS_OK) { |
guillaume_m | 2:3e54ffabcc47 | 16 | BSP_LCD_Clear(LCD_COLOR_RED); |
guillaume_m | 2:3e54ffabcc47 | 17 | BSP_LCD_SetBackColor(LCD_COLOR_RED); |
guillaume_m | 2:3e54ffabcc47 | 18 | BSP_LCD_SetTextColor(LCD_COLOR_WHITE); |
guillaume_m | 2:3e54ffabcc47 | 19 | BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"TOUCHSCREEN INIT FAIL", CENTER_MODE); |
guillaume_m | 2:3e54ffabcc47 | 20 | } |
guillaume_m | 2:3e54ffabcc47 | 21 | else { |
guillaume_m | 2:3e54ffabcc47 | 22 | BSP_LCD_Clear(LCD_COLOR_BLACK); |
guillaume_m | 2:3e54ffabcc47 | 23 | BSP_LCD_SetBackColor(LCD_COLOR_BLACK); |
guillaume_m | 2:3e54ffabcc47 | 24 | int rejouer=0; |
guillaume_m | 2:3e54ffabcc47 | 25 | GRILLE G={0}; |
guillaume_m | 2:3e54ffabcc47 | 26 | GRILLE Gsomme={0}; |
guillaume_m | 2:3e54ffabcc47 | 27 | init_cellules(G); |
guillaume_m | 2:3e54ffabcc47 | 28 | partie(G,Gsomme); |
guillaume_m | 2:3e54ffabcc47 | 29 | rejouer = fin_de_partie(G,Gsomme); |
guillaume_m | 2:3e54ffabcc47 | 30 | if (rejouer==1){ |
guillaume_m | 2:3e54ffabcc47 | 31 | main(); |
guillaume_m | 2:3e54ffabcc47 | 32 | } |
guillaume_m | 2:3e54ffabcc47 | 33 | } |
guillaume_m | 2:3e54ffabcc47 | 34 | return 0; |
guillaume_m | 2:3e54ffabcc47 | 35 | } |
guillaume_m | 2:3e54ffabcc47 | 36 | |
guillaume_m | 2:3e54ffabcc47 | 37 |