Browse Source

Fix seriously nasty linking errors

master
Starbeamrainbowlabs 2 years ago
parent
commit
1cf542adcd
  1. 2
      .gitignore
  2. 13
      iot/main/settings.custom.cpp.example
  3. 14
      iot/main/settings.custom.h
  4. 12
      iot/main/settings.h
  5. 4
      iot/main/transmission.cpp
  6. 4
      iot/main/transmission.h

2
.gitignore

@ -1,5 +1,5 @@
config.custom.h
settings.custom.h
settings.custom.cpp
Reports/*.pdf

13
iot/main/settings.custom.h.example → iot/main/settings.custom.cpp.example

@ -1,3 +1,9 @@
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include "settings.h"
// LoRaWAN NwkSKey, network session key
// This is the default Semtech key, which is used by the early prototype TTN
@ -11,3 +17,10 @@ static const u1_t PROGMEM APPSKEY[16] = { ..... };
// LoRaWAN end-device address (DevAddr)
static const u4_t DEVADDR = 0x....; // <-- Change this address for every node!
const lmic_pinmap lmic_pins = {
.nss = PIN_SPI_CS_RFM95,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {2, 6, 7},
};

14
iot/main/settings.custom.h

@ -0,0 +1,14 @@
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
/**
* Don't edit this file - you want to make a copy of settings.custom.cpp, call
* it settings.cpp, and edit that instead.
*/
extern const PROGMEM u1_t NWKSKEY[16];
extern const u1_t PROGMEM APPSKEY[16];
extern const u4_t DEVADDR;
extern const lmic_pinmap lmic_pins;

12
iot/main/settings.h

@ -8,8 +8,8 @@
/*
* This is the main settings file - customise it to match your setup.
* Don't forget that you need to take a copy of settings.custom.h.example as
* settings.custom.h, and fill in the private keys the program needs to talk
* Don't forget that you need to take a copy of settings.custom.cpp.example as
* settings.custom.cpp, and fill in the private keys the program needs to talk
* over LORaWAN.
*/
@ -34,13 +34,7 @@
// The SPI chip-select pin for the RFM 95
#define PIN_SPI_CS_RFM95 10
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = PIN_SPI_CS_RFM95,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {2, 6, 7},
};
// Pin mapping - see settings.custom.cpp
/////////////////////////////////

4
iot/main/radio.cpp → iot/main/transmission.cpp

@ -10,7 +10,7 @@ static bool is_sending_complete = false;
static osjob_t sendjob;
void radio_init() {
void transmit_init() {
// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
@ -66,7 +66,7 @@ void radio_init() {
* @param data The message to send.
* @param length The length of the given message.
*/
bool radio_send(uint8_t* data, int length) {
bool transmit_send(uint8_t* data, int length) {
// Check if there is not a current TX/RX job running
if (LMIC.opmode & OP_TXRXPEND) {
Serial.println(F("OP_TXRXPEND: There's already a job running, not sending"));

4
iot/main/radio.h → iot/main/transmission.h

@ -3,11 +3,11 @@
/**
* Initialises the RFM95 LoRa radio.
*/
void radio_init();
void transmit_init();
/**
* Sends a specified message via LoRaWAN.
* @param data The message to send.
* @param length The length of the given message.
*/
bool radio_send(byte* data, int length);
bool transmit_send(byte* data, int length);
Loading…
Cancel
Save