Pārlūkot izejas kodu

core: Fix unimap UNIMAP_NO case

master
tmk pirms 7 gadiem
vecāks
revīzija
384562bc8a
1 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. 7
    5
      tmk_core/common/unimap.c

+ 7
- 5
tmk_core/common/unimap.c Parādīt failu

unimap_trans[key.row][key.col]; unimap_trans[key.row][key.col];
#endif #endif
return (keypos_t) { return (keypos_t) {
.row = ((unimap_pos & 0x70) >> 4),
.col = (unimap_pos & 0x0F)
.row = ((unimap_pos & 0xf0) >> 4),
.col = (unimap_pos & 0x0f)
}; };
} }


action_t action_for_key(uint8_t layer, keypos_t key) action_t action_for_key(uint8_t layer, keypos_t key)
{ {
keypos_t uni = unimap_translate(key); keypos_t uni = unimap_translate(key);
if ((uni.row << 4 | uni.col) == UNIMAP_NO) return (action_t)ACTION_NO;
if ((uni.row << 4 | uni.col) == UNIMAP_NO) {
return (action_t)ACTION_NO;
}
#if defined(__AVR__) #if defined(__AVR__)
return (action_t)pgm_read_word(&actionmaps[(layer)][(uni.row)][(uni.col)]);
return (action_t)pgm_read_word(&actionmaps[(layer)][(uni.row & 0x7)][(uni.col)]);
#else #else
return actionmaps[(layer)][(uni.row)][(uni.col)];
return actionmaps[(layer)][(uni.row & 0x7)][(uni.col)];
#endif #endif
} }



Notiek ielāde…
Atcelt
Saglabāt