Skip to content

Commit

Permalink
migrate old keyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeneg committed Nov 6, 2024
1 parent 8a22708 commit 860ef19
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions keyboards/picachoc36/picachoc36.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

#ifdef ENCODER_ENABLE // code based on encoder.c

# define ENCODER_PIN_A (((pin_t[])ENCODERS_PAD_A)[0])
# define ENCODER_PIN_B (((pin_t[])ENCODERS_PAD_B)[0])
#define ENCODER_PIN_A (((pin_t[])ENCODER_A_PINS)[0])
#define ENCODER_PIN_B (((pin_t[])ENCODER_B_PINS)[0])

// custom handler that returns encoder B pin status from slave side
void encoder_sync_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) {
*(uint8_t *)out_data = readPin(ENCODER_PIN_B) ? 1 : 0;
*(uint8_t *)out_data = gpio_read_pin(ENCODER_PIN_B) ? 1 : 0;
}

void encoder_quadrature_init_pin(uint8_t index, bool pad_b) {}

uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) {
if (pad_b) {
if(pad_b) {
uint8_t data = 0;
transaction_rpc_recv(ENCODER_SYNC, sizeof(data), &data);
return data;
}
return readPin(ENCODER_PIN_A) ? 1 : 0;
return gpio_read_pin(ENCODER_PIN_A) ? 1 : 0;
}

#endif // ENCODER_ENABLE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 860ef19

Please sign in to comment.