From 0c3fc6cc782a9c37568af41e4f1a7db8cb807e92 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Fri, 22 Jan 2016 22:34:31 +0100 Subject: [PATCH] enable -std=gnu11 for platform dir --- app/include/driver/spi.h | 4 ++-- app/include/driver/spi_master.h | 13 ------------- app/platform/Makefile | 2 ++ app/platform/flash_api.c | 7 ------- app/platform/flash_api.h | 1 - app/platform/platform.c | 4 ++++ 6 files changed, 8 insertions(+), 23 deletions(-) delete mode 100644 app/include/driver/spi_master.h diff --git a/app/include/driver/spi.h b/app/include/driver/spi.h index 04ae1fe6..98914a1f 100644 --- a/app/include/driver/spi.h +++ b/app/include/driver/spi.h @@ -20,9 +20,9 @@ void spi_lcd_9bit_write(uint8 spi_no,uint8 high_bit,uint8 low_8bit); //spi master init funtion void spi_master_init(uint8 spi_no, unsigned cpol, unsigned cpha, uint32_t clock_div); // fill MOSI buffer -void spi_set_mosi(uint8 spi_no, uint8 offset, uint8 bitlen, uint32 data); +void spi_mast_set_mosi(uint8 spi_no, uint8 offset, uint8 bitlen, uint32 data); // retrieve data from MISO buffer -uint32 spi_get_miso(uint8 spi_no, uint8 offset, uint8 bitlen); +uint32 spi_mast_get_miso(uint8 spi_no, uint8 offset, uint8 bitlen); // initiate SPI transaction void spi_mast_transaction(uint8 spi_no, uint8 cmd_bitlen, uint16 cmd_data, uint8 addr_bitlen, uint32 addr_data, uint16 mosi_bitlen, uint8 dummy_bitlen, sint16 miso_bitlen); diff --git a/app/include/driver/spi_master.h b/app/include/driver/spi_master.h deleted file mode 100644 index ad33e8b9..00000000 --- a/app/include/driver/spi_master.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __SPI_MASTER_H__ -#define __SPI_MASTER_H__ - -#include "driver/spi_register.h" - -/*SPI number define*/ -#define SPI 0 -#define HSPI 1 - -void spi_master_init(uint8 spi_no); -void spi_master_9bit_write(uint8 spi_no, uint8 high_bit, uint8 low_8bit); - -#endif diff --git a/app/platform/Makefile b/app/platform/Makefile index 8a6dd55f..ed3f35e9 100644 --- a/app/platform/Makefile +++ b/app/platform/Makefile @@ -15,6 +15,8 @@ ifndef PDIR GEN_LIBS = libplatform.a endif +STD_CFLAGS=-std=gnu11 -Wimplicit + ############################################################# # Configuration i.e. compile options etc. # Target specific stuff (defines etc.) goes in here! diff --git a/app/platform/flash_api.c b/app/platform/flash_api.c index 112a8163..a7615cab 100644 --- a/app/platform/flash_api.c +++ b/app/platform/flash_api.c @@ -376,13 +376,6 @@ bool flash_init_data_blank(void) return result ; } -bool flash_self_destruct(void) -{ - // Dangerous, Erase your flash. Good bye! - SPIEraseChip(); - return true; -} - uint8_t byte_of_aligned_array(const uint8_t *aligned_array, uint32_t index) { if ( (((uint32_t)aligned_array) % 4) != 0 ) diff --git a/app/platform/flash_api.h b/app/platform/flash_api.h index b801b096..32475361 100644 --- a/app/platform/flash_api.h +++ b/app/platform/flash_api.h @@ -103,7 +103,6 @@ uint32_t flash_rom_get_speed(void); bool flash_init_data_written(void); bool flash_init_data_default(void); bool flash_init_data_blank(void); -bool flash_self_destruct(void); uint8_t byte_of_aligned_array(const uint8_t* aligned_array, uint32_t index); uint16_t word_of_aligned_array(const uint16_t *aligned_array, uint32_t index); // uint8_t flash_rom_get_checksum(void); diff --git a/app/platform/platform.c b/app/platform/platform.c index 5a3eed7d..1b06f7d6 100755 --- a/app/platform/platform.c +++ b/app/platform/platform.c @@ -1,12 +1,16 @@ // Platform-dependent functions #include "platform.h" +#include "common.h" #include "c_stdio.h" #include "c_string.h" #include "c_stdlib.h" #include "gpio.h" #include "user_interface.h" #include "driver/uart.h" +#include "driver/gpio16.h" +#include "driver/i2c_master.h" +#include "driver/spi.h" // Platform specific includes static void pwms_init();