mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 17:13:38 +00:00
Posthumous tronk
Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
This commit is contained in:
parent
4024bfdeeb
commit
ea72abff22
@ -72,22 +72,24 @@ static unsigned char userprefs_admin_key_2[] = USERPREFS_USE_ADMIN_KEY_2;
|
||||
|
||||
#ifdef HELTEC_MESH_NODE_T114
|
||||
|
||||
uint32_t read8(uint8_t bits, uint8_t dummy,uint8_t cs,uint8_t sck,uint8_t mosi,uint8_t dc,uint8_t rst)
|
||||
uint32_t read8(uint8_t bits, uint8_t dummy, uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst)
|
||||
{
|
||||
uint32_t ret = 0;
|
||||
uint8_t SDAPIN = mosi;
|
||||
pinMode(SDAPIN, INPUT_PULLUP);
|
||||
digitalWrite(dc, HIGH);
|
||||
for (int i = 0; i < dummy; i++) { //any dummy clocks
|
||||
for (int i = 0; i < dummy; i++) { // any dummy clocks
|
||||
digitalWrite(sck, HIGH);
|
||||
delay(1);
|
||||
digitalWrite(sck, LOW);
|
||||
delay(1);
|
||||
}
|
||||
for (int i = 0; i < bits; i++) { // read results
|
||||
for (int i = 0; i < bits; i++) { // read results
|
||||
ret <<= 1;
|
||||
delay(1);
|
||||
if (digitalRead(SDAPIN)) ret |= 1;;
|
||||
if (digitalRead(SDAPIN))
|
||||
ret |= 1;
|
||||
;
|
||||
digitalWrite(sck, HIGH);
|
||||
delay(1);
|
||||
digitalWrite(sck, LOW);
|
||||
@ -95,11 +97,11 @@ uint32_t read8(uint8_t bits, uint8_t dummy,uint8_t cs,uint8_t sck,uint8_t mosi,u
|
||||
return ret;
|
||||
}
|
||||
|
||||
void write9(uint8_t val, uint8_t dc_val,uint8_t cs,uint8_t sck,uint8_t mosi,uint8_t dc,uint8_t rst)
|
||||
void write9(uint8_t val, uint8_t dc_val, uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst)
|
||||
{
|
||||
pinMode(mosi, OUTPUT);
|
||||
digitalWrite(dc, dc_val);
|
||||
for (int i = 0; i < 8; i++) { //send command
|
||||
for (int i = 0; i < 8; i++) { // send command
|
||||
digitalWrite(mosi, (val & 0x80) != 0);
|
||||
delay(1);
|
||||
digitalWrite(sck, HIGH);
|
||||
@ -109,16 +111,16 @@ void write9(uint8_t val, uint8_t dc_val,uint8_t cs,uint8_t sck,uint8_t mosi,uint
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t readwrite8(uint8_t cmd, uint8_t bits, uint8_t dummy,uint8_t cs,uint8_t sck,uint8_t mosi,uint8_t dc,uint8_t rst)
|
||||
uint32_t readwrite8(uint8_t cmd, uint8_t bits, uint8_t dummy, uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst)
|
||||
{
|
||||
digitalWrite(cs, LOW);
|
||||
write9(cmd, 0,cs,sck,mosi,dc,rst);
|
||||
uint32_t ret = read8(bits, dummy,cs,sck,mosi,dc,rst);
|
||||
write9(cmd, 0, cs, sck, mosi, dc, rst);
|
||||
uint32_t ret = read8(bits, dummy, cs, sck, mosi, dc, rst);
|
||||
digitalWrite(cs, HIGH);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t get_st7789_id(uint8_t cs,uint8_t sck,uint8_t mosi,uint8_t dc,uint8_t rst)
|
||||
uint32_t get_st7789_id(uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst)
|
||||
{
|
||||
pinMode(cs, OUTPUT);
|
||||
digitalWrite(cs, HIGH);
|
||||
@ -127,14 +129,14 @@ uint32_t get_st7789_id(uint8_t cs,uint8_t sck,uint8_t mosi,uint8_t dc,uint8_t rs
|
||||
pinMode(mosi, OUTPUT);
|
||||
pinMode(dc, OUTPUT);
|
||||
pinMode(rst, OUTPUT);
|
||||
digitalWrite(rst, LOW); //Hardware Reset
|
||||
digitalWrite(rst, LOW); // Hardware Reset
|
||||
delay(10);
|
||||
digitalWrite(rst, HIGH);
|
||||
delay(10);
|
||||
|
||||
uint32_t ID = 0;
|
||||
ID = readwrite8(0x04, 24, 1,cs,sck,mosi,dc,rst);
|
||||
ID = readwrite8(0x04, 24, 1,cs,sck,mosi,dc,rst); //ST7789 needs twice
|
||||
ID = readwrite8(0x04, 24, 1, cs, sck, mosi, dc, rst);
|
||||
ID = readwrite8(0x04, 24, 1, cs, sck, mosi, dc, rst); // ST7789 needs twice
|
||||
return ID;
|
||||
}
|
||||
|
||||
@ -560,9 +562,8 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
|
||||
defined(HX8357_CS) || defined(USE_ST7789)
|
||||
bool hasScreen = true;
|
||||
#ifdef HELTEC_MESH_NODE_T114
|
||||
uint32_t st7789_id=get_st7789_id(ST7789_NSS,ST7789_SCK,ST7789_SDA,ST7789_RS,ST7789_RESET);
|
||||
if(st7789_id==0xFFFFFF)
|
||||
{
|
||||
uint32_t st7789_id = get_st7789_id(ST7789_NSS, ST7789_SCK, ST7789_SDA, ST7789_RS, ST7789_RESET);
|
||||
if (st7789_id == 0xFFFFFF) {
|
||||
hasScreen = false;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user