Skip to content

Commit f73d260

Browse files
author
philmoz
committed
Prevent extra trim event on color radios.
1 parent 66463ec commit f73d260

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

radio/src/edgetx.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,8 @@ void alert(const char * title, const char * msg , uint8_t sound)
985985
void checkTrims()
986986
{
987987
event_t event = getTrimEvent();
988-
if (event && !IS_KEY_BREAK(event)) {
988+
// Only use press and repeat trim events
989+
if (event && (IS_KEY_FIRST(event) || IS_KEY_REPT(event))) {
989990
int8_t k = EVT_KEY_MASK(event);
990991
uint8_t idx = inputMappingConvertMode(uint8_t(k / 2));
991992
uint8_t phase;

radio/src/keys.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ constexpr bool IS_KEY_EVENT(event_t event)
116116
return (event & 0xF000) == 0; // fired when key is released (short or long), but only if the event was not killed
117117
}
118118

119-
// constexpr bool IS_TRIM_EVENT(event_t event)
120-
// {
121-
// return (IS_KEY_EVENT(event) && EVT_KEY_MASK(event) >= TRM_BASE);
122-
// }
123-
124119
inline bool IS_KEY_FIRST(event_t evt)
125120
{
126121
return (evt & _MSK_KEY_FLAGS) == _MSK_KEY_FIRST;
@@ -136,11 +131,6 @@ inline bool IS_KEY_LONG(event_t evt)
136131
return (evt & _MSK_KEY_FLAGS) == _MSK_KEY_LONG;
137132
}
138133

139-
inline bool IS_KEY_BREAK(event_t evt)
140-
{
141-
return (evt & _MSK_KEY_FLAGS) == _MSK_KEY_BREAK;
142-
}
143-
144134
inline bool IS_KEY_EVT(event_t evt, uint8_t key)
145135
{
146136
return (evt & _MSK_KEY_FLAGS) && (EVT_KEY_MASK(evt) == key);

0 commit comments

Comments
 (0)