allow heltec boards to boot without i2c when jtag debugging

1.2-legacy
geeksville 2020-02-04 07:31:32 -08:00
rodzic f2a731c22d
commit 4a40b9499b
6 zmienionych plików z 39 dodań i 27 usunięć

Wyświetl plik

@ -1,8 +1,7 @@
# High priority
* implement new ble characteristics
* have MeshService keep a node DB by sniffing user messages
* figure out why protobuf reads of Owner fail - possibly related to having the wrong number of chracterstics exported over bluetooth
* implement regen user and radio prefs
* figure out why protobuf reads of Owner fail - debug with jtag
* have meshservice send location data on mesh (if device has a GPS)
* implement getCurrentTime() - set based off gps but then updated locally
* confirm second device receives that gps message and updates device db
@ -65,3 +64,5 @@ until the phone pulls those packets. Ever so often power on bluetooth just so w
* test loopback tx/rx path code without using radio
* notify phone when rx packets arrive, currently the phone polls at startup only
* figure out if we can use PA_BOOST - yes, it seems to be on both boards
* implement new ble characteristics
* have MeshService keep a node DB by sniffing user messages

Wyświetl plik

@ -24,12 +24,12 @@ build_flags = -Wall -Wextra -Wno-missing-field-initializers -ggdb -O3 -Wl,-Map,.
; -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
upload_speed = 921600
upload_port = /dev/ttyUSB0
;upload_port = /dev/ttyUSB1
; the default is esptool
; upload_protocol = esp-prog
; monitor_port = /dev/ttyUSB0
;monitor_port = /dev/ttyUSB1
monitor_speed = 115200
# debug_tool = esp-prog
@ -47,3 +47,4 @@ lib_deps =
ESP8266_SSD1306
AXP202X_Library
SPI
Wire ; explicitly needed here because the AXP202 library forgets to add it

Wyświetl plik

@ -122,7 +122,6 @@ static ProtobufCharacteristic
meshMyNodeCharacteristic("ea9f3f82-8dc4-4733-9452-1f6da28892a2", BLECharacteristic::PROPERTY_READ, MyNodeInfo_fields, &myNodeInfo);
static OwnerCharacteristic meshOwnerCharacteristic;
static RadioCharacteristic meshRadioCharacteristic;
/**
@ -170,7 +169,7 @@ class BluetoothMeshCallbacks : public BLECharacteristicCallbacks
}
else
{
assert(0); // fixme not yet implemented
// we are uninterested in the other reads
}
}
@ -185,7 +184,7 @@ class BluetoothMeshCallbacks : public BLECharacteristicCallbacks
}
else
{
assert(0); // Not yet implemented
// we are uninterested in the other writes
}
}
};
@ -250,8 +249,8 @@ A variable keepAllPackets, if set to true will suppress this behavior and instea
*/
BLEService *createMeshBluetoothService(BLEServer *server)
{
// Create the BLE Service
BLEService *service = server->createService("6ba1b218-15a8-461f-9fa8-5dcae273eafd");
// Create the BLE Service, we need more than the default of 15 handles
BLEService *service = server->createService(BLEUUID("6ba1b218-15a8-461f-9fa8-5dcae273eafd"), 25, 0);
addWithDesc(service, &meshFromRadioCharacteristic, "fromRadio");
addWithDesc(service, &meshToRadioCharacteristic, "toRadio");
@ -271,5 +270,8 @@ BLEService *createMeshBluetoothService(BLEServer *server)
service->start();
server->getAdvertising()->addServiceUUID(service->getUUID());
Serial.println("*** Mesh service:");
service->dump();
return service;
}

Wyświetl plik

@ -115,8 +115,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#elif defined(HELTEC_LORA32)
#define HW_VENDOR "Heltec"
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
#define I2C_SDA 4
#define I2C_SCL 15
#endif
#define RESET_OLED 16

Wyświetl plik

@ -108,7 +108,10 @@ void doDeepSleep(uint64_t msecToWake)
Note: we don't isolate pins that are used for the LORA, LED, i2c, spi or the wake button
*/
static const uint8_t rtcGpios[] = {/* 0, */ 2,
/* 4, */ 12,13, /* 14, */ /* 15, */
/* 4, */
#ifndef USE_JTAG
12, 13, /* 14, */ /* 15, */
#endif
/* 25, */ 26, /* 27, */
32, 33, 34, 35, 36, 37, /* 38, */ 39};
@ -291,7 +294,6 @@ void initDeepSleep()
Serial.printf("booted, wake cause %d (boot count %d)\n", wakeCause, bootCount);
}
const char *getDeviceName()
{
uint8_t dmac[6];
@ -303,7 +305,6 @@ const char *getDeviceName()
return name;
}
void setup()
{
// Debug
@ -324,8 +325,10 @@ void setup()
digitalWrite(RESET_OLED, 1);
#endif
#ifdef I2C_SDA
Wire.begin(I2C_SDA, I2C_SCL);
scanI2Cdevice();
#endif
axp192Init();
@ -381,7 +384,8 @@ void loop()
#endif
#ifdef T_BEAM_V10
if(axp192_found) {
if (axp192_found)
{
// blink the axp led
axp.setChgLEDMode(ledon ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF);
}

Wyświetl plik

@ -109,6 +109,7 @@ void screen_update() {
}
void screen_setup() {
#ifdef I2C_SDA
// Display instance
display = new SSD1306Wire(SSD1306_ADDRESS, I2C_SDA, I2C_SCL);
display->init();
@ -117,6 +118,7 @@ void screen_setup() {
// Scroll buffer
display->setLogBuffer(5, 30);
#endif
}
void screen_loop() {