diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-04-28 14:54:57 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-04-28 14:54:57 +0200 |
commit | a1503a8dd7f29c52cd4bd1740ad0a0010d50ddfe (patch) | |
tree | a0ffd694a4e337a4846f92cb5518f8b3d25b2978 /src | |
parent | 1df5e98aa507c7a89f1491254d7f34f94c04ede6 (diff) | |
parent | 0eafc2ade1dce974d5f7bdf05ca7678fa0b59ab0 (diff) | |
download | px4-firmware-a1503a8dd7f29c52cd4bd1740ad0a0010d50ddfe.tar.gz px4-firmware-a1503a8dd7f29c52cd4bd1740ad0a0010d50ddfe.tar.bz2 px4-firmware-a1503a8dd7f29c52cd4bd1740ad0a0010d50ddfe.zip |
Merge branch 'public-export-build' into fmuv2_bringup
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/boards/px4io/px4io_init.c | 8 | ||||
-rw-r--r-- | src/drivers/boards/px4io/px4io_internal.h | 4 | ||||
-rw-r--r-- | src/drivers/led/module.mk (renamed from src/drivers/led/Makefile) | 6 | ||||
-rw-r--r-- | src/modules/px4iofirmware/controls.c | 4 | ||||
-rw-r--r-- | src/modules/px4iofirmware/module.mk | 11 | ||||
-rw-r--r-- | src/modules/px4iofirmware/px4io.c | 8 | ||||
-rw-r--r-- | src/modules/px4iofirmware/px4io.h | 25 | ||||
-rw-r--r-- | src/modules/px4iofirmware/registers.c | 2 |
8 files changed, 48 insertions, 20 deletions
diff --git a/src/drivers/boards/px4io/px4io_init.c b/src/drivers/boards/px4io/px4io_init.c index 14e8dc13a..d36353c6f 100644 --- a/src/drivers/boards/px4io/px4io_init.c +++ b/src/drivers/boards/px4io/px4io_init.c @@ -86,9 +86,17 @@ __EXPORT void stm32_boardinitialize(void) stm32_configgpio(GPIO_SERVO_PWR_EN); stm32_configgpio(GPIO_RELAY1_EN); stm32_configgpio(GPIO_RELAY2_EN); + + /* turn off - all leds are active low */ + stm32_gpiowrite(GPIO_LED1, true); + stm32_gpiowrite(GPIO_LED2, true); + stm32_gpiowrite(GPIO_LED3, true); + + /* LED config */ stm32_configgpio(GPIO_LED1); stm32_configgpio(GPIO_LED2); stm32_configgpio(GPIO_LED3); + stm32_configgpio(GPIO_ACC_OC_DETECT); stm32_configgpio(GPIO_SERVO_OC_DETECT); stm32_configgpio(GPIO_BTN_SAFETY); diff --git a/src/drivers/boards/px4io/px4io_internal.h b/src/drivers/boards/px4io/px4io_internal.h index 44bb98513..eb2820bb7 100644 --- a/src/drivers/boards/px4io/px4io_internal.h +++ b/src/drivers/boards/px4io/px4io_internal.h @@ -32,7 +32,9 @@ ****************************************************************************/ /** - * @file PX4IO hardware definitions. + * @file px4io_internal.h + * + * PX4IO hardware definitions. */ #pragma once diff --git a/src/drivers/led/Makefile b/src/drivers/led/module.mk index 7de188259..777f3e442 100644 --- a/src/drivers/led/Makefile +++ b/src/drivers/led/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ ############################################################################ # -# Makefile to build the LED driver. +# Build the LED driver. # -include $(APPDIR)/mk/app.mk +SRCS = led.cpp diff --git a/src/modules/px4iofirmware/controls.c b/src/modules/px4iofirmware/controls.c index dc36f6c93..25eeca3be 100644 --- a/src/modules/px4iofirmware/controls.c +++ b/src/modules/px4iofirmware/controls.c @@ -288,8 +288,8 @@ controls_tick() { r_status_flags |= PX4IO_P_STATUS_FLAGS_OVERRIDE; /* mix new RC input control values to servos */ - if (dsm_updated || sbus_updated || ppm_updated) - mixer_tick(); + //if (dsm_updated || sbus_updated || ppm_updated) + // mixer_tick(); } else { r_status_flags &= ~PX4IO_P_STATUS_FLAGS_OVERRIDE; diff --git a/src/modules/px4iofirmware/module.mk b/src/modules/px4iofirmware/module.mk index 82b8f16d3..53d1ec2b9 100644 --- a/src/modules/px4iofirmware/module.mk +++ b/src/modules/px4iofirmware/module.mk @@ -8,11 +8,12 @@ SRCS = adc.c \ registers.c \ safety.c \ sbus.c \ - mixer.cpp \ - ../systemlib/mixer/mixer.cpp \ - ../systemlib/mixer/mixer_group.cpp \ - ../systemlib/mixer/mixer_multirotor.cpp \ - ../systemlib/mixer/mixer_simple.cpp \ ../systemlib/up_cxxinitialize.c \ ../systemlib/hx_stream.c \ ../systemlib/perf_counter.c + +# mixer.cpp \ +# ../systemlib/mixer/mixer.cpp \ +# ../systemlib/mixer/mixer_group.cpp \ +# ../systemlib/mixer/mixer_multirotor.cpp \ +# ../systemlib/mixer/mixer_simple.cpp \
\ No newline at end of file diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index 9de37e118..6244b1551 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -64,8 +64,10 @@ struct sys_state_s system_state; static struct hrt_call serial_dma_call; +#ifdef CONFIG_STM32_I2C1 /* store i2c reset count XXX this should be a register, together with other error counters */ volatile uint32_t i2c_loop_resets = 0; +#endif /* * a set of debug buffers to allow us to send debug information from ISRs @@ -133,7 +135,9 @@ user_start(int argc, char *argv[]) * Poll at 1ms intervals for received bytes that have not triggered * a DMA event. */ +#ifdef CONFIG_ARCH_DMA hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); +#endif /* print some startup info */ lowsyslog("\nPX4IO: starting\n"); @@ -155,8 +159,10 @@ user_start(int argc, char *argv[]) /* initialise the control inputs */ controls_init(); +#ifdef CONFIG_STM32_I2C1 /* start the i2c handler */ i2c_init(); +#endif /* add a performance counter for mixing */ perf_counter_t mixer_perf = perf_alloc(PC_ELAPSED, "mix"); @@ -201,7 +207,7 @@ user_start(int argc, char *argv[]) /* kick the mixer */ perf_begin(mixer_perf); - mixer_tick(); + // mixer_tick(); perf_end(mixer_perf); /* kick the control inputs */ diff --git a/src/modules/px4iofirmware/px4io.h b/src/modules/px4iofirmware/px4io.h index 202e9d9d9..3647842c0 100644 --- a/src/modules/px4iofirmware/px4io.h +++ b/src/modules/px4iofirmware/px4io.h @@ -124,10 +124,18 @@ extern struct sys_state_s system_state; #define LED_SAFETY(_s) stm32_gpiowrite(GPIO_LED3, !(_s)) #define POWER_SERVO(_s) stm32_gpiowrite(GPIO_SERVO_PWR_EN, (_s)) -#define POWER_ACC1(_s) stm32_gpiowrite(GPIO_ACC1_PWR_EN, (_s)) -#define POWER_ACC2(_s) stm32_gpiowrite(GPIO_ACC2_PWR_EN, (_s)) -#define POWER_RELAY1(_s) stm32_gpiowrite(GPIO_RELAY1_EN, (_s)) -#define POWER_RELAY2(_s) stm32_gpiowrite(GPIO_RELAY2_EN, (_s)) +#ifdef GPIO_ACC1_PWR_EN + #define POWER_ACC1(_s) stm32_gpiowrite(GPIO_ACC1_PWR_EN, (_s)) +#endif +#ifdef GPIO_ACC2_PWR_EN + #define POWER_ACC2(_s) stm32_gpiowrite(GPIO_ACC2_PWR_EN, (_s)) +#endif +#ifdef GPIO_RELAY1_EN + #define POWER_RELAY1(_s) stm32_gpiowrite(GPIO_RELAY1_EN, (_s)) +#endif +#ifdef GPIO_RELAY2_EN + #define POWER_RELAY2(_s) stm32_gpiowrite(GPIO_RELAY2_EN, (_s)) +#endif #define OVERCURRENT_ACC (!stm32_gpioread(GPIO_ACC_OC_DETECT)) #define OVERCURRENT_SERVO (!stm32_gpioread(GPIO_SERVO_OC_DETECT)) @@ -140,18 +148,20 @@ extern struct sys_state_s system_state; /* * Mixer */ -extern void mixer_tick(void); -extern void mixer_handle_text(const void *buffer, size_t length); +//extern void mixer_tick(void); +//extern void mixer_handle_text(const void *buffer, size_t length); /** * Safety switch/LED. */ extern void safety_init(void); +#ifdef CONFIG_STM32_I2C1 /** * FMU communications */ extern void i2c_init(void); +#endif /** * Register space @@ -183,6 +193,7 @@ extern volatile uint8_t debug_level; /* send a debug message to the console */ extern void isr_debug(uint8_t level, const char *fmt, ...); +#ifdef CONFIG_STM32_I2C1 void i2c_dump(void); void i2c_reset(void); - +#endif diff --git a/src/modules/px4iofirmware/registers.c b/src/modules/px4iofirmware/registers.c index 6c09def9e..64a87a58b 100644 --- a/src/modules/px4iofirmware/registers.c +++ b/src/modules/px4iofirmware/registers.c @@ -245,7 +245,7 @@ registers_set(uint8_t page, uint8_t offset, const uint16_t *values, unsigned num /* handle text going to the mixer parser */ case PX4IO_PAGE_MIXERLOAD: - mixer_handle_text(values, num_values * sizeof(*values)); + //mixer_handle_text(values, num_values * sizeof(*values)); break; default: |