Shortened module explanation

This commit is contained in:
kevindehecker
2016-03-15 10:37:44 +01:00
parent 55844c2289
commit 672ed9b24d
3 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<module name="px4_flash"> <module name="px4_flash">
<doc> <doc>
<description>Flashes the px4 f1 through the px4 bootloader, or resets the f4 to be flashed directly by the f4' PX4 bootloader.</description> <description>Enables to flashes the px4 FBW and AP through the original px4 bootloader.</description>
</doc> </doc>
<header> <header>
<file name="px4_flash.h"/> <file name="px4_flash.h"/>
+30 -30
View File
@@ -20,7 +20,7 @@
/** /**
* @file "modules/px4_flash/px4_flash.c" * @file "modules/px4_flash/px4_flash.c"
* @author Kevin van Hecke * @author Kevin van Hecke
* Flashes the px4io f1 through the px4 bootloader, or resets the f4 to be flashed directly. * Enables to flashes the px4 FBW and AP through the original px4 bootloader.
* Assumes the flash port on the Pixhawk is configured as the usb. * Assumes the flash port on the Pixhawk is configured as the usb.
*/ */
@@ -100,20 +100,20 @@ void px4flash_event(void)
while (state < 4 && FLASH_PORT->char_available(FLASH_PORT->periph)) { while (state < 4 && FLASH_PORT->char_available(FLASH_PORT->periph)) {
unsigned char b = FLASH_PORT->get_byte(FLASH_PORT->periph); unsigned char b = FLASH_PORT->get_byte(FLASH_PORT->periph);
switch (state) { switch (state) {
case (0) : case (0) :
if (b == 'p') { state++; } else { return; } if (b == 'p') { state++; } else { return; }
break; break;
case (1) : case (1) :
if (b == 'p') { state++; } else { return; } if (b == 'p') { state++; } else { return; }
break; break;
case (2) : case (2) :
if (b == 'r') { state++; } else { return; } if (b == 'r') { state++; } else { return; }
break; break;
case (3) : case (3) :
if (b == 'z') { state++; } else { return; } if (b == 'z') { state++; } else { return; }
break; break;
default : default :
break; break;
} }
} }
@@ -129,7 +129,7 @@ void px4flash_event(void)
//first check if the bootloader has not timeout: //first check if the bootloader has not timeout:
if (sys_time_check_and_ack_timer(px4iobl_tid) || px4ioRebootTimeout) { if (sys_time_check_and_ack_timer(px4iobl_tid) || px4ioRebootTimeout) {
px4ioRebootTimeout= TRUE; px4ioRebootTimeout = TRUE;
sys_time_cancel_timer(px4iobl_tid); sys_time_cancel_timer(px4iobl_tid);
FLASH_PORT->put_byte(FLASH_PORT->periph, 'T'); FLASH_PORT->put_byte(FLASH_PORT->periph, 'T');
FLASH_PORT->put_byte(FLASH_PORT->periph, 'I'); FLASH_PORT->put_byte(FLASH_PORT->periph, 'I');
@@ -202,20 +202,20 @@ void px4flash_event(void)
unsigned char b = PX4IO_PORT->get_byte(PX4IO_PORT->periph); unsigned char b = PX4IO_PORT->get_byte(PX4IO_PORT->periph);
switch (state) { switch (state) {
case (0) : case (0) :
if (b == PKT_CODE_SUCCESS) { state++; } else { state = 0; } if (b == PKT_CODE_SUCCESS) { state++; } else { state = 0; }
break; break;
case (1) : case (1) :
if (b == 0xe5) { state++; } else { state = 0; } if (b == 0xe5) { state++; } else { state = 0; }
break; break;
case (2) : case (2) :
if (b == 0x32) { state++; } else { state = 0; } if (b == 0x32) { state++; } else { state = 0; }
break; break;
case (3) : case (3) :
if (b == 0x0a) { state++; } else { state = 0; } if (b == 0x0a) { state++; } else { state = 0; }
break; break;
default : default :
break; break;
} }
} }
#else #else
+1 -1
View File
@@ -20,7 +20,7 @@
/** /**
* @file "modules/px4_flash/px4_flash.h" * @file "modules/px4_flash/px4_flash.h"
* @author Kevin van Hecke * @author Kevin van Hecke
* Flashes the px4io f1 through the px4 bootloader, or resets the f4 to be flashed directly. * Enables to flashes the px4 FBW and AP through the original px4 bootloader.
* Assumes the flash port on the Pixhawk is configured as the usb. * Assumes the flash port on the Pixhawk is configured as the usb.
*/ */