diff options
| author | Bdale Garbee <bdale@gag.com> | 2014-01-22 20:55:41 -0700 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2014-01-22 20:55:41 -0700 |
| commit | 9884ca1449167a06bd2cebc7d28353eeac592493 (patch) | |
| tree | 9fde328b3a5971c67954e669c1ba27042821fd8c /src/stm | |
| parent | 8e669694a60d34e2ea0f8f6b189e0bc3605d94d7 (diff) | |
| parent | 0ef0c50536e5eb6ad3455b5828983307edbab828 (diff) | |
Merge branch 'branch-1.3' into debian
Diffstat (limited to 'src/stm')
| -rw-r--r-- | src/stm/Makefile.defs | 5 | ||||
| -rw-r--r-- | src/stm/ao_adc_stm.c | 5 | ||||
| -rw-r--r-- | src/stm/ao_arch.h | 3 | ||||
| -rw-r--r-- | src/stm/ao_exti_stm.c | 5 | ||||
| -rw-r--r-- | src/stm/ao_i2c_stm.c | 6 | ||||
| -rw-r--r-- | src/stm/ao_lcd_stm.c | 3 | ||||
| -rw-r--r-- | src/stm/ao_profile.h | 2 | ||||
| -rw-r--r-- | src/stm/ao_spi_stm_slave.c | 2 | ||||
| -rw-r--r-- | src/stm/ao_usb_stm.c | 4 | ||||
| -rw-r--r-- | src/stm/stm32l.h | 6 |
10 files changed, 22 insertions, 19 deletions
diff --git a/src/stm/Makefile.defs b/src/stm/Makefile.defs index 9adcfeb3..42adfd09 100644 --- a/src/stm/Makefile.defs +++ b/src/stm/Makefile.defs @@ -24,8 +24,11 @@ include $(TOPDIR)/Makedefs CC=$(ARM_CC) LIBS=$(PDCLIB_LIBS_M3) -lgcc +WARN_FLAGS=-Wall -Wextra -Werror + AO_CFLAGS=-I. -I../stm -I../core -I../drivers -I../math -I.. $(PDCLIB_INCLUDES) -STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) +STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb \ + -ffreestanding -nostdlib $(AO_CFLAGS) $(WARN_FLAGS) LDFLAGS=-L../stm -Wl,-Taltos.ld diff --git a/src/stm/ao_adc_stm.c b/src/stm/ao_adc_stm.c index 53f19b40..53d4b8c3 100644 --- a/src/stm/ao_adc_stm.c +++ b/src/stm/ao_adc_stm.c @@ -41,6 +41,7 @@ static uint8_t ao_adc_ready; */ static void ao_adc_done(int index) { + (void) index; AO_DATA_PRESENT(AO_DATA_ADC); ao_dma_done_transfer(STM_DMA_INDEX(STM_DMA_CHANNEL_ADC1)); if (ao_data_present == AO_DATA_ALL) { @@ -109,8 +110,10 @@ static void ao_adc_dump(void) __reentrant { struct ao_data packet; - int16_t *d; +#ifndef AO_ADC_DUMP uint8_t i; + int16_t *d; +#endif ao_data_get(&packet); #ifdef AO_ADC_DUMP diff --git a/src/stm/ao_arch.h b/src/stm/ao_arch.h index 42fe727a..76fa9194 100644 --- a/src/stm/ao_arch.h +++ b/src/stm/ao_arch.h @@ -135,6 +135,9 @@ extern const uint32_t ao_radio_cal; void ao_adc_init(); +/* ADC maximum reported value */ +#define AO_ADC_MAX 4095 + #define AO_BOOT_APPLICATION_BASE ((uint32_t *) 0x08001000) #define AO_BOOT_LOADER_BASE ((uint32_t *) 0x0) #define HAS_BOOT_LOADER 1 diff --git a/src/stm/ao_exti_stm.c b/src/stm/ao_exti_stm.c index c1dcdf85..35958cf8 100644 --- a/src/stm/ao_exti_stm.c +++ b/src/stm/ao_exti_stm.c @@ -119,6 +119,8 @@ ao_exti_setup (struct stm_gpio *gpio, uint8_t pin, uint8_t mode, void (*callback void ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode) { + (void) gpio; + uint32_t mask = 1 << pin; if (mode & AO_EXTI_MODE_RISING) @@ -133,12 +135,14 @@ ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode) { void ao_exti_set_callback(struct stm_gpio *gpio, uint8_t pin, void (*callback)()) { + (void) gpio; ao_exti_callback[pin] = callback; } void ao_exti_enable(struct stm_gpio *gpio, uint8_t pin) { uint32_t mask = (1 << pin); + (void) gpio; stm_exti.pr = mask; stm_exti.imr |= (1 << pin); } @@ -146,6 +150,7 @@ ao_exti_enable(struct stm_gpio *gpio, uint8_t pin) { void ao_exti_disable(struct stm_gpio *gpio, uint8_t pin) { uint32_t mask = (1 << pin); + (void) gpio; stm_exti.imr &= ~mask; stm_exti.pr = mask; } diff --git a/src/stm/ao_i2c_stm.c b/src/stm/ao_i2c_stm.c index 809b5c6f..1c90cdb8 100644 --- a/src/stm/ao_i2c_stm.c +++ b/src/stm/ao_i2c_stm.c @@ -185,7 +185,6 @@ uint8_t ao_i2c_start(uint8_t index, uint16_t addr) { struct stm_i2c *stm_i2c = ao_i2c_stm_info[index].stm_i2c; - uint32_t sr1, sr2; int t; ao_i2c_state[index] = I2C_IDLE; @@ -239,10 +238,7 @@ uint8_t ao_i2c_send(void *block, uint16_t len, uint8_t index, uint8_t stop) { struct stm_i2c *stm_i2c = ao_i2c_stm_info[index].stm_i2c; - uint8_t *b = block; - uint32_t sr1; uint8_t tx_dma_index = ao_i2c_stm_info[index].tx_dma_index; - int t; /* Clear any pending ADDR bit */ (void) stm_i2c->sr2; @@ -304,8 +300,6 @@ uint8_t ao_i2c_recv(void *block, uint16_t len, uint8_t index, uint8_t stop) { struct stm_i2c *stm_i2c = ao_i2c_stm_info[index].stm_i2c; - uint8_t *b = block; - int t; uint8_t ret = TRUE; if (len == 0) diff --git a/src/stm/ao_lcd_stm.c b/src/stm/ao_lcd_stm.c index 47ea374e..95af53d1 100644 --- a/src/stm/ao_lcd_stm.c +++ b/src/stm/ao_lcd_stm.c @@ -346,8 +346,7 @@ static const struct ao_cmds ao_lcd_stm_cmds[] = { void ao_lcd_stm_init(void) { - int s, c; - int r; + unsigned int s, c; uint32_t csr; stm_rcc.ahbenr |= ((AO_LCD_STM_USES_GPIOA << STM_RCC_AHBENR_GPIOAEN) | diff --git a/src/stm/ao_profile.h b/src/stm/ao_profile.h index f7dd029d..f8a0c25e 100644 --- a/src/stm/ao_profile.h +++ b/src/stm/ao_profile.h @@ -20,7 +20,7 @@ void ao_profile_init(); -static uint32_t inline ao_profile_tick(void) { +static inline uint32_t ao_profile_tick(void) { uint16_t hi, lo, second_hi; do { diff --git a/src/stm/ao_spi_stm_slave.c b/src/stm/ao_spi_stm_slave.c index 98022442..962ff2c6 100644 --- a/src/stm/ao_spi_stm_slave.c +++ b/src/stm/ao_spi_stm_slave.c @@ -97,7 +97,6 @@ ao_spi_slave_send(void *block, uint16_t len) ao_dma_done_transfer(miso_dma_index); } - uint8_t ao_spi_slave_recv(void *block, uint16_t len) { @@ -153,6 +152,7 @@ ao_spi_slave_recv(void *block, uint16_t len) ao_dma_done_transfer(mosi_dma_index); ao_dma_done_transfer(miso_dma_index); + return 1; } static void diff --git a/src/stm/ao_usb_stm.c b/src/stm/ao_usb_stm.c index 28a9f9f3..27b82357 100644 --- a/src/stm/ao_usb_stm.c +++ b/src/stm/ao_usb_stm.c @@ -119,7 +119,6 @@ static uint8_t ao_usb_in_pending; static uint8_t ao_usb_out_avail; static uint8_t ao_usb_running; static uint8_t ao_usb_configuration; -static uint8_t ueienx_0; #define AO_USB_EP0_GOT_RESET 1 #define AO_USB_EP0_GOT_SETUP 2 @@ -313,7 +312,6 @@ ao_usb_init_ep(uint8_t ep, uint32_t addr, uint32_t type, uint32_t stat_rx, uint3 static void ao_usb_set_ep0(void) { - uint32_t epr; int e; ao_usb_sram_addr = 0; @@ -356,8 +354,6 @@ ao_usb_set_ep0(void) static void ao_usb_set_configuration(void) { - uint32_t epr; - debug ("ao_usb_set_configuration\n"); /* Set up the INT end point */ diff --git a/src/stm/stm32l.h b/src/stm/stm32l.h index ff3f5336..302f4d24 100644 --- a/src/stm/stm32l.h +++ b/src/stm/stm32l.h @@ -52,7 +52,7 @@ stm_moder_set(struct stm_gpio *gpio, int pin, vuint32_t value) { value << STM_MODER_SHIFT(pin)); } -static inline vuint32_t +static inline uint32_t stm_moder_get(struct stm_gpio *gpio, int pin) { return (gpio->moder >> STM_MODER_SHIFT(pin)) & STM_MODER_MASK; } @@ -69,7 +69,7 @@ stm_otyper_set(struct stm_gpio *gpio, int pin, vuint32_t value) { value << STM_OTYPER_SHIFT(pin)); } -static inline vuint32_t +static inline uint32_t stm_otyper_get(struct stm_gpio *gpio, int pin) { return (gpio->otyper >> STM_OTYPER_SHIFT(pin)) & STM_OTYPER_MASK; } @@ -88,7 +88,7 @@ stm_ospeedr_set(struct stm_gpio *gpio, int pin, vuint32_t value) { value << STM_OSPEEDR_SHIFT(pin)); } -static inline vuint32_t +static inline uint32_t stm_ospeedr_get(struct stm_gpio *gpio, int pin) { return (gpio->ospeedr >> STM_OSPEEDR_SHIFT(pin)) & STM_OSPEEDR_MASK; } |
