Aerocore: Fix formatting

This commit is contained in:
Lorenz Meier
2015-10-19 13:24:03 +02:00
parent 19e3da7169
commit 0d395e893a
3 changed files with 21 additions and 9 deletions
+9 -3
View File
@@ -117,12 +117,12 @@ __END_DECLS
static GRAN_HANDLE dma_allocator;
/*
* The DMA heap size constrains the total number of things that can be
/*
* The DMA heap size constrains the total number of things that can be
* ready to do DMA at a time.
*
* For example, FAT DMA depends on one sector-sized buffer per filesystem plus
* one sector-sized buffer per file.
* one sector-sized buffer per file.
*
* We use a fundamental alignment / granule size of 64B; this is sufficient
* to guarantee alignment for the largest STM32 DMA burst (16 beats x 32bits).
@@ -137,8 +137,10 @@ dma_alloc_init(void)
sizeof(g_dma_heap),
7, /* 128B granule - must be > alignment (XXX bug?) */
6); /* 64B alignment */
if (dma_allocator == NULL) {
message("[boot] DMA allocator setup FAILED");
} else {
g_dma_perf = perf_alloc(PC_COUNT, "DMA allocations");
}
@@ -262,11 +264,13 @@ __EXPORT int nsh_archinitialize(void)
/* Configure Sensors on SPI bus #3 */
spi3 = up_spiinitialize(3);
if (!spi3) {
message("[boot] FAILED to initialize SPI port 3\n");
up_ledon(LED_AMBER);
return -ENODEV;
}
/* Default: 1MHz, 8 bits, Mode 3 */
SPI_SETFREQUENCY(spi3, 10000000);
SPI_SETBITS(spi3, 8);
@@ -279,11 +283,13 @@ __EXPORT int nsh_archinitialize(void)
/* Configure FRAM on SPI bus #4 */
spi4 = up_spiinitialize(4);
if (!spi4) {
message("[boot] FAILED to initialize SPI port 4\n");
up_ledon(LED_AMBER);
return -ENODEV;
}
/* Default: ~10MHz, 8 bits, Mode 3 */
SPI_SETFREQUENCY(spi4, 10 * 1000 * 1000);
SPI_SETBITS(spi4, 8);
+10 -4
View File
@@ -103,17 +103,23 @@ __EXPORT void led_toggle(int led)
{
switch (led) {
case 0:
if (stm32_gpioread(GPIO_LED0))
if (stm32_gpioread(GPIO_LED0)) {
stm32_gpiowrite(GPIO_LED0, false);
else
} else {
stm32_gpiowrite(GPIO_LED0, true);
}
break;
case 1:
if (stm32_gpioread(GPIO_LED1))
if (stm32_gpioread(GPIO_LED1)) {
stm32_gpiowrite(GPIO_LED1, false);
else
} else {
stm32_gpiowrite(GPIO_LED1, true);
}
break;
default:
+2 -2
View File
@@ -136,8 +136,8 @@ __EXPORT void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid,
switch (devid) {
case PX4_SPIDEV_GYRO:
/* Making sure the other peripherals are not selected */
stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected);
/* Making sure the other peripherals are not selected */
stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected);
stm32_gpiowrite(GPIO_SPI_CS_ACCEL_MAG, 1);
stm32_gpiowrite(GPIO_SPI_CS_BARO, 1);
break;