63 files changed
+23
-22077
No files matched your search
@@ -163,14 +163,6 @@ void state_save(const uint8_t *state_buffer, uint32_t length) {
|
||||
// ...
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Load library config from non-volatile memory
|
||||
*
|
||||
* @param[in,out] config_buffer buffer to hold the loaded state string
|
||||
* @param[in] n_buffer size of the allocated state buffer
|
||||
*
|
||||
* @return number of bytes copied to config_buffer
|
||||
*/
|
||||
uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer) {
|
||||
|
||||
// Load a library config from non-volatile memory, if available.
|
||||
@@ -181,12 +173,6 @@ uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer) {
|
||||
return sizeof(bsec_config_iaq);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Interrupt handler for press of a ULP plus button
|
||||
*
|
||||
* @return none
|
||||
*/
|
||||
|
||||
void user_delay_ms(uint32_t period) { vTaskDelay(period / portTICK_PERIOD_MS); }
|
||||
|
||||
int64_t get_timestamp_us() { return (int64_t)millis() * 1000; }
|
||||
|
||||
+17
-8
@@ -9,26 +9,34 @@ static const char TAG[] = "lora";
|
||||
osjob_t sendjob;
|
||||
QueueHandle_t LoraSendQueue;
|
||||
|
||||
// LMIC enhanced Pin mapping
|
||||
class MyHalConfig_t : public Arduino_LMIC::HalConfiguration_t {
|
||||
|
||||
public:
|
||||
MyHalConfig_t(){};
|
||||
virtual void begin(void) override {
|
||||
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||
}
|
||||
};
|
||||
|
||||
MyHalConfig_t myHalConfig{};
|
||||
|
||||
// LMIC pin mapping
|
||||
const lmic_pinmap lmic_pins = {
|
||||
.nss = LORA_CS,
|
||||
.rxtx = LMIC_UNUSED_PIN,
|
||||
.rst = LORA_RST,
|
||||
.dio = {LORA_IRQ, LORA_IO1, LORA_IO2},
|
||||
.mosi = LORA_MOSI,
|
||||
.miso = LORA_MISO,
|
||||
.sck = LORA_SCK
|
||||
// optional: set polarity of rxtx pin.
|
||||
//.rxtx_rx_active = 0,
|
||||
.rxtx_rx_active = 0,
|
||||
// optional: set RSSI cal for listen-before-talk
|
||||
// this value is in dB, and is added to RSSI
|
||||
// measured prior to decision.
|
||||
// Must include noise guardband! Ignored in US,
|
||||
// EU, IN, other markets where LBT is not required.
|
||||
//.rssi_cal = 0,
|
||||
.rssi_cal = 0,
|
||||
// optional: override LMIC_SPI_FREQ if non-zero
|
||||
//.spi_freq = 0,
|
||||
};
|
||||
.spi_freq = 0,
|
||||
.pConfig = &myHalConfig};
|
||||
|
||||
// DevEUI generator using devices's MAC address
|
||||
void gen_lora_deveui(uint8_t *pdeveui) {
|
||||
@@ -366,6 +374,7 @@ esp_err_t lora_stack_init() {
|
||||
SEND_QUEUE_SIZE * PAYLOAD_BUFFER_SIZE);
|
||||
|
||||
ESP_LOGI(TAG, "Starting LMIC...");
|
||||
|
||||
os_init(); // initialize lmic run-time environment on core 1
|
||||
LMIC_reset(); // initialize lmic MAC
|
||||
LMIC_setLinkCheckMode(0);
|
||||
|
||||
Reference in new issue
Block a user