aboutsummaryrefslogtreecommitdiff
path: root/docs/ja/feature_dip_switch.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ja/feature_dip_switch.md')
-rw-r--r--docs/ja/feature_dip_switch.md18
1 files changed, 12 insertions, 6 deletions
diff --git a/docs/ja/feature_dip_switch.md b/docs/ja/feature_dip_switch.md
index a0f6aeb00..8d0eeafa5 100644
--- a/docs/ja/feature_dip_switch.md
+++ b/docs/ja/feature_dip_switch.md
@@ -14,6 +14,8 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート
14```c 14```c
15// Connects each switch in the dip switch to the GPIO pin of the MCU 15// Connects each switch in the dip switch to the GPIO pin of the MCU
16#define DIP_SWITCH_PINS { B14, A15, A10, B9 } 16#define DIP_SWITCH_PINS { B14, A15, A10, B9 }
17// For split keyboards, you can separately define the right side pins
18#define DIP_SWITCH_PINS_RIGHT { ... }
17``` 19```
18 20
19あるいは 21あるいは
@@ -28,8 +30,9 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート
28コールバック関数を `<keyboard>.c` に記述することができます: 30コールバック関数を `<keyboard>.c` に記述することができます:
29 31
30```c 32```c
31void dip_switch_update_kb(uint8_t index, bool active) { 33bool dip_switch_update_kb(uint8_t index, bool active) {
32 dip_switch_update_user(index, active); 34 if !(dip_switch_update_user(index, active)) { return false; }
35 return true;
33} 36}
34``` 37```
35 38
@@ -37,7 +40,7 @@ void dip_switch_update_kb(uint8_t index, bool active) {
37あるいは `keymap.c` に記述することもできます: 40あるいは `keymap.c` に記述することもできます:
38 41
39```c 42```c
40void dip_switch_update_user(uint8_t index, bool active) { 43bool dip_switch_update_user(uint8_t index, bool active) {
41 switch (index) { 44 switch (index) {
42 case 0: 45 case 0:
43 if(active) { audio_on(); } else { audio_off(); } 46 if(active) { audio_on(); } else { audio_off(); }
@@ -62,6 +65,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
62 } 65 }
63 break; 66 break;
64 } 67 }
68 return true;
65} 69}
66``` 70```
67 71
@@ -69,8 +73,9 @@ void dip_switch_update_user(uint8_t index, bool active) {
69 73
70 74
71```c 75```c
72void dip_switch_update_mask_kb(uint32_t state) { 76bool dip_switch_update_mask_kb(uint32_t state) {
73 dip_switch_update_mask_user(state); 77 if (!dip_switch_update_mask_user(state)) { return false; }
78 return true;
74} 79}
75``` 80```
76 81
@@ -78,7 +83,7 @@ void dip_switch_update_mask_kb(uint32_t state) {
78あるいは `keymap.c` に記述することもできます: 83あるいは `keymap.c` に記述することもできます:
79 84
80```c 85```c
81void dip_switch_update_mask_user(uint32_t state) { 86bool dip_switch_update_mask_user(uint32_t state) {
82 if (state & (1UL<<0) && state & (1UL<<1)) { 87 if (state & (1UL<<0) && state & (1UL<<1)) {
83 layer_on(_ADJUST); // C on esc 88 layer_on(_ADJUST); // C on esc
84 } else { 89 } else {
@@ -94,6 +99,7 @@ void dip_switch_update_mask_user(uint32_t state) {
94 } else { 99 } else {
95 layer_off(_TEST_B); 100 layer_off(_TEST_B);
96 } 101 }
102 return true;
97} 103}
98``` 104```
99 105