Fixed defaults for NAZE rev5 and above
Also included small rename of isOD to isOpenDrain for readability
This commit is contained in:
parent
abc2127a90
commit
e0d9e225d2
|
@ -59,7 +59,7 @@ void beeperInit(const beeperConfig_t *config)
|
|||
|
||||
if (beeperIO) {
|
||||
IOInit(beeperIO, OWNER_BEEPER, 0);
|
||||
IOConfigGPIO(beeperIO, config->isOD ? IOCFG_OUT_OD : IOCFG_OUT_PP);
|
||||
IOConfigGPIO(beeperIO, config->isOpenDrain ? IOCFG_OUT_OD : IOCFG_OUT_PP);
|
||||
}
|
||||
systemBeep(false);
|
||||
#endif
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
typedef struct beeperConfig_s {
|
||||
ioTag_t ioTag;
|
||||
uint8_t isInverted;
|
||||
uint8_t isOD;
|
||||
uint8_t isOpenDrain;
|
||||
} beeperConfig_t;
|
||||
|
||||
void systemBeep(bool on);
|
||||
|
|
|
@ -352,10 +352,10 @@ void resetAdcConfig(adcConfig_t *adcConfig)
|
|||
void resetBeeperConfig(beeperConfig_t *beeperConfig)
|
||||
{
|
||||
#ifdef BEEPER_INVERTED
|
||||
beeperConfig->isOD = false;
|
||||
beeperConfig->isOpenDrain = false;
|
||||
beeperConfig->isInverted = true;
|
||||
#else
|
||||
beeperConfig->isOD = true;
|
||||
beeperConfig->isOpenDrain = true;
|
||||
beeperConfig->isInverted = false;
|
||||
#endif
|
||||
beeperConfig->ioTag = IO_TAG(BEEPER);
|
||||
|
|
|
@ -754,8 +754,8 @@ const clivalue_t valueTable[] = {
|
|||
#endif
|
||||
|
||||
#ifdef BEEPER
|
||||
{ "beeper_inverted", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.beeperConfig.isInverted, .config.lookup = { TABLE_OFF_ON } },
|
||||
{ "beeper_od", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.beeperConfig.isOD, .config.lookup = { TABLE_OFF_ON } },
|
||||
{ "beeper_inversion", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.beeperConfig.isInverted, .config.lookup = { TABLE_OFF_ON } },
|
||||
{ "beeper_od", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.beeperConfig.isOpenDrain, .config.lookup = { TABLE_OFF_ON } },
|
||||
#endif
|
||||
|
||||
#ifdef SERIAL_RX
|
||||
|
|
|
@ -82,8 +82,11 @@ void targetConfiguration(master_t *config)
|
|||
|
||||
if (hardwareRevision >= NAZE32_REV5) {
|
||||
// naze rev4 and below used opendrain to PNP for buzzer. Rev5 and above use PP to NPN.
|
||||
config->beeperConfig.isOD = false;
|
||||
config->beeperConfig.isOpenDrain = false;
|
||||
config->beeperConfig.isInverted = true;
|
||||
} else {
|
||||
config->beeperConfig.isOpenDrain = true;
|
||||
config->beeperConfig.isInverted = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue