fixed offset... (finally)

This commit is contained in:
Jelmer
2023-02-02 00:49:49 +01:00
parent cd7feb34df
commit cdd93df117
2 changed files with 17 additions and 4 deletions

View File

@@ -1,8 +1,10 @@
#include "drawing.h"
#include <stdbool.h>
#include "asmUtil.h"
#include "board.h"
#include "cpu.h"
#include "drawing.h"
#include "eeprom.h"
#include "epd.h"
#include "printf.h"
@@ -318,9 +320,9 @@ static void drawPrvDecodeImageOnce(void) {
}
}
static uint8_t __xdata prev, step = 0;
void ByteDecode(uint8_t byte) {
static uint8_t __xdata prev, step = 0;
prev <<= 2;
prev |= (mColorMap[mPassNo][byte >> 4] << 1) | mColorMap[mPassNo][byte & 0x0f];
if (++step == 4) {
@@ -344,11 +346,15 @@ void drawImageAtAddress(uint32_t addr) {
mPassNo = 0;
beginFullscreenImage();
beginWriteFramebuffer(EPD_COLOR_BLACK);
prev = 0;
step = 0;
drawPrvDecodeImageOnce();
endWriteFramebuffer();
mPassNo++;
beginFullscreenImage();
beginWriteFramebuffer(EPD_COLOR_RED);
prev = 0;
step = 0;
drawPrvDecodeImageOnce();
endWriteFramebuffer();

View File

@@ -18,6 +18,8 @@
#include "userinterface.h"
#include "wdt.h"
//#define DEBUG_MODE
uint8_t showChannelSelect() {
uint8_t __xdata result[16];
memset(result, 0, sizeof(result));
@@ -79,7 +81,7 @@ void mainProtocolLoop(void) {
eepromDeepPowerDown();
// initialize Powers-saving-attempt-array with the default value;
initPowerSaving();
#ifndef DEBUG_MODE
// show the splashscreen
showSplashScreen();
@@ -91,10 +93,15 @@ void mainProtocolLoop(void) {
// couldn't find an AP :()
showNoAP();
} else {
radioSetChannel(currentChannel);
// Found an AP.
showAPFound();
}
#endif
#ifdef DEBUG_MODE
initRadio();
currentChannel = 11;
#endif
epdEnterSleep();
P1CHSTA &= ~(1 << 0);