mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-09 23:54:32 +00:00
Rename select() in various sensortag sensor drivers
This is to prevent a compile error caused by function prototype conflict between a function called `select()` (present in a number of sensortag peripheral drivers) and the one in `sys/select.h`. The error manifests itself with gcc-arm-embedded version 5.2.1 20151202 (2015-q4). To fix the error we simply rename our function. Fixes #1434
This commit is contained in:
parent
ab59a387b3
commit
6933b35bb5
@ -148,7 +148,7 @@ notify_ready(void *not_used)
|
|||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
select(void)
|
select_on_bus(void)
|
||||||
{
|
{
|
||||||
/* Set up I2C */
|
/* Set up I2C */
|
||||||
board_i2c_select(BOARD_I2C_INTERFACE_0, BMP280_I2C_ADDRESS);
|
board_i2c_select(BOARD_I2C_INTERFACE_0, BMP280_I2C_ADDRESS);
|
||||||
@ -162,7 +162,7 @@ init(void)
|
|||||||
{
|
{
|
||||||
uint8_t val;
|
uint8_t val;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
/* Read and store calibration data */
|
/* Read and store calibration data */
|
||||||
sensor_common_read_reg(ADDR_CALIB, calibration_data, CALIB_DATA_SIZE);
|
sensor_common_read_reg(ADDR_CALIB, calibration_data, CALIB_DATA_SIZE);
|
||||||
@ -183,7 +183,7 @@ enable_sensor(bool enable)
|
|||||||
{
|
{
|
||||||
uint8_t val;
|
uint8_t val;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
if(enable) {
|
if(enable) {
|
||||||
/* Enable forced mode */
|
/* Enable forced mode */
|
||||||
@ -205,7 +205,7 @@ read_data(uint8_t *data)
|
|||||||
{
|
{
|
||||||
bool success;
|
bool success;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
success = sensor_common_read_reg(ADDR_PRESS_MSB, data, MEAS_DATA_SIZE);
|
success = sensor_common_read_reg(ADDR_PRESS_MSB, data, MEAS_DATA_SIZE);
|
||||||
if(!success) {
|
if(!success) {
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
* Clear external flash CSN line
|
* Clear external flash CSN line
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
select(void)
|
select_on_bus(void)
|
||||||
{
|
{
|
||||||
ti_lib_gpio_pin_write(BOARD_FLASH_CS, 0);
|
ti_lib_gpio_pin_write(BOARD_FLASH_CS, 0);
|
||||||
}
|
}
|
||||||
@ -110,7 +110,7 @@ wait_ready(void)
|
|||||||
bool ret;
|
bool ret;
|
||||||
const uint8_t wbuf[1] = { BLS_CODE_READ_STATUS };
|
const uint8_t wbuf[1] = { BLS_CODE_READ_STATUS };
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
/* Throw away all garbages */
|
/* Throw away all garbages */
|
||||||
board_spi_flush();
|
board_spi_flush();
|
||||||
@ -159,7 +159,7 @@ verify_part(void)
|
|||||||
uint8_t rbuf[2] = {0, 0};
|
uint8_t rbuf[2] = {0, 0};
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
ret = board_spi_write(wbuf, sizeof(wbuf));
|
ret = board_spi_write(wbuf, sizeof(wbuf));
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ power_down(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd = BLS_CODE_PD;
|
cmd = BLS_CODE_PD;
|
||||||
select();
|
select_on_bus();
|
||||||
board_spi_write(&cmd, sizeof(cmd));
|
board_spi_write(&cmd, sizeof(cmd));
|
||||||
deselect();
|
deselect();
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ power_standby(void)
|
|||||||
bool success;
|
bool success;
|
||||||
|
|
||||||
cmd = BLS_CODE_RPD;
|
cmd = BLS_CODE_RPD;
|
||||||
select();
|
select_on_bus();
|
||||||
success = board_spi_write(&cmd, sizeof(cmd));
|
success = board_spi_write(&cmd, sizeof(cmd));
|
||||||
|
|
||||||
if(success) {
|
if(success) {
|
||||||
@ -249,7 +249,7 @@ write_enable(void)
|
|||||||
bool ret;
|
bool ret;
|
||||||
const uint8_t wbuf[] = { BLS_CODE_WRITE_ENABLE };
|
const uint8_t wbuf[] = { BLS_CODE_WRITE_ENABLE };
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
ret = board_spi_write(wbuf, sizeof(wbuf));
|
ret = board_spi_write(wbuf, sizeof(wbuf));
|
||||||
deselect();
|
deselect();
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ ext_flash_read(size_t offset, size_t length, uint8_t *buf)
|
|||||||
wbuf[2] = (offset >> 8) & 0xff;
|
wbuf[2] = (offset >> 8) & 0xff;
|
||||||
wbuf[3] = offset & 0xff;
|
wbuf[3] = offset & 0xff;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
if(board_spi_write(wbuf, sizeof(wbuf)) == false) {
|
if(board_spi_write(wbuf, sizeof(wbuf)) == false) {
|
||||||
/* failure */
|
/* failure */
|
||||||
@ -357,7 +357,7 @@ ext_flash_write(size_t offset, size_t length, const uint8_t *buf)
|
|||||||
* is not imposed here since above instructions
|
* is not imposed here since above instructions
|
||||||
* should be enough to delay
|
* should be enough to delay
|
||||||
* as much. */
|
* as much. */
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
if(board_spi_write(wbuf, sizeof(wbuf)) == false) {
|
if(board_spi_write(wbuf, sizeof(wbuf)) == false) {
|
||||||
/* failure */
|
/* failure */
|
||||||
@ -411,7 +411,7 @@ ext_flash_erase(size_t offset, size_t length)
|
|||||||
wbuf[2] = (offset >> 8) & 0xff;
|
wbuf[2] = (offset >> 8) & 0xff;
|
||||||
wbuf[3] = offset & 0xff;
|
wbuf[3] = offset & 0xff;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
if(board_spi_write(wbuf, sizeof(wbuf)) == false) {
|
if(board_spi_write(wbuf, sizeof(wbuf)) == false) {
|
||||||
/* failure */
|
/* failure */
|
||||||
|
@ -132,7 +132,7 @@ static struct ctimer startup_timer;
|
|||||||
* \brief Select the sensor on the I2C bus
|
* \brief Select the sensor on the I2C bus
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
select(void)
|
select_on_bus(void)
|
||||||
{
|
{
|
||||||
/* Select slave and set clock rate */
|
/* Select slave and set clock rate */
|
||||||
board_i2c_select(BOARD_I2C_INTERFACE_0, OPT3001_I2C_ADDRESS);
|
board_i2c_select(BOARD_I2C_INTERFACE_0, OPT3001_I2C_ADDRESS);
|
||||||
@ -148,7 +148,7 @@ notify_ready(void *not_used)
|
|||||||
*/
|
*/
|
||||||
uint16_t val;
|
uint16_t val;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
sensor_common_read_reg(REG_CONFIGURATION, (uint8_t *)&val, REGISTER_LENGTH);
|
sensor_common_read_reg(REG_CONFIGURATION, (uint8_t *)&val, REGISTER_LENGTH);
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ enable_sensor(bool enable)
|
|||||||
uint16_t val;
|
uint16_t val;
|
||||||
uint16_t had_data_ready = state & SENSOR_STATE_DATA_READY;
|
uint16_t had_data_ready = state & SENSOR_STATE_DATA_READY;
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
if(enable) {
|
if(enable) {
|
||||||
val = CONFIG_ENABLE_SINGLE_SHOT;
|
val = CONFIG_ENABLE_SINGLE_SHOT;
|
||||||
@ -202,7 +202,7 @@ read_data(uint16_t *raw_data)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
select();
|
select_on_bus();
|
||||||
|
|
||||||
success = sensor_common_read_reg(REG_CONFIGURATION, (uint8_t *)&val,
|
success = sensor_common_read_reg(REG_CONFIGURATION, (uint8_t *)&val,
|
||||||
REGISTER_LENGTH);
|
REGISTER_LENGTH);
|
||||||
|
Loading…
Reference in New Issue
Block a user