Skip to content

Commit 8f605f8

Browse files
authored
Merge pull request #1507 from recrof/rak3401-board-fix
fix: build errors because of changes in RAK3401Board base class
2 parents 93367b9 + d5a73b2 commit 8f605f8

2 files changed

Lines changed: 19 additions & 31 deletions

File tree

variants/rak3401/RAK3401Board.h

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,20 @@
44
#include <Arduino.h>
55
#include <helpers/NRF52Board.h>
66

7-
// LoRa radio module pins for RAK13302
8-
#define P_LORA_SCLK 3
9-
#define P_LORA_MISO 29
10-
#define P_LORA_MOSI 30
11-
#define P_LORA_NSS 26
12-
#define P_LORA_DIO_1 10
13-
#define P_LORA_BUSY 9
14-
#define P_LORA_RESET 4
15-
#ifndef P_LORA_PA_EN
16-
#define P_LORA_PA_EN 31
17-
#endif
18-
19-
//#define PIN_GPS_SDA 13 //GPS SDA pin (output option)
20-
//#define PIN_GPS_SCL 14 //GPS SCL pin (output option)
21-
// #define PIN_GPS_TX 16 //GPS TX pin
22-
// #define PIN_GPS_RX 15 //GPS RX pin
23-
#define PIN_GPS_1PPS 17 //GPS PPS pin
24-
#define GPS_BAUD_RATE 9600
25-
#define GPS_ADDRESS 0x42 //i2c address for GPS
26-
27-
#define SX126X_DIO2_AS_RF_SWITCH
28-
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
29-
30-
317
// built-ins
328
#define PIN_VBAT_READ 5
339
#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000)
3410

3511
#define PIN_3V3_EN (34)
3612
#define WB_IO2 PIN_3V3_EN
3713

38-
class RAK3401Board : public NRF52BoardDCDC, public NRF52BoardOTA {
14+
class RAK3401Board : public NRF52BoardDCDC {
15+
protected:
16+
#ifdef NRF52_POWER_MANAGEMENT
17+
void initiateShutdown(uint8_t reason) override;
18+
#endif
3919
public:
40-
RAK3401Board() : NRF52BoardOTA("RAK3401_OTA") {}
20+
RAK3401Board() : NRF52Board("RAK3401_OTA") {}
4121
void begin();
4222

4323
#define BATTERY_SAMPLES 8

variants/rak3401/variant.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ static const uint8_t AREF = PIN_AREF;
141141
#define EXTERNAL_FLASH_DEVICES IS25LP080D
142142
#define EXTERNAL_FLASH_USE_QSPI
143143

144-
#define P_LORA_SCK PIN_SPI1_SCK
145-
#define P_LORA_MISO PIN_SPI1_MISO
146-
#define P_LORA_MOSI PIN_SPI1_MOSI
147-
#define P_LORA_CS 26
148-
149144
#define USE_SX1262
150145
#define SX126X_CS (26)
151146
#define SX126X_DIO1 (10)
@@ -157,6 +152,15 @@ static const uint8_t AREF = PIN_AREF;
157152
#define SX126X_DIO2_AS_RF_SWITCH
158153
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
159154

155+
#define P_LORA_SCLK PIN_SPI1_SCK
156+
#define P_LORA_MISO PIN_SPI1_MISO
157+
#define P_LORA_MOSI PIN_SPI1_MOSI
158+
#define P_LORA_NSS SX126X_CS
159+
#define P_LORA_DIO_1 SX126X_DIO1
160+
#define P_LORA_BUSY SX126X_BUSY
161+
#define P_LORA_RESET SX126X_RESET
162+
#define P_LORA_PA_EN 31
163+
160164
// enables 3.3V periphery like GPS or IO Module
161165
// Do not toggle this for GPS power savings
162166
#define PIN_3V3_EN (34)
@@ -173,6 +177,10 @@ static const uint8_t AREF = PIN_AREF;
173177
#define PIN_GPS_RX PIN_SERIAL1_RX
174178
#define PIN_GPS_TX PIN_SERIAL1_TX
175179

180+
#define PIN_GPS_1PPS PIN_GPS_PPS
181+
#define GPS_BAUD_RATE 9600
182+
#define GPS_ADDRESS 0x42 //i2c address for GPS
183+
176184
// Battery
177185
// The battery sense is hooked to pin A0 (5)
178186
#define BATTERY_PIN PIN_A0

0 commit comments

Comments
 (0)