Skip to content

Commit

Permalink
[superbit] Trigger persistent settings store on bind.
Browse files Browse the repository at this point in the history
  • Loading branch information
esden committed Aug 17, 2014
1 parent 21e3935 commit bba214c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sw/airborne/subsystems/datalink/superbitrf.c
Expand Up @@ -32,6 +32,7 @@
#include "mcu_periph/spi.h"
#include "mcu_periph/sys_time.h"
#include "mcu_periph/gpio.h"
#include "subsystems/settings.h"

/* Default SuperbitRF SPI DEV */
#ifndef SUPERBITRF_SPI_DEV
Expand Down Expand Up @@ -739,6 +740,12 @@ static inline void superbitrf_receive_packet_cb(bool_t error, uint8_t status, ui
superbitrf.num_channels = packet[11];
superbitrf_set_protocol(packet[12]);

// Store all the persistent settings.
// In case we have the superbit setting file loaded and persistent settings
// enabled in the airframe file this will store our binding information and
// survive a reboot.
settings_StoreSettings(1);

// Update the status of the receiver
superbitrf.state = 0;
superbitrf.status = SUPERBITRF_INIT_TRANSFER;
Expand Down

0 comments on commit bba214c

Please sign in to comment.