diff --git a/variants/nrf52840/meshlink/platformio.ini b/variants/nrf52840/meshlink/platformio.ini index 3b12836b397..1395e2b115e 100644 --- a/variants/nrf52840/meshlink/platformio.ini +++ b/variants/nrf52840/meshlink/platformio.ini @@ -1,5 +1,6 @@ ; MeshLink board developed by LoraItalia. NRF52840, eByte E22900M22S (Will also come with other frequencies), 25w MPPT solar charger (5v,12v,18v selectable), support for gps, buzzer, oled or e-ink display, 10 gpios, hardware watchdog -; https://www.loraitalia.it +; https://www.loraitalia.it/meshlink + ; firmware for boards with or without oled display [env:meshlink] extends = nrf52840_base @@ -35,12 +36,12 @@ build_flags = ${nrf52840_base.build_flags} -D EINK_WIDTH=250 -D EINK_HEIGHT=122 -D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk - -D EINK_LIMIT_FASTREFRESH=5 ; How many consecutive fast-refreshes are permitted + -D EINK_LIMIT_FASTREFRESH=100 ; How many consecutive fast-refreshes are permitted -D EINK_LIMIT_RATE_BACKGROUND_SEC=30 ; Minimum interval between BACKGROUND updates -D EINK_LIMIT_RATE_RESPONSIVE_SEC=1 ; Minimum interval between RESPONSIVE updates - -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated - -D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. - -D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear + ; -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + ; -D EINK_BACKGROUND_USES_FAST ; (Optional) Use FAST refresh for both BACKGROUND and RESPONSIVE, until a limit is reached. + ; -D EINK_HASQUIRK_VICIOUSFASTREFRESH ; Identify that pixels drawn by fast-refresh are harder to clear build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/meshlink> diff --git a/variants/nrf52840/meshlink/variant.cpp b/variants/nrf52840/meshlink/variant.cpp index f35bbd1afb1..50b62e28271 100644 --- a/variants/nrf52840/meshlink/variant.cpp +++ b/variants/nrf52840/meshlink/variant.cpp @@ -12,10 +12,9 @@ const uint32_t g_ADigitalPinMap[] = { void initVariant() { - pinMode(PIN_LED1, OUTPUT); - digitalWrite(PIN_LED1, HIGH); // turn off the white led while booting + pinMode(LED_HEARTBEAT, OUTPUT); + digitalWrite(LED_HEARTBEAT, HIGH); // turn off the white led while booting // otherwise it will stay lit for several seconds (could be annoying) - #ifdef PIN_WD_EN pinMode(PIN_WD_EN, OUTPUT); digitalWrite(PIN_WD_EN, HIGH); // Enable the Watchdog at boot diff --git a/variants/nrf52840/meshlink/variant.h b/variants/nrf52840/meshlink/variant.h index 11f56eac827..f9a292be402 100644 --- a/variants/nrf52840/meshlink/variant.h +++ b/variants/nrf52840/meshlink/variant.h @@ -25,17 +25,15 @@ extern "C" { #define NUM_ANALOG_INPUTS (2) #define NUM_ANALOG_OUTPUTS (0) -#define BUTTON_PIN (-1) // If defined, this will be used for user button presses, +#define BUTTON_PIN (10) // If defined, this will be used for user button presses, #define BUTTON_NEED_PULLUP // LEDs -#define PIN_LED1 (24) // Built in white led for status -#define LED_BLUE PIN_LED1 - -#define LED_STATE_ON 0 // State when LED is lit +#define LED_HEARTBEAT (24) // Force strictly heartbeat on Pin 24 +#define LED_STATE_ON 0 // Active LOW // Testing USB detection -// #define NRF_APM +//#define NRF_APM /* * Analog pins @@ -50,8 +48,8 @@ extern "C" { /* * Serial interfaces */ -#define PIN_SERIAL1_RX (32 + 8) -#define PIN_SERIAL1_TX (7) +#define PIN_SERIAL1_TX (32 + 8) +#define PIN_SERIAL1_RX (7) #define SERIAL_PRINT_PORT 0 /* @@ -126,12 +124,15 @@ static const uint8_t SCK = PIN_SPI_SCK; // #define GPS_THREAD_INTERVAL 50 // Define pin to enable GPS toggle (set GPIO to LOW) via user button triple press -#define PIN_GPS_EN (0) +#define PIN_GPS_EN (4) #define GPS_EN_ACTIVE LOW #define PIN_BUZZER (31) // P0.31/AIN7 + // Battery +//our INA219 is reversed (+ sign when discharging and - when charging) +#define INA219_MULTIPLIER -1.0f //with this we fix the sign shown // The battery sense is hooked to pin A0 (2) #define BATTERY_PIN (2) // and has 12 bit resolution