feat: Flysky PL18 Support (#4105)
Co-authored-by: raphaelcoeffic <raphael.coeffic@frafos.com> Co-authored-by: rotorman <risto.koiva@web.de> Co-authored-by: Xy201207 <yaoxu@flysky.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
raphaelcoeffic
rotorman
Xy201207
Peter Feerick
parent
5153aaeea0
commit
cc17046e7a
@@ -26,23 +26,27 @@
|
||||
|
||||
#include "stm32_keys.inc"
|
||||
|
||||
void keysInit()
|
||||
#define __weak __attribute__((weak))
|
||||
|
||||
__weak void keysInit()
|
||||
{
|
||||
_init_keys();
|
||||
_init_trims();
|
||||
}
|
||||
|
||||
uint32_t readKeys()
|
||||
__weak uint32_t readKeys()
|
||||
{
|
||||
return _read_keys();
|
||||
}
|
||||
|
||||
uint32_t readTrims()
|
||||
__weak uint32_t readTrims()
|
||||
{
|
||||
uint32_t trims = _read_trims();
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
if (_read_keys() & (1 << KEY_SHIFT))
|
||||
return ((trims & 0x03) << 6) | ((trims & 0x0c) << 2);
|
||||
#endif
|
||||
|
||||
return trims;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user