cpu nrf51: fix pedantic compiler warnings
Make compiler doesn't complain about unused variables and unnamed unions.
This commit is contained in:
parent
f24e810de5
commit
e88ebc1c84
@ -1077,7 +1077,7 @@ typedef struct { /*!< NVMC Structure
|
|||||||
union {
|
union {
|
||||||
__IO uint32_t ERASEPCR1; /*!< Register for erasing a non-protected non-volatile memory page. */
|
__IO uint32_t ERASEPCR1; /*!< Register for erasing a non-protected non-volatile memory page. */
|
||||||
__IO uint32_t ERASEPAGE; /*!< Register for erasing a non-protected non-volatile memory page. */
|
__IO uint32_t ERASEPAGE; /*!< Register for erasing a non-protected non-volatile memory page. */
|
||||||
};
|
} nrf51_unnamed1;
|
||||||
__IO uint32_t ERASEALL; /*!< Register for erasing all non-volatile user memory. */
|
__IO uint32_t ERASEALL; /*!< Register for erasing all non-volatile user memory. */
|
||||||
__IO uint32_t ERASEPCR0; /*!< Register for erasing a protected non-volatile memory page. */
|
__IO uint32_t ERASEPCR0; /*!< Register for erasing a protected non-volatile memory page. */
|
||||||
__IO uint32_t ERASEUICR; /*!< Register for start erasing User Information Congfiguration Registers. */
|
__IO uint32_t ERASEUICR; /*!< Register for start erasing User Information Congfiguration Registers. */
|
||||||
@ -1130,7 +1130,7 @@ typedef struct { /*!< FICR Structure
|
|||||||
kept for backward compatinility purposes. Use SIZERAMBLOCKS
|
kept for backward compatinility purposes. Use SIZERAMBLOCKS
|
||||||
instead. */
|
instead. */
|
||||||
__I uint32_t SIZERAMBLOCKS; /*!< Size of RAM blocks in bytes. */
|
__I uint32_t SIZERAMBLOCKS; /*!< Size of RAM blocks in bytes. */
|
||||||
};
|
} nrf51_unnamed2;
|
||||||
__I uint32_t RESERVED3[5];
|
__I uint32_t RESERVED3[5];
|
||||||
__I uint32_t CONFIGID; /*!< Configuration identifier. */
|
__I uint32_t CONFIGID; /*!< Configuration identifier. */
|
||||||
__I uint32_t DEVICEID[2]; /*!< Device identifier. */
|
__I uint32_t DEVICEID[2]; /*!< Device identifier. */
|
||||||
@ -1167,7 +1167,7 @@ typedef struct { /*!< UICR Structure
|
|||||||
union {
|
union {
|
||||||
__IO uint32_t NRFFW[15]; /*!< Reserved for Nordic firmware design. */
|
__IO uint32_t NRFFW[15]; /*!< Reserved for Nordic firmware design. */
|
||||||
__IO uint32_t BOOTLOADERADDR; /*!< Bootloader start address. */
|
__IO uint32_t BOOTLOADERADDR; /*!< Bootloader start address. */
|
||||||
};
|
} nrf51_unnamed3;
|
||||||
__IO uint32_t NRFHW[12]; /*!< Reserved for Nordic hardware design. */
|
__IO uint32_t NRFHW[12]; /*!< Reserved for Nordic hardware design. */
|
||||||
__IO uint32_t CUSTOMER[32]; /*!< Reserved for customer. */
|
__IO uint32_t CUSTOMER[32]; /*!< Reserved for customer. */
|
||||||
} NRF_UICR_Type;
|
} NRF_UICR_Type;
|
||||||
|
|||||||
@ -127,6 +127,7 @@ int adc_map(adc_t dev, int value, int min, int max)
|
|||||||
|
|
||||||
float adc_mapf(adc_t dev, int value, float min, float max)
|
float adc_mapf(adc_t dev, int value, float min, float max)
|
||||||
{
|
{
|
||||||
|
(void) dev;
|
||||||
return ((max - min) / ((float)adc_max_value)) * value;
|
return ((max - min) / ((float)adc_max_value)) * value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,11 +78,13 @@ int gpio_init_int(gpio_t pin, gpio_pp_t pullup, gpio_flank_t flank,
|
|||||||
|
|
||||||
void gpio_irq_enable(gpio_t pin)
|
void gpio_irq_enable(gpio_t pin)
|
||||||
{
|
{
|
||||||
|
(void) pin;
|
||||||
NRF_GPIOTE->INTENSET |= GPIOTE_INTENSET_IN0_Msk;
|
NRF_GPIOTE->INTENSET |= GPIOTE_INTENSET_IN0_Msk;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio_irq_disable(gpio_t dev)
|
void gpio_irq_disable(gpio_t dev)
|
||||||
{
|
{
|
||||||
|
(void) dev;
|
||||||
NRF_GPIOTE->INTENCLR |= GPIOTE_INTENSET_IN0_Msk;
|
NRF_GPIOTE->INTENCLR |= GPIOTE_INTENSET_IN0_Msk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -123,6 +123,9 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
|
|||||||
|
|
||||||
int spi_init_slave(spi_t dev, spi_conf_t conf, char (*cb)(char data))
|
int spi_init_slave(spi_t dev, spi_conf_t conf, char (*cb)(char data))
|
||||||
{
|
{
|
||||||
|
(void) dev;
|
||||||
|
(void) conf;
|
||||||
|
(void) cb;
|
||||||
/* This API is incompatible with nRF51 SPIS */
|
/* This API is incompatible with nRF51 SPIS */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -189,7 +192,7 @@ int spi_transfer_bytes(spi_t dev, char *out, char *in, unsigned int length)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < length; i++) {
|
for (unsigned i = 0; i < length; i++) {
|
||||||
char tmp = (out) ? out[i] : 0;
|
char tmp = (out) ? out[i] : 0;
|
||||||
spi[dev]->EVENTS_READY = 0;
|
spi[dev]->EVENTS_READY = 0;
|
||||||
spi[dev]->TXD = (uint8_t)tmp;
|
spi[dev]->TXD = (uint8_t)tmp;
|
||||||
@ -217,6 +220,8 @@ int spi_transfer_regs(spi_t dev, uint8_t reg, char *out, char *in, unsigned int
|
|||||||
|
|
||||||
void spi_transmission_begin(spi_t dev, char reset_val)
|
void spi_transmission_begin(spi_t dev, char reset_val)
|
||||||
{
|
{
|
||||||
|
(void) dev;
|
||||||
|
(void) reset_val;
|
||||||
/* spi slave is not implemented */
|
/* spi slave is not implemented */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user