Refactored px4io_flash module to px4_flash, because it is now also used to flash the f4

This commit is contained in:
kevindehecker
2016-03-14 16:58:42 +01:00
parent 2df0ad0a01
commit 6d874bc4e8
6 changed files with 20 additions and 19 deletions
+1 -1
View File
@@ -76,7 +76,7 @@
<target name="test_datalink" board="px4fmu_2.4" />
</firmware>
<modules main_freq="512">
<load name="px4io_flash.xml" />
<load name="px4_flash.xml" />
<load name="geo_mag.xml" />
<load name="air_data.xml" />
<load name="send_imu_mag_current.xml" />
+1 -1
View File
@@ -76,7 +76,7 @@
<target name="test_datalink" board="px4fmu_2.4" />
</firmware>
<modules main_freq="512">
<load name="px4io_flash.xml" />
<load name="px4_flash.xml" />
<load name="geo_mag.xml" />
<load name="air_data.xml" />
<load name="send_imu_mag_current.xml" />
@@ -1,19 +1,19 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="px4io_flash">
<module name="px4_flash">
<doc>
<description>Flashes the px4io f1 through the px4 bootloader.</description>
<description>Flashes the px4 f1 through the px4 bootloader, or resets the f4 to be flashed directly by the f4' PX4 bootloader.</description>
</doc>
<header>
<file name="px4io_flash.h"/>
<file name="px4_flash.h"/>
</header>
<init fun="px4ioflash_init()"/>
<event fun="px4ioflash_event()"/>
<init fun="px4flash_init()"/>
<event fun="px4flash_event()"/>
<makefile target="ap">
<raw>
</raw>
<file name="px4io_flash.c"/>
<file name="px4_flash.c"/>
<file name="usb_ser_hw.c" dir="arch/stm32"/>
<configure name="PX4IO_UART" default="uart6" case="upper|lower"/>
<configure name="PX4IO_BAUD" default="B1500000"/>
@@ -18,15 +18,15 @@
* <http://www.gnu.org/licenses/>.
*/
/**
* @file "modules/px4io_flash/px4io_flash.c"
* @file "modules/px4_flash/px4_flash.c"
* @author Kevin van Hecke
* Flashes the px4io f1 through the px4 bootloader, or resets the f4 to be flashed directly.
* Assumes the flash port on the Pixhawk is configured as the usb.
*/
#include "modules/px4io_flash/px4io_flash.h"
#include "modules/px4_flash/px4_flash.h"
//#include "subsystems/datalink/downlink.h"
#include "modules/px4io_flash/protocol.h"
#include "modules/px4_flash/protocol.h"
#include "mcu_periph/sys_time_arch.h"
#include "subsystems/intermcu/intermcu_ap.h"
@@ -65,14 +65,14 @@ tid_t px4iobl_tid; ///< id for time out of the px4 bootloader reset
bool_t setToBootloaderMode;
bool_t px4ioRebootTimeout;
void px4ioflash_init(void)
void px4flash_init(void)
{
setToBootloaderMode = FALSE;
px4ioRebootTimeout = FALSE;
px4iobl_tid = sys_time_register_timer(15.0, NULL); //20 (fbw pprz bl timeout)-5 (px4 fmu bl timeout)
}
void px4ioflash_event(void)
void px4flash_event(void)
{
if (PX4IO_PORT->char_available(PX4IO_PORT->periph)) {
if (!setToBootloaderMode) {
@@ -18,16 +18,17 @@
* <http://www.gnu.org/licenses/>.
*/
/**
* @file "modules/px4io_flash/px4io_flash.h"
* @file "modules/px4_flash/px4_flash.h"
* @author Kevin van Hecke
* Flashes the px4io f1 through the px4 bootloader.
* Flashes the px4io f1 through the px4 bootloader, or resets the f4 to be flashed directly.
* Assumes the flash port on the Pixhawk is configured as the usb.
*/
#ifndef PX4IO_FLASH_H
#define PX4IO_FLASH_H
#ifndef PX4_FLASH_H
#define PX4_FLASH_H
extern void px4ioflash_init(void);
extern void px4ioflash_event(void);
extern void px4flash_init(void);
extern void px4flash_event(void);
#endif