1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

cpu/stm32f4 changed SPI-return values to API defs

This commit is contained in:
PeterKietzmann 2014-10-07 11:13:37 +02:00
parent 8d73775d99
commit 4da6329684

View File

@ -64,7 +64,7 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
speed_devider = 3; /* makes 10.5 MHz */ speed_devider = 3; /* makes 10.5 MHz */
break; break;
default: default:
return -2; return -1;
} }
switch (dev) { switch (dev) {
@ -192,7 +192,7 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
break; break;
#endif /* SPI_1_EN */ #endif /* SPI_1_EN */
default: default:
return -1; return -2;
} }
/**************** SPI-Init *****************/ /**************** SPI-Init *****************/
@ -423,11 +423,11 @@ int spi_transfer_reg(spi_t dev, uint8_t reg, char out, char *in)
trans_ret = spi_transfer_byte(dev, reg, in); trans_ret = spi_transfer_byte(dev, reg, in);
if (trans_ret < 0) { if (trans_ret < 0) {
return -2; return -1;
} }
trans_ret = spi_transfer_byte(dev, out, in); trans_ret = spi_transfer_byte(dev, out, in);
if (trans_ret < 0) { if (trans_ret < 0) {
return -3; return -1;
} }
return 1; return 1;
@ -439,11 +439,11 @@ int spi_transfer_regs(spi_t dev, uint8_t reg, char *out, char *in, unsigned int
trans_ret = spi_transfer_byte(dev, reg, in); trans_ret = spi_transfer_byte(dev, reg, in);
if (trans_ret < 0) { if (trans_ret < 0) {
return -2; return -1;
} }
trans_ret = spi_transfer_bytes(dev, out, in, length); trans_ret = spi_transfer_bytes(dev, out, in, length);
if (trans_ret < 0) { if (trans_ret < 0) {
return -3; return -1;
} }
return trans_ret; return trans_ret;