X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_mma655x.c;h=b0217368692fb7939ce391663aa815f4aa46132b;hb=b6602d8c4053932a72c2bf4a63e24793634b2ad0;hp=5d44bffdae8982bead6f95152be2d4ddd0acf111;hpb=171d12cb7bb0ea185e9b8b6d90e1c0fb94b19008;p=fw%2Faltos diff --git a/src/drivers/ao_mma655x.c b/src/drivers/ao_mma655x.c index 5d44bffd..b0217368 100644 --- a/src/drivers/ao_mma655x.c +++ b/src/drivers/ao_mma655x.c @@ -34,7 +34,6 @@ static void ao_mma655x_start(void) { ao_spi_get_bit(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, - AO_MMA655X_CS, AO_MMA655X_SPI_INDEX, AO_SPI_SPEED_FAST); } @@ -43,19 +42,18 @@ static void ao_mma655x_stop(void) { ao_spi_put_bit(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, - AO_MMA655X_CS, AO_MMA655X_SPI_INDEX); } static void ao_mma655x_restart(void) { uint8_t i; - ao_gpio_set(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, AO_MMA655X_CS, 1); + ao_gpio_set(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, 1); /* Emperical testing on STM32L151 at 32MHz for this delay amount */ for (i = 0; i < 10; i++) ao_arch_nop(); - ao_gpio_set(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, AO_MMA655X_CS, 0); + ao_gpio_set(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, 0); } static uint8_t @@ -234,7 +232,7 @@ ao_mma655x_setup(void) ao_delay(AO_ST_DELAY); } if (tries == AO_ST_TRIES) - ao_sensor_errors = 1; + AO_SENSOR_ERROR(AO_DATA_MMA655X); ao_mma655x_reg_write(AO_MMA655X_DEVCFG, DEVCFG_VALUE | (1 << AO_MMA655X_DEVCFG_ENDINIT)); @@ -259,7 +257,7 @@ ao_mma655x_dump(void) printf ("MMA655X value %d\n", ao_mma655x_current); } -__code struct ao_cmds ao_mma655x_cmds[] = { +const struct ao_cmds ao_mma655x_cmds[] = { { ao_mma655x_dump, "A\0Display MMA655X data" }, { 0, NULL }, }; @@ -277,7 +275,7 @@ ao_mma655x(void) } } -static __xdata struct ao_task ao_mma655x_task; +static struct ao_task ao_mma655x_task; void ao_mma655x_init(void)