Skip to content

Commit

Permalink
RADIX: set default current scale for RADIX LI
Browse files Browse the repository at this point in the history
  • Loading branch information
mluessi committed Sep 26, 2019
1 parent bdfcb3f commit 5ecf5a5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/target/RADIX/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@

#include <platform.h>

#ifdef TARGET_CONFIG

#include "fc/config.h"
#include "sensors/gyro.h"
#include "sensors/battery.h"
#include "blackbox/blackbox.h"
#include "io/osd.h"

Expand All @@ -32,5 +31,9 @@ void targetConfiguration(void)
gyroConfigMutable()->looptime = 1000;
//blackboxConfigMutable()->p_denom = 128;
osdConfigMutable()->rssi_alarm = 70; // for CRSF

if (brainfpv_is_radixli()) {
// value for RADIX LI wPB
batteryMetersConfigMutable()->current.scale = 500;
}
}
#endif
9 changes: 9 additions & 0 deletions src/main/target/RADIX/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,12 @@ void brainFPVUpdateSettings(void) {
}
brainfpv_settings_updated_from_cms = false;
}

#define RADIX_LI_IDENT_ADDR 0x1FFF7800
#define RADIX_LI_MAGIC 0x52414C49
bool brainfpv_is_radixli(void)
{
uint32_t * magic = 0x1FFF7800;
return (*magic == RADIX_LI_MAGIC);
}

2 changes: 2 additions & 0 deletions src/main/target/RADIX/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,5 @@
extern bool brainfpv_settings_updated;
extern bool brainfpv_settings_updated_from_cms;
void brainFPVUpdateSettings(void);
bool brainfpv_is_radixli(void);

0 comments on commit 5ecf5a5

Please sign in to comment.