mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-23 13:24:03 +08:00
enabled permanent setting on rotorcraft firmware.... beware
This commit is contained in:
+1
-1
@@ -138,7 +138,7 @@ else
|
||||
LDFLAGS = -D__thumb2__ -T$(LDSCRIPT) -nostartfiles -L$(GCC_LIB_DIR) -O$(OPT) --gc-sections
|
||||
endif
|
||||
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(TARGET).map,--cref,--gc-sections
|
||||
LDLIBS += -lc -lm -lgcc -lcmsis -lstm32
|
||||
LDLIBS += -lc -lm -lgcc -lcmsis -lstm32 -lopencm3_stm32
|
||||
|
||||
CPFLAGS = -j .isr_vector -j .text -j .data
|
||||
CPFLAGS_BIN = -Obinary
|
||||
|
||||
@@ -93,6 +93,8 @@ endif
|
||||
# or
|
||||
# include subsystems/rotorcraft/telemetry_xbee_api.makefile
|
||||
#
|
||||
ap.srcs += subsystems/settings.c
|
||||
ap.srcs += $(SRC_ARCH)/subsystems/settings_arch.c
|
||||
ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
|
||||
|
||||
# I2C is needed for speed controllers and barometers on lisa
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "subsystems/settings.h"
|
||||
|
||||
|
||||
int32_t persistent_write(uint32_t ptr, uint32_t size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t persistent_read(uint32_t ptr, uint32_t size) {
|
||||
return 0;
|
||||
}
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "downlink.h"
|
||||
#include "firmwares/rotorcraft/telemetry.h"
|
||||
#include "datalink.h"
|
||||
#include "subsystems/settings.h"
|
||||
#include "xbee.h"
|
||||
|
||||
#include "booz2_commands.h"
|
||||
@@ -46,7 +47,6 @@
|
||||
|
||||
#include "subsystems/electrical.h"
|
||||
|
||||
// #include "booz_fms.h" // FIXME
|
||||
#include "firmwares/rotorcraft/autopilot.h"
|
||||
|
||||
#include "firmwares/rotorcraft/stabilization.h"
|
||||
@@ -108,7 +108,6 @@ STATIC_INLINE void main_init( void ) {
|
||||
|
||||
baro_init();
|
||||
imu_init();
|
||||
// booz_fms_init(); // FIXME
|
||||
autopilot_init();
|
||||
nav_init();
|
||||
guidance_h_init();
|
||||
@@ -126,6 +125,8 @@ STATIC_INLINE void main_init( void ) {
|
||||
|
||||
modules_init();
|
||||
|
||||
settings_init();
|
||||
|
||||
mcu_int_enable();
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ bool_t settings_store_now;
|
||||
|
||||
|
||||
void settings_init(void) {
|
||||
#ifdef USE_PERMANENT_SETTINGS
|
||||
if (persistent_read((uint32_t)&pers_settings, sizeof(struct PersistentSettings)))
|
||||
return; // return -1 ?
|
||||
persitent_settings_load();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "mcu_periph/uart.h"
|
||||
#include "messages.h"
|
||||
|
||||
#include "my_debug_servo.h"
|
||||
|
||||
static inline void main_init( void );
|
||||
static inline void main_periodic( void );
|
||||
@@ -61,13 +62,22 @@ static inline void main_init( void ) {
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
settings_init();
|
||||
// DEBUG_SERVO2_INIT();
|
||||
// LED_ON(1);
|
||||
// LED_ON(2);
|
||||
// DEBUG_S4_ON();
|
||||
// DEBUG_S5_ON();
|
||||
// DEBUG_S6_ON();
|
||||
mcu_int_enable();
|
||||
|
||||
}
|
||||
|
||||
static inline void main_periodic( void ) {
|
||||
|
||||
RunOnceEvery(100, {DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM);});
|
||||
RunOnceEvery(100, {
|
||||
DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM);
|
||||
PeriodicSendDlValue(DefaultChannel);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -138,14 +138,14 @@ let print_dl_settings = fun settings ->
|
||||
left()
|
||||
|
||||
(*
|
||||
Blaaaaaa
|
||||
Generate code for persitent settings
|
||||
*)
|
||||
let print_persistent_settings = fun settings ->
|
||||
let settings = flatten settings [] in
|
||||
let pers_settings =
|
||||
List.filter (fun x -> try let _ = Xml.attrib x "persistent" in true with _ -> false) settings in
|
||||
(* structure declaration *)
|
||||
if List.length pers_settings > 0 then begin
|
||||
(* if List.length pers_settings > 0 then begin *)
|
||||
lprintf "\n/* Persistent Settings */\n";
|
||||
lprintf "struct PersistentSettings {\n";
|
||||
right();
|
||||
@@ -180,7 +180,7 @@ let print_persistent_settings = fun settings ->
|
||||
pers_settings;
|
||||
left();
|
||||
lprintf "};\n"
|
||||
end
|
||||
(* end *)
|
||||
|
||||
|
||||
(*
|
||||
|
||||
Reference in New Issue
Block a user