diff options
| author | Nick Brassel | 2021-08-29 00:20:25 +0200 |
|---|---|---|
| committer | Nick Brassel | 2021-08-29 00:20:25 +0200 |
| commit | f061ca497464fe85284906fb163a33eaee7a91ef (patch) | |
| tree | 33ef1bfb529aed382e8526c607c4e18717f92571 /docs/ja/feature_dip_switch.md | |
| parent | ff65185dec6f97be1eb49f17cea526a0d0bbf3d6 (diff) | |
| parent | 4bad375d7c09d949a9dcdd4feba147c9c7a67ec6 (diff) | |
Breaking changes develop merge to master, 2021Q3 edition. (#14196)
Diffstat (limited to 'docs/ja/feature_dip_switch.md')
| -rw-r--r-- | docs/ja/feature_dip_switch.md | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/docs/ja/feature_dip_switch.md b/docs/ja/feature_dip_switch.md index a0f6aeb003..8d0eeafa5a 100644 --- a/docs/ja/feature_dip_switch.md +++ b/docs/ja/feature_dip_switch.md @@ -14,6 +14,8 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート ```c // Connects each switch in the dip switch to the GPIO pin of the MCU #define DIP_SWITCH_PINS { B14, A15, A10, B9 } +// For split keyboards, you can separately define the right side pins +#define DIP_SWITCH_PINS_RIGHT { ... } ``` あるいは @@ -28,8 +30,9 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート コールバック関数を `<keyboard>.c` に記述することができます: ```c -void dip_switch_update_kb(uint8_t index, bool active) { - dip_switch_update_user(index, active); +bool dip_switch_update_kb(uint8_t index, bool active) { + if !(dip_switch_update_user(index, active)) { return false; } + return true; } ``` @@ -37,7 +40,7 @@ void dip_switch_update_kb(uint8_t index, bool active) { あるいは `keymap.c` に記述することもできます: ```c -void dip_switch_update_user(uint8_t index, bool active) { +bool dip_switch_update_user(uint8_t index, bool active) { switch (index) { case 0: if(active) { audio_on(); } else { audio_off(); } @@ -62,6 +65,7 @@ void dip_switch_update_user(uint8_t index, bool active) { } break; } + return true; } ``` @@ -69,8 +73,9 @@ void dip_switch_update_user(uint8_t index, bool active) { ```c -void dip_switch_update_mask_kb(uint32_t state) { - dip_switch_update_mask_user(state); +bool dip_switch_update_mask_kb(uint32_t state) { + if (!dip_switch_update_mask_user(state)) { return false; } + return true; } ``` @@ -78,7 +83,7 @@ void dip_switch_update_mask_kb(uint32_t state) { あるいは `keymap.c` に記述することもできます: ```c -void dip_switch_update_mask_user(uint32_t state) { +bool dip_switch_update_mask_user(uint32_t state) { if (state & (1UL<<0) && state & (1UL<<1)) { layer_on(_ADJUST); // C on esc } else { @@ -94,6 +99,7 @@ void dip_switch_update_mask_user(uint32_t state) { } else { layer_off(_TEST_B); } + return true; } ``` |