Skip to content

Commit

Permalink
lint fixes, move RF_BB pin bits in
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Aug 31, 2024
1 parent 507e8d5 commit 60d6e64
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
7 changes: 5 additions & 2 deletions src/keyboards/nuphy-air60/kbdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@
#define CONN_MODE_SWITCH_P5_5 _P5_5 // 1 - USB, 0 - RF
#define OS_MODE_SWITCH_P5_6 _P5_6 // 1 - MAC, 0 - WIN

#define RF_ENABLED 1

#define RF_BB_SPI_CS P7_4
#define RF_BB_SPI_SCK P4_7
#define RF_BB_SPI_MISO P0_6
#define RF_BB_SPI_MOSI P0_7

#define RF_BB_SPI_CS_P7_4 _P7_4
#define RF_BB_SPI_SCK_P4_7 _P4_7
#define RF_BB_SPI_MISO_P0_6 _P0_6
#define RF_BB_SPI_MOSI_P0_7 _P0_7

#endif
12 changes: 6 additions & 6 deletions src/keyboards/nuphy-air60/user_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ void user_gpio_init()
P7PCR = (uint8_t)(KB_R0_P7_1 | KB_R1_P7_2 | KB_R2_P7_3);

// TODO: move this out
P7 |= (1 << 4); // RF_BB_SPI_CS
P4 |= (1 << 7); // RF_BB_SPI_SCK
P0 |= (1 << 6) | (1 << 7); // RF_BB_SPI_MISO, RF_BB_SPI_MOSI
P7 |= RF_BB_SPI_CS_P7_4;
P4 |= RF_BB_SPI_SCK_P4_7;
P0 |= RF_BB_SPI_MISO_P0_6 | RF_BB_SPI_MOSI_P0_7;

P7CR |= (1 << 4); // RF_BB_SPI_CS
P4CR |= (1 << 7); // RF_BB_SPI_SCK
P0CR |= (1 << 6) | (1 << 7); // RF_BB_SPI_MISO, RF_BB_SPI_MOSI
P7CR |= RF_BB_SPI_CS_P7_4;
P4CR |= RF_BB_SPI_SCK_P4_7;
P0CR |= RF_BB_SPI_MISO_P0_6 | RF_BB_SPI_MOSI_P0_7;
}

void user_pwm_init()
Expand Down
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "user_init.h"
#include "indicators.h"
#ifdef RF_ENABLED
#include "rf_controller.h"
# include "rf_controller.h"
#endif

#include "pwm.h" // TODO: interrupt is defined here and need to be imported in main, centralise interupt definitions
Expand Down Expand Up @@ -55,9 +55,9 @@ void main()
dprintf("SMK v" TOSTRING(SMK_VERSION) "\r\n");
dprintf("DEVICE vId:" TOSTRING(USB_VID) " pId:" TOSTRING(USB_PID) "\n\r");

#ifdef RF_ENABLED
#ifdef RF_ENABLED
rf_init();
#endif
#endif

// enable pwm and interrupt (driving matrix scan)
indicators_start();
Expand Down
6 changes: 3 additions & 3 deletions src/smk/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
#include "usb.h"

#ifdef RF_ENABLED
#include "rf_controller.h"
# include "rf_controller.h"
#endif

/* send report */
void host_keyboard_send(report_keyboard_t *report)
{
usb_send_report(report);
#ifdef RF_ENABLED
#ifdef RF_ENABLED
rf_send_report(report);
#endif
#endif
}

0 comments on commit 60d6e64

Please sign in to comment.