Merge pull request #965 from devsaurus/platform-gnu11

Enable -std=gnu11 for platform and driver dir.
This commit is contained in:
Johny Mattsson 2016-01-24 01:23:27 +11:00
commit 91b2533aa6
9 changed files with 15 additions and 23 deletions

View File

@ -15,6 +15,7 @@ ifndef PDIR
GEN_LIBS = libdriver.a
endif
STD_CFLAGS=-std=gnu11 -Wimplicit
#############################################################
# Configuration i.e. compile options etc.

View File

@ -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);

View File

@ -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

View File

@ -140,4 +140,7 @@ void Cache_Read_Disable(void);
void ets_intr_lock(void);
void ets_intr_unlock(void);
void ets_install_putc1(void *routine);
void uart_div_modify(int no, unsigned int freq);
#endif

View File

@ -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!

View File

@ -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 )

View File

@ -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);

View File

@ -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();

View File

@ -4,6 +4,9 @@
#include "rom.h"
void ets_timer_arm_new (ETSTimer *a, int b, int c, int isMstimer);
int os_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
#include_next "osapi.h"
#endif