1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Add resource option to configure pin as pullup or pulldown input

all pins are initialized to pullup inputs per default. With resource PULLDOWN 1 PIN it is
possible to reconfigure the pin so it is a PULLDOWN input.

With this it's possible to prevent certain errors on some boards that have multiple pins connected
with an inverter and the pullup flows back via the inverter and pulls other pins low (see #7849)
This commit is contained in:
Johannes Kasberger 2019-08-14 22:06:12 +02:00
parent 811eeea542
commit cc9687a2bf
11 changed files with 193 additions and 1 deletions

View file

@ -149,6 +149,7 @@ bool cliMode = false;
#include "pg/timerup.h"
#include "pg/usb.h"
#include "pg/vtx_table.h"
#include "pg/pin_up_down.h"
#include "rx/rx.h"
#include "rx/spektrum.h"
@ -4913,6 +4914,10 @@ const cliResourceValue_t resourceTable[] = {
DEFS( OWNER_VTX_DATA, PG_VTX_IO_CONFIG, vtxIOConfig_t, dataTag ),
DEFS( OWNER_VTX_CLK, PG_VTX_IO_CONFIG, vtxIOConfig_t, clockTag ),
#endif
#ifdef USE_PIN_UP_DOWN
DEFA( OWNER_PULLUP, PG_PULLUP_CONFIG, pinUpDownConfig_t, ioTag, PIN_UP_DOWN_COUNT ),
DEFA( OWNER_PULLDOWN, PG_PULLDOWN_CONFIG, pinUpDownConfig_t, ioTag, PIN_UP_DOWN_COUNT ),
#endif
};
#undef DEFS