diff --git a/PCB/Moonshine_MV.eprj2 b/PCB/Moonshine_MV.eprj2 index 22a1851..329ffbf 100644 Binary files a/PCB/Moonshine_MV.eprj2 and b/PCB/Moonshine_MV.eprj2 differ diff --git a/PCB/Moonshine_PCB.eprj2 b/PCB/Moonshine_PCB.eprj2 index b4540b4..cef4cf2 100644 Binary files a/PCB/Moonshine_PCB.eprj2 and b/PCB/Moonshine_PCB.eprj2 differ diff --git a/code/firmware-2.7.15.567b8ea/src/mesh/RadioInterface.cpp b/code/firmware-2.7.15.567b8ea/src/mesh/RadioInterface.cpp index 3c0da44..c0968fd 100644 --- a/code/firmware-2.7.15.567b8ea/src/mesh/RadioInterface.cpp +++ b/code/firmware-2.7.15.567b8ea/src/mesh/RadioInterface.cpp @@ -58,7 +58,7 @@ const RegionInfo regions[] = { /* https://lora-alliance.org/wp-content/uploads/2020/11/lorawan_regional_parameters_v1.0.3reva_0.pdf */ - RDEF(CN, 470.0f, 510.0f, 100, 0, 19, true, false, false), + RDEF(CN, 470.0f, 510.0f, 100, 0, SETTING_MAX_POWER, true, false, false), /* https://lora-alliance.org/wp-content/uploads/2020/11/lorawan_regional_parameters_v1.0.3reva_0.pdf diff --git a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/pins_arduino.h b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/pins_arduino.h index a717a37..7304e82 100644 --- a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/pins_arduino.h +++ b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/pins_arduino.h @@ -6,8 +6,8 @@ static const uint8_t TX = 21; static const uint8_t RX = 20; -static const uint8_t SDA = 1; -static const uint8_t SCL = 0; +static const uint8_t SDA = 12; +static const uint8_t SCL = 13; static const uint8_t SS = 8; static const uint8_t MOSI = 7; diff --git a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/platformio.ini b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/platformio.ini index 9db1b38..0626c23 100644 --- a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/platformio.ini +++ b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/platformio.ini @@ -9,6 +9,8 @@ build_flags = ${esp32c3_base.build_flags} -D PRIVATE_HW -I variants/esp32c3/diy/esp32c3_moonshine + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 monitor_speed = 115200 upload_protocol = esptool ;upload_port = /dev/ttyUSB0 diff --git a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/variant.h b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/variant.h index 5576077..8c32cf8 100644 --- a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/variant.h +++ b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine/variant.h @@ -4,17 +4,30 @@ // https://resource.heltec.cn/download/HT-CT62/HT-CT62_Reference_Design.pdf // https://resource.heltec.cn/download/HT-DEV-ESP/HT-DEV-ESP_V3_Sch.pdf +#define HAS_SCREEN 0 -#define LED_POWER 12 // LED +#define HAS_I2C 0 +#define WIRE_INTERFACES_COUNT (0) +#define I2C_SDA 12 +#define I2C_SCL 13 + + + +#define BATTERY_PIN 1 +#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_MULTIPLIER 2.0f + +#define LED_POWER 0 // LED #define LED_STATE_ON 1 // State when LED is lit -#define HAS_SCREEN 0 + #define HAS_GPS 0 #undef GPS_RX_PIN #undef GPS_TX_PIN -#define E220_400M30S +//#define E220_400M30S //#define E220_400M33S +#define E22_400M33S #ifdef E220_400M30S #define SETTING_MAX_POWER 30 @@ -22,10 +35,10 @@ #define SX126X_MAX_POWER 22 #endif -#ifdef E220_400M33S +#ifdef E22_400M33S #define SETTING_MAX_POWER 33 -#define TX_GAIN_LORA 25 -#define SX126X_MAX_POWER 8 +#define TX_GAIN_LORA 12 +#define SX126X_MAX_POWER 21 #endif #define USE_LLCC68 diff --git a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine_mv/variant.h b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine_mv/variant.h index 77f4555..d1de630 100644 --- a/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine_mv/variant.h +++ b/code/firmware-2.7.15.567b8ea/variants/esp32c3/diy/esp32c3_moonshine_mv/variant.h @@ -23,6 +23,21 @@ #define GPS_POWER_TOGGLE 1 #define PIN_GPS_EN 12 +#define HAS_PCF8574_BUTTON +#define PCF8574_ADDR 0x27 +#define PCF8574_INT_PIN 9 + +#define PCF8574_BUTTON_MAP { \ + INPUT_BROKER_SELECT, /* P0: 确定 */ \ + INPUT_BROKER_DOWN, /* P1: 下 */ \ + INPUT_BROKER_UP, /* P2: 上 */ \ + INPUT_BROKER_LEFT, /* P3: 左 */ \ + INPUT_BROKER_RIGHT, /* P4: 右 */ \ + INPUT_BROKER_SELECT, /* P5: 确定 */ \ + INPUT_BROKER_CANCEL, /* P6: 取消 */ \ + INPUT_BROKER_NONE, /* P7: 未使用 */ \ +} + #define BATTERY_PIN 2 #define ADC_CHANNEL ADC1_GPIO2_CHANNEL