Skip to content

Commit

Permalink
Badge: default h/w board setting is REV_2 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Feb 19, 2021
1 parent 4238a09 commit f57714c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 32 deletions.
Binary file not shown.
3 changes: 2 additions & 1 deletion software/firmware/source/SoftRF/src/driver/Bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,8 @@ void nRF52_Bluetooth_setup()
// Configure and Start Device Information Service
bledis.setManufacturer("SoftRF");
bledis.setModel("Badge Edition");
bledis.setHardwareRev("2020-08-15");
bledis.setHardwareRev(hw_info.revision == 0 ? "2020-8-6" :
hw_info.revision == 1 ? "2020-12-12" : "2021-1-15");
bledis.setSoftwareRev(SOFTRF_FIRMWARE_VERSION);
bledis.begin();

Expand Down
38 changes: 8 additions & 30 deletions software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ static struct rst_info reset_info = {

static uint32_t bootCount = 0;

static nRF52_board_id nRF52_board = NRF52_NORDIC_PCA10059; /* default */
static nRF52_board_id nRF52_board = NRF52_LILYGO_TECHO_REV_2; /* default */
//static nRF52_board_id nRF52_board = NRF52_LILYGO_TECHO_REV_0;

PCF8563_Class *rtc = nullptr;
I2CBus *i2c = nullptr;
Expand Down Expand Up @@ -148,7 +149,7 @@ static Adafruit_SPIFlash *SPIFlash = NULL;
#define MX25R1635F \
{ \
.total_size = (1 << 21), /* 2 MiB */ \
.start_up_time_us = 5000, .manufacturer_id = 0xc2, \
.start_up_time_us = 5000, .manufacturer_id = 0xc2, \
.memory_type = 0x28, .capacity = 0x15, .max_clock_speed_mhz = 8, \
.quad_enable_bit_mask = 0x40, .has_sector_protection = false, \
.supports_fast_read = true, .supports_qspi = true, \
Expand Down Expand Up @@ -275,41 +276,18 @@ static void nRF52_setup()
#endif

digitalWrite(SOC_GPIO_PIN_IO_PWR, HIGH);
digitalWrite(SOC_GPIO_PIN_3V3_PWR, LOW); /* PWR_EN is OFF */
pinMode(SOC_GPIO_PIN_3V3_PWR, OUTPUT);
delay(100);
pinMode(SOC_GPIO_PIN_IO_PWR, OUTPUT); /* VDD_POWR is ON */
digitalWrite(SOC_GPIO_PIN_3V3_PWR, INPUT);

if (SoC->Battery_voltage() > BATTERY_THRESHOLD_INVALID) { /* VBUS is ON */
nRF52_board = NRF52_LILYGO_TECHO_REV_0;
pinMode(SOC_GPIO_PIN_IO_PWR, OUTPUT); /* VDD_POWR is ON */
pinMode(SOC_GPIO_PIN_3V3_PWR, INPUT);
} else {
pinMode(SOC_GPIO_PIN_IO_PWR, OUTPUT); /* VDD_POWR is ON */
delay(100);

if (SoC->Battery_voltage() > BATTERY_THRESHOLD_INVALID) {
nRF52_board = NRF52_LILYGO_TECHO_REV_0;
pinMode(SOC_GPIO_PIN_3V3_PWR, INPUT);
} else {
digitalWrite(SOC_GPIO_PIN_3V3_PWR, HIGH); /* PWR_EN is ON */
delay(100);

if (SoC->Battery_voltage() > BATTERY_THRESHOLD_INVALID) {
nRF52_board = NRF52_LILYGO_TECHO_REV_2;
} else {
pinMode(SOC_GPIO_PIN_3V3_PWR, INPUT);
pinMode(SOC_GPIO_PIN_IO_PWR, INPUT);
}
}
}
delay(200);

Wire.setPins(SOC_GPIO_PIN_SDA, SOC_GPIO_PIN_SCL);

Wire.begin();
Wire.beginTransmission(PCF8563_SLAVE_ADDRESS);
nRF52_has_rtc = (Wire.endTransmission() == 0);
if (nRF52_has_rtc) {
hw_info.model = SOFTRF_MODEL_BADGE;
if (!nRF52_has_rtc) {
nRF52_board = NRF52_NORDIC_PCA10059;
}

if (nRF52_board == NRF52_LILYGO_TECHO_REV_0) {
Expand Down
2 changes: 1 addition & 1 deletion software/firmware/source/SoftRF/src/ui/Baro_EPD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void EPD_baro_loop()

display->setFont(&FreeMono12pt7b);

x = 7 * display->width() / 10;
x = 8 * display->width() / 10;

display->setCursor(x, (3 * display->height() / 10));
display->print("M");
Expand Down

0 comments on commit f57714c

Please sign in to comment.