mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 06:06:23 +01:00
Added offline lines to TLSR FW, If the AP is not found the display will draw 5 lines to notify the user
This commit is contained in:
@@ -8,9 +8,19 @@
|
||||
#include "screen.h"
|
||||
#include "epd.h"
|
||||
|
||||
#define LINE_BYTE_COUNTER ((SCREEN_WIDTH/8)*5)// Draw 5 lines
|
||||
|
||||
RAM uint8_t onlineState = 1;
|
||||
uint32_t byteCounter = 0;
|
||||
void drawOnOffline(uint8_t state)
|
||||
{
|
||||
onlineState = state;
|
||||
}
|
||||
|
||||
static uint8_t mClutMap[256];
|
||||
void drawImageAtAddress(uint32_t addr, uint8_t lut)
|
||||
{
|
||||
byteCounter = 0;
|
||||
struct EepromImageHeader *eih = (struct EepromImageHeader *)mClutMap;
|
||||
eepromRead(addr, mClutMap, sizeof(struct EepromImageHeader));
|
||||
switch (eih->dataType)
|
||||
@@ -24,7 +34,11 @@ void drawImageAtAddress(uint32_t addr, uint8_t lut)
|
||||
{
|
||||
eepromRead(addr + sizeof(struct EepromImageHeader) + c, mClutMap, 256);
|
||||
}
|
||||
EPD_Display_byte(mClutMap[c % 256]);
|
||||
if (byteCounter < LINE_BYTE_COUNTER && onlineState == 0)
|
||||
EPD_Display_byte(0x55);
|
||||
else
|
||||
EPD_Display_byte(mClutMap[c % 256]);
|
||||
byteCounter++;
|
||||
}
|
||||
EPD_Display_color_change();
|
||||
for (uint32_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++)
|
||||
@@ -42,7 +56,11 @@ void drawImageAtAddress(uint32_t addr, uint8_t lut)
|
||||
{
|
||||
eepromRead(addr + sizeof(struct EepromImageHeader) + c, mClutMap, 256);
|
||||
}
|
||||
EPD_Display_byte(mClutMap[c % 256]);
|
||||
if (byteCounter < LINE_BYTE_COUNTER && onlineState == 0)
|
||||
EPD_Display_byte(0x55);
|
||||
else
|
||||
EPD_Display_byte(mClutMap[c % 256]);
|
||||
byteCounter++;
|
||||
}
|
||||
EPD_Display_color_change();
|
||||
for (uint32_t c = 0; c < (SCREEN_HEIGHT * (SCREEN_WIDTH / 8)); c++)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void drawOnOffline(uint8_t state);
|
||||
void drawImageAtAddress(uint32_t addr, uint8_t lut);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -233,7 +233,9 @@ int main(void)
|
||||
noApShown = true;
|
||||
if (curImgSlot != 0xFF)
|
||||
{
|
||||
drawOnOffline(0);
|
||||
drawImageFromEeprom(curImgSlot);
|
||||
drawOnOffline(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -248,7 +250,15 @@ int main(void)
|
||||
noApShown = false;
|
||||
our_ch = currentChannel;
|
||||
printf("AP Found\r\n");
|
||||
epd_display("AP Found", batteryVoltage, ownMacString, 1);
|
||||
if (curImgSlot != 0xFF)
|
||||
{
|
||||
drawOnOffline(1);
|
||||
drawImageFromEeprom(curImgSlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
epd_display("AP Found", batteryVoltage, ownMacString, 1);
|
||||
}
|
||||
scanAttempts = 0;
|
||||
wakeUpReason = WAKEUP_REASON_NETWORK_SCAN;
|
||||
initPowerSaving(INTERVAL_BASE);
|
||||
|
||||
@@ -484,7 +484,7 @@ static void getNumSlots()
|
||||
}
|
||||
static uint8_t findSlot(const uint8_t *ver)
|
||||
{
|
||||
//return 0xFF; // remove me! This forces the tag to re-download each and every upload without checking if it's already in the eeprom somewhere
|
||||
// return 0xFF; // remove me! This forces the tag to re-download each and every upload without checking if it's already in the eeprom somewhere
|
||||
uint32_t markerValid = EEPROM_IMG_VALID;
|
||||
for (uint8_t c = 0; c < imgSlots; c++)
|
||||
{
|
||||
@@ -837,6 +837,7 @@ bool processAvailDataInfo(struct AvailDataInfo *avail)
|
||||
|
||||
drawWithLut = avail->dataTypeArgument;
|
||||
wdt60s();
|
||||
drawOnOffline(1);
|
||||
drawImageFromEeprom(curImgSlot);
|
||||
return true;
|
||||
}
|
||||
@@ -851,6 +852,7 @@ bool processAvailDataInfo(struct AvailDataInfo *avail)
|
||||
sendXferComplete();
|
||||
|
||||
wdt60s();
|
||||
drawOnOffline(1);
|
||||
drawImageFromEeprom(curImgSlot);
|
||||
return true;
|
||||
}
|
||||
@@ -911,7 +913,7 @@ void test_firmware_writing()
|
||||
}
|
||||
}
|
||||
|
||||
_attribute_ram_code_ void write_ota_firmware_to_flash(void)
|
||||
_attribute_ram_code_ void write_ota_firmware_to_flash(void)
|
||||
{
|
||||
irq_disable();
|
||||
address = 0;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user