Browse Source

Ikoka Stick: Move to unified code naming conventions

pull/812/head
kelsey hudson 9 months ago
parent
commit
9d009074da
  1. 15
      variants/ikoka_stick_nrf/IkokaStickNRFBoard.cpp
  2. 6
      variants/ikoka_stick_nrf/IkokaStickNRFBoard.h
  3. 2
      variants/ikoka_stick_nrf/target.cpp
  4. 4
      variants/ikoka_stick_nrf/target.h

15
variants/ikoka_stick_nrf/ikoka_stick_nrf_board.cpp → variants/ikoka_stick_nrf/IkokaStickNRFBoard.cpp

@ -1,28 +1,26 @@
#ifdef XIAO_NRF52 #ifdef XIAO_NRF52
#include <Arduino.h> #include <Arduino.h>
#include "ikoka_stick_nrf_board.h" #include "IkokaStickNRFBoard.h"
#include <bluefruit.h> #include <bluefruit.h>
#include <Wire.h> #include <Wire.h>
static BLEDfu bledfu; static BLEDfu bledfu;
static void connect_callback(uint16_t conn_handle) static void connect_callback(uint16_t conn_handle) {
{
(void)conn_handle; (void)conn_handle;
MESH_DEBUG_PRINTLN("BLE client connected"); MESH_DEBUG_PRINTLN("BLE client connected");
} }
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
{
(void)conn_handle; (void)conn_handle;
(void)reason; (void)reason;
MESH_DEBUG_PRINTLN("BLE client disconnected"); MESH_DEBUG_PRINTLN("BLE client disconnected");
} }
void ikoka_stick_nrf_board::begin() { void IkokaStickNRFBoard::begin() {
// for future use, sub-classes SHOULD call this from their begin() // for future use, sub-classes SHOULD call this from their begin()
startup_reason = BD_STARTUP_NORMAL; startup_reason = BD_STARTUP_NORMAL;
@ -50,7 +48,7 @@ void ikoka_stick_nrf_board::begin() {
delay(10); // give sx1262 some time to power up delay(10); // give sx1262 some time to power up
} }
bool ikoka_stick_nrf_board::startOTAUpdate(const char* id, char reply[]) { bool IkokaStickNRFBoard::startOTAUpdate(const char *id, char reply[]) {
// Config the peripheral connection with maximum bandwidth // Config the peripheral connection with maximum bandwidth
// more SRAM required by SoftDevice // more SRAM required by SoftDevice
// Note: All config***() function must be called before begin() // Note: All config***() function must be called before begin()
@ -91,9 +89,6 @@ bool ikoka_stick_nrf_board::startOTAUpdate(const char* id, char reply[]) {
strcpy(reply, "OK - started"); strcpy(reply, "OK - started");
return true; return true;
return false;
} }
#endif #endif

6
variants/ikoka_stick_nrf/ikoka_stick_nrf_board.h → variants/ikoka_stick_nrf/IkokaStickNRFBoard.h

@ -5,7 +5,7 @@
#ifdef XIAO_NRF52 #ifdef XIAO_NRF52
class ikoka_stick_nrf_board : public mesh::MainBoard { class IkokaStickNRFBoard : public mesh::MainBoard {
protected: protected:
uint8_t startup_reason; uint8_t startup_reason;
@ -46,7 +46,7 @@ public:
return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096; return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096;
} }
const char* getManufacturerName() const override { const char *getManufacturerName() const override {
return MANUFACTURER_STRING; return MANUFACTURER_STRING;
} }
@ -54,7 +54,7 @@ public:
NVIC_SystemReset(); NVIC_SystemReset();
} }
bool startOTAUpdate(const char* id, char reply[]) override; bool startOTAUpdate(const char *id, char reply[]) override;
}; };
#endif #endif

2
variants/ikoka_stick_nrf/target.cpp

@ -2,7 +2,7 @@
#include "target.h" #include "target.h"
#include <helpers/ArduinoHelpers.h> #include <helpers/ArduinoHelpers.h>
ikoka_stick_nrf_board board; IkokaStickNRFBoard board;
#ifdef DISPLAY_CLASS #ifdef DISPLAY_CLASS
DISPLAY_CLASS display; DISPLAY_CLASS display;

4
variants/ikoka_stick_nrf/target.h

@ -3,7 +3,7 @@
#define RADIOLIB_STATIC_ONLY 1 #define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h> #include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h> #include <helpers/radiolib/RadioLibWrappers.h>
#include <ikoka_stick_nrf_board.h> #include <IkokaStickNRFBoard.h>
#include <helpers/radiolib/CustomSX1262Wrapper.h> #include <helpers/radiolib/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h> #include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/ArduinoHelpers.h> #include <helpers/ArduinoHelpers.h>
@ -16,7 +16,7 @@
extern MomentaryButton user_btn; extern MomentaryButton user_btn;
#endif #endif
extern ikoka_stick_nrf_board board; extern IkokaStickNRFBoard board;
extern WRAPPER_CLASS radio_driver; extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock; extern AutoDiscoverRTCClock rtc_clock;
extern EnvironmentSensorManager sensors; extern EnvironmentSensorManager sensors;

Loading…
Cancel
Save