diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-10-29 01:12:42 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-10-29 01:12:42 +1000 |
commit | ab4091b366009209928cfa392b04c590ed50196c (patch) | |
tree | 0f7d5a73ecc996284c00b60b8c08dd591cc3c634 /boards/base/Mikromedia-STM32-M4-ILI9341 | |
parent | ffee80299d616f1b634eacb514fcd7b3e4dc1a02 (diff) | |
download | uGFX-ab4091b366009209928cfa392b04c590ed50196c.tar.gz uGFX-ab4091b366009209928cfa392b04c590ed50196c.tar.bz2 uGFX-ab4091b366009209928cfa392b04c590ed50196c.zip |
Updates for the Mikrmedia STM32 M4 board
Diffstat (limited to 'boards/base/Mikromedia-STM32-M4-ILI9341')
4 files changed, 10 insertions, 18 deletions
diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c index 1965ba35..a27a3db5 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c @@ -70,7 +70,6 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) { sector_read_cmd[1] = (address >> 16) & 0xFF; sector_read_cmd[2] = (address >> 8) & 0xFF; sector_read_cmd[3] = address & 0xFF; - uint8_t dummy[1]; spiAcquireBus(&SPID3); spiStart(&SPID3, &flash_spicfg); @@ -81,7 +80,7 @@ void flash_read(uint32_t address, size_t bytes, uint8_t *out) { spiReleaseBus(&SPID3); } -void flash_write(uint32_t address, size_t bytes, uint8_t *data) { +void flash_write(uint32_t address, size_t bytes, const uint8_t *data) { static uint8_t flash_write_cmd[4]; flash_write_enable(); @@ -90,7 +89,6 @@ void flash_write(uint32_t address, size_t bytes, uint8_t *data) { flash_write_cmd[1] = (address >> 16) & 0xFF; flash_write_cmd[2] = (address >> 8) & 0xFF; flash_write_cmd[3] = address & 0xFF; - uint8_t dummy[1]; spiAcquireBus(&SPID3); spiStart(&SPID3, &flash_spicfg); @@ -112,14 +110,18 @@ bool flash_tp_calibrated(void) { } void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz) { + if (instance) return; flash_sector_erase(0x0F0000); uint8_t calibrated = 0x01; flash_write(0x0F0000, 1, &calibrated); flash_write(0x0F0001, sz, calbuf); } const char *flash_tp_calibration_load(uint16_t instance) { - static char foo[24]; + static uint8_t foo[24]; + + if (instance) return 0; + if (!flash_tp_calibrated()) return 0; flash_read(0x0F0001, 24, foo); - return foo; -}
\ No newline at end of file + return (char *)foo; +} diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h index 5be7523f..2dcc9206 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.h @@ -1,6 +1,6 @@ void flash_sector_erase(uint32_t sector); void flash_read(uint32_t address, size_t bytes, uint8_t *out); -void flash_write(uint32_t address, size_t bytes, uint8_t *data); +void flash_write(uint32_t address, size_t bytes, const uint8_t *data); bool flash_tp_calibrated(void); void flash_tp_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz); -const char *flash_tp_calibration_load(uint16_t instance);
\ No newline at end of file +const char *flash_tp_calibration_load(uint16_t instance); diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h b/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h index ec7292eb..c73c68a9 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/board_ILI9341.h @@ -36,14 +36,6 @@ static inline void init_board(GDisplay *g) { SET_RD; SET_WR; CLR_CS; - - /* Hardware reset */ - palSetPad(GPIOE, GPIOE_LCD_RST); - chThdSleepMilliseconds(100); - palClearPad(GPIOE, GPIOE_LCD_RST); - chThdSleepMilliseconds(100); - palSetPad(GPIOE, GPIOE_LCD_RST); - chThdSleepMilliseconds(100); break; } } diff --git a/boards/base/Mikromedia-STM32-M4-ILI9341/readme.txt b/boards/base/Mikromedia-STM32-M4-ILI9341/readme.txt index 79b430d2..961f9793 100644 --- a/boards/base/Mikromedia-STM32-M4-ILI9341/readme.txt +++ b/boards/base/Mikromedia-STM32-M4-ILI9341/readme.txt @@ -12,5 +12,3 @@ As this is not a standard ChibiOS supported board the necessary board files have been provided in the ChibiOS_Board directory. There is an example Makefile and project in the examples directory. - -Note: The video driver currently has bugs!
\ No newline at end of file |