Skip to content

Commit

Permalink
Revert "Fix for HobbyKing boards."
Browse files Browse the repository at this point in the history
This reverts commit 75b93b0.
  • Loading branch information
dagar authored and LorenzMeier committed Dec 21, 2017
1 parent 2f50a07 commit b718901
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/drivers/boards/px4fmu-v2/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_VDD_SERVO_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7)
#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0)
#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3)
#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN3)
#define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10)
#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15)

Expand Down
25 changes: 22 additions & 3 deletions src/drivers/boards/px4fmu-v2/px4fmu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ stm32_boardinitialize(void)
/* configure LEDs */
board_autoled_initialize();

/* Start with the Sensor voltage off */

stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN);

/* configure ADC pins */

stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */
Expand All @@ -335,16 +339,16 @@ stm32_boardinitialize(void)

/* configure power supply control/sense pins */
stm32_configgpio(GPIO_VDD_5V_PERIPH_EN);
stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN);
stm32_configgpio(GPIO_VDD_BRICK_VALID);
stm32_configgpio(GPIO_VDD_SERVO_VALID);
stm32_configgpio(GPIO_VDD_USB_VALID);
stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC);
stm32_configgpio(GPIO_VDD_5V_PERIPH_OC);


/* configure SPI interfaces */
stm32_spiinitialize();
/* configure SPI interfaces is deferred to board_app_initialize
* to delay the sensor power up with out adding a delay
*/

}

Expand Down Expand Up @@ -380,6 +384,7 @@ static struct sdio_dev_s *sdio;

__EXPORT int board_app_initialize(uintptr_t arg)
{

#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)

/* run C++ ctors before we go any further */
Expand Down Expand Up @@ -417,7 +422,21 @@ __EXPORT int board_app_initialize(uintptr_t arg)

#endif // BOARD_HAS_SIMPLE_HW_VERSIONING

/* Bring up the Sensor power */

stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 1);

/* Ensure the power is on 1 ms before we drive the GPIO pins */

usleep(1000);

/* Now it is ok to drive the pins high so configure SPI GPIO */

stm32_spiinitialize();


/* configure the high-resolution time/callout interface */

hrt_init();

param_init();
Expand Down

0 comments on commit b718901

Please sign in to comment.