Browse Source

Let's just init the status flag every time we send a config update

sbg
Simon Wilks 12 years ago
parent
commit
8f5dac3740
  1. 3
      apps/px4io/px4io.c
  2. 7
      apps/px4io/registers.c

3
apps/px4io/px4io.c

@ -153,9 +153,6 @@ user_start(int argc, char *argv[]) @@ -153,9 +153,6 @@ user_start(int argc, char *argv[])
/* configure the first 8 PWM outputs (i.e. all of them) */
up_pwm_servo_init(0xff);
/* initialise the registry space */
registers_init();
/* initialise the control inputs */
controls_init();

7
apps/px4io/registers.c

@ -179,12 +179,6 @@ uint16_t r_page_rc_input_config[MAX_CONTROL_CHANNELS * PX4IO_P_RC_CONFIG_STRIDE @@ -179,12 +179,6 @@ uint16_t r_page_rc_input_config[MAX_CONTROL_CHANNELS * PX4IO_P_RC_CONFIG_STRIDE
*/
uint16_t r_page_servo_failsafe[IO_SERVO_COUNT];
void
registers_init(void)
{
r_status_flags |= PX4IO_P_STATUS_FLAGS_INIT_OK;
}
void
registers_set(uint8_t page, uint8_t offset, const uint16_t *values, unsigned num_values)
{
@ -389,6 +383,7 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value) @@ -389,6 +383,7 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
case PX4IO_P_RC_CONFIG_OPTIONS:
value &= PX4IO_P_RC_CONFIG_OPTIONS_VALID;
r_status_flags |= PX4IO_P_STATUS_FLAGS_INIT_OK;
/* set all options except the enabled option */
conf[index] = value & ~PX4IO_P_RC_CONFIG_OPTIONS_ENABLED;

Loading…
Cancel
Save