46 Commits

Author SHA1 Message Date
Nic Limper
a5d7282958 update tagtypes for M3 0027 firmware 2024-03-04 19:46:17 +01:00
jjwbruijn
f233d90b86 M3 Universal v0027 2024-03-04 19:04:15 +01:00
Nic Limper
739625f1c8 Squashed commit of the following:
commit d41ab4b27c
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 13:16:15 2024 +0100

    remove subghz in platformio.ini

commit dfa1a5cecd
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 13:15:14 2024 +0100

    Revert "Disable SubGhz support until C6 side is ready."

    This reverts commit 3bc96dc48e.

commit cdd26072fd
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 13:14:46 2024 +0100

    Revert "Merge remote-tracking branch 'mine/oepl_pr_1' into oepl_pr_1"

    This reverts commit 39b1938263, reversing
    changes made to 3bc96dc48e.

commit 39b1938263
Merge: 3bc96dc4 2b62dff5
Author: Skip Hansen <skip@gfrn.org>
Date:   Mon Mar 4 03:54:35 2024 -0800

    Merge remote-tracking branch 'mine/oepl_pr_1' into oepl_pr_1

commit 3bc96dc48e
Author: Skip Hansen <skip@gfrn.org>
Date:   Mon Mar 4 03:43:12 2024 -0800

    Disable SubGhz support until C6 side is ready.

commit 2b62dff5f5
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 11:44:06 2024 +0100

    fix gzip wwwfiles

    to prevent unchanged gzipped files showing up in the commit

commit 0864870540
Author: Skip Hansen <skip@gfrn.org>
Date:   Sun Mar 3 16:46:53 2024 -0800

    Added SubGhz channel support to AP Web GUI.
2024-03-04 13:21:58 +01:00
Jan-Henrik Bruhn
b527d3e57d Fix openepaperlink.eu proxy on https proxies (#251) 2024-03-04 12:03:55 +01:00
Cougar
ba82ab8628 Add Estonian language (#254) 2024-03-04 11:51:49 +01:00
Jelmer
085a642ed2 New M3 types by VstudioLAB 2024-03-04 11:39:45 +01:00
jjwbruijn
e2870825cf 88MZ100 v0028 - bugfix and commands 2024-03-03 21:56:00 +01:00
jjwbruijn
a4bdb4acab FW Pack for autoflasher 2024-03-02 12:13:05 +01:00
Jelmer
058016d208 Update tagotaversions.json 2024-03-02 02:58:30 +01:00
Jelmer
b14cd3909c Update tagotaversions.json - test 2024-03-02 02:40:14 +01:00
jjwbruijn
cd09a53e02 v0027 M2 ZBS Binaries 2024-03-02 02:09:27 +01:00
jjwbruijn
6bdf99a8e7 v0027 M2 ZBS243, fixes inadvertent redraw 2024-03-01 14:02:37 +01:00
Jelmer
1b256c3fba Create README.md 2024-03-01 01:41:27 +01:00
Jelmer
ec217a94d0 Merge branch 'master' of https://github.com/jjwbruijn/OpenEPaperLink 2024-03-01 01:29:34 +01:00
Jelmer
2b99ce7139 MiniAP V3 Case 2024-03-01 01:29:26 +01:00
Nic Limper
f6a8fa3d4d added Dansk (thanks Cokeman), added Nebular 213 templates, removed flasher icon in S2 based AP's 2024-02-29 17:37:35 +01:00
Jelmer
294ed5bd28 Create README.md 2024-02-29 17:08:54 +01:00
Jelmer
92c5d60cf8 Nano C6 case 2024-02-29 16:59:54 +01:00
leXorNet
7ca5461c33 Increased language count cap from 8 to 9 to support the latest language (#250) 2024-02-29 00:19:49 +01:00
Jelmer
aebbb22cde Update oepl-definitions.h 2024-02-28 20:03:10 +01:00
Nic Limper
14e96c72f7 bugfix miniAP doesn't display channel 27 2024-02-28 08:16:47 +01:00
Nic Limper
ebd1adc0d5 gzipped www files 2024-02-28 01:20:37 +01:00
Nic Limper
f4cb642142 add Denmark to dayahead electricity prices; enable it also for 2.9" UC8151 2024-02-28 01:11:01 +01:00
Nic Limper
9b2d76a6b6 bugfix: idlereq should not be queued, and only sent when queue is empty 2024-02-28 01:09:00 +01:00
leXorNet
ac979a3c52 Added Swedish content language (#245) 2024-02-27 12:11:13 +01:00
Jan-Henrik Bruhn
a606c4c1aa Use relative paths for fetch calls and websocket (#243)
This allows the OEPL Frontend to be put behind a reverse proxy like Home
Assistant Ingress to proxy it behind a relative path.
2024-02-27 01:47:36 +01:00
Jelmer
c22fe0d91b Merge pull request #241 from TheRealMrSteel/patch-1
Update content_cards.json
2024-02-27 00:37:42 +01:00
Jelmer
b29907a725 Merge pull request #242 from VstudioLAB/M3_58-26-29FREEZER
M3 58 26 29 freezer
2024-02-27 00:36:03 +01:00
Jelmer
8da475901d Support for rotating generated images based on tagtype profile 2024-02-27 00:32:09 +01:00
Vstudio LAB
e4ed0b13db Delete ARM_Tag_FW/Newton_M3_nRF52811/$PROJECT_DIR directory 2024-02-26 22:55:48 +01:00
VstudioLAB
0ffd0fbf0e Update .gitignore 2024-02-26 22:49:03 +01:00
Steel
1cba70b9cc Update content_cards.json
typo in id19
2024-02-26 22:47:50 +01:00
VstudioLAB
6b67f6df2b updates 2024-02-26 22:24:48 +01:00
Nic Limper
b9fe72de5c small bugfixes 2024-02-26 20:58:46 +01:00
Nic Limper
c458c6b29c bugfix: config screen is not populated when alias is empty 2024-02-26 11:47:56 +01:00
jjwbruijn
d3b9abf56a M2 7.5" v0027 fw 2024-02-26 01:27:40 +01:00
Jelmer
d2b17b7a97 added M2 7.5" BW tag type 2024-02-25 23:10:40 +01:00
Nic Limper
7e3e73a064 bugfix: no flasher-only detection on tag-based AP 2024-02-25 21:39:28 +01:00
Jelmer
9ca9007a1c Update oepl-definitions.h 2024-02-25 19:57:20 +01:00
Nic Limper
b03ad07179 bugfix, AP always reported C6 present 2024-02-25 15:26:01 +01:00
Nic Limper
56537e46be dirty fix for zlib compression
The miniz is used for zlib compression. But because that library has some bugs related to a smal window sizes (we need 4096), I had to make some patches to the library. The miniz library happens to also be part of esp-idf. To distinguish between our version and the esp-idf version, I created a `namespace Miniz` around our version. But nevertheless, the esp-idf version is called when I'm calling Miniz::tdefl_init and Miniz::tdefl_compress . Why??
Anyway, renamed tdefl_init and tdefl_compress to tdefl_initOEPL and tdefl_compressOEPL to get it working. This is ugly. If somebody has a better solution, please let me know!
2024-02-25 14:45:03 +01:00
VstudioLAB
f83667bcce Added support for the 2.6 BWR 2024-02-15 13:25:58 +01:00
VstudioLAB
bee51a23b6 5.85" Initial support and general preparation for BW only compatibility. 2024-02-15 00:09:25 +01:00
VstudioLAB
a787ac6ddf M3 5.85" cleanning 2024-02-14 22:09:50 +01:00
VstudioLAB
5561f82bf6 Original commit (5.85" BWR only)
First commit of that branch.
At the moment, only the M3 5.85" is added, but not finished.
2024-02-14 21:39:36 +01:00
VstudioLAB
b07eeb31ce initial commit 2024-02-14 00:56:38 +01:00
137 changed files with 1934 additions and 8695 deletions

1
.gitignore vendored
View File

@@ -26,3 +26,4 @@
sdcc/sdcc
ESP32_AP-Flasher/.vscode/extensions.json
ARM_Tag_FW\Newton_M3_nRF52811\$PROJECT_DIR

View File

@@ -10,7 +10,7 @@ OBJCOPY=$(ARMGCC)arm-none-eabi-objcopy
#-Wall
CC_WARNING_FLAGS=-Wall -Wformat=0 -Wattributes -Wstrict-aliasing=0
CPP_FLAGS=-lstdc++ -mcpu=cortex-m3 -g -O3 -mthumb -fdata-sections -ffunction-sections -std=c++98 -std=gnu++0x
CPP0_FLAGS=-lstdc++ -mcpu=cortex-m3 -g -O0 -mthumb -fdata-sections -ffunction-sections -std=c++98 -std=gnu++0x
CPP0_FLAGS=-lstdc++ -mcpu=cortex-m3 -g -O0 -mthumb -fdata-sections -ffunction-sections -std=c++98 -std=gnu++0x
CC_FLAGS=-mcpu=cortex-m3 -g -O0 -mthumb -fdata-sections -ffunction-sections -std=c99
CC3_FLAGS=-mcpu=cortex-m3 -g -O3 -mthumb -fdata-sections -ffunction-sections -std=c99
CC_END_FLAGS=-lstdc++ -lc -lnosys -L. -T mz100/mz100.ld -fPIE --specs=nosys.specs -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -O0 -flto -ffunction-sections -fdata-sections -DARM_GNU
@@ -64,23 +64,20 @@ compile:
@$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -Wno-unknown-pragmas -c ../common/QRCode/src/qrcode.c -o build/qrcode.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c compression.cpp -o build/compression.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c drawing.cpp -o build/drawing.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c epd_interface.cpp -o build/epd_interface.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c powermgt.cpp -o build/powermgt.o
# @$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c syncedproto.c -o build/syncedproto.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLASGS) -c oepl-protocol.cpp -o build/oepl-protocol.o
@$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c comms.c -o build/comms.o
@$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c md5.c -o build/md5.o
# @$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c settings.c -o build/settings.o
@$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c ../common/md5.c -o build/md5.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c settings.cpp -o build/settings.o
@$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c mz100/timer.c -o build/timer.o
@$(CC) $(CC3_FLAGS) $(CC_WARNING_FLAGS) -c mz100/util.c -o build/util.o
@$(CC) $(CC_FLAGS) $(CC_WARNING_FLAGS) -c mz100/gpio.c -o build/gpio.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c uc8159-var-m2.cpp -o build/uc8159-var-m2.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c uc8176-var-m2.cpp -o build/uc8176-var-m2.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c userinterface.cpp -o build/userinterface.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c main.cpp -o build/main.o
@$(GPLUSPLUS) $(CPP_FLAGS) $(CC_WARNING_FLAGS) -c oepl_fs.cpp -o build/oepl_fs.o
@@ -102,7 +99,8 @@ compile:
build/util.o \
build/md5.o \
build/gpio.o \
build/uc8159-var-m2.o \
build/uc8176-var-m2.o \
build/uc8159-var-m2.o \
build/mz100_sleep.o \
build/core_cm3.o \
build/qrcode.o \

View File

@@ -1,292 +0,0 @@
#ifndef _BITMAPS_H_
#define _BITMAPS_H_
// images generated by https://lvgl.io/tools/imageconverter, prepended with width, height. "CF_INDEXED_1_BIT"-mode, little-endian
#include <stdint.h>
#include "screen.h"
const uint8_t norf[] = {
24,
24,
0x00,
0x00,
0x00,
0x70,
0xe0,
0x00,
0x79,
0xe0,
0x00,
0x7f,
0xe0,
0x00,
0x3f,
0xc0,
0x00,
0x1f,
0x80,
0x00,
0x1f,
0x80,
0x00,
0x3f,
0xc0,
0x00,
0x7f,
0xe0,
0x0e,
0x79,
0xe0,
0x0a,
0x70,
0xe0,
0x0a,
0x00,
0x00,
0xea,
0x00,
0x00,
0xaa,
0x00,
0x00,
0xaa,
0x00,
0x0e,
0xaa,
0x00,
0x0a,
0xaa,
0x00,
0x0a,
0xaa,
0x00,
0xea,
0xaa,
0x00,
0xaa,
0xaa,
0x00,
0xaa,
0xaa,
0x0e,
0xaa,
0xaa,
0x0a,
0xaa,
0xaa,
0x0e,
0xee,
0xee,
0x00,
0x00,
0x00,
};
static const uint8_t batlow[] = {
24,17,
0x00, 0x00, 0x00,
0x7f, 0xff, 0xf8,
0x40, 0x00, 0x08,
0x40, 0x00, 0x08,
0x40, 0x00, 0x0e,
0x40, 0x00, 0x0a,
0x48, 0x00, 0x0a,
0x48, 0x00, 0x0a,
0x48, 0x64, 0x4a,
0x48, 0x94, 0x4a,
0x48, 0x95, 0x4a,
0x4e, 0x62, 0x8a,
0x40, 0x00, 0x0e,
0x40, 0x00, 0x08,
0x40, 0x00, 0x08,
0x7f, 0xff, 0xf8,
0x00, 0x00, 0x00,
};
static const uint8_t tbird2[] = {
0x40,0x01,178,0,
0xb6, 0xdb, 0x6d, 0xb5, 0xad, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x52, 0xa5, 0x54, 0xaa, 0xaa, 0xaa, 0x55, 0x4a,
0xdb, 0x6d, 0xb6, 0xd6, 0xd6, 0xee, 0xee, 0xdb, 0x6d, 0xad, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa4, 0xa4, 0x92, 0x49, 0x24, 0x92, 0x22, 0x4a, 0x54, 0x8a, 0x92, 0x44, 0x91, 0x48, 0xa9,
0x6d, 0xaa, 0xaa, 0xaa, 0xb5, 0x55, 0x55, 0x6a, 0xaa, 0xb5, 0x5b, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x49, 0x49, 0x24, 0x92, 0x44, 0x52, 0x95, 0x55, 0x2a, 0x92, 0x49, 0x55, 0x29, 0x22, 0x52, 0x49, 0x2a, 0x4a, 0xa5, 0x14,
0xaa, 0xb6, 0xd5, 0x6d, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xad, 0x55, 0x55, 0x55, 0x55, 0x55, 0x29, 0x29, 0x24, 0xaa, 0xaa, 0xaa, 0xa9, 0x33, 0x2a, 0x52, 0x49, 0x52, 0x55, 0x55, 0x24, 0x94, 0x95, 0x49, 0x2a, 0xa5, 0x29, 0x14, 0xa2,
0xb6, 0xdb, 0x5b, 0xb6, 0xda, 0xb6, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x52, 0x92, 0xa5, 0x55, 0x52, 0x95, 0x25, 0x52, 0x4a, 0x88, 0x95, 0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x2a, 0x49, 0x55, 0x49, 0x4a, 0xaa, 0x91, 0x52, 0x92, 0x89, 0x29, 0x21, 0x49, 0x24, 0x92, 0x48, 0xa5, 0x0a, 0x55, 0x21, 0x24, 0x49, 0x41, 0x22, 0xc9, 0x0a, 0x05,
0xab, 0x56, 0xaa, 0xaa, 0xab, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x2a, 0x4a, 0xa9, 0x55, 0x54, 0xaa, 0xa4, 0x92, 0x54, 0x8a, 0x49, 0x55, 0x44, 0x94, 0xa4, 0xaa, 0x49, 0x25, 0x12, 0xa1, 0x08, 0x94, 0x92, 0xa4, 0x94, 0x94, 0x24, 0xa1, 0x50,
0xb5, 0x6a, 0xb5, 0x55, 0xb5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x52, 0xaa, 0xaa, 0xa5, 0x4a, 0x4a, 0x92, 0x52, 0x55, 0x4a, 0x55, 0x54, 0x48, 0xaa, 0x4a, 0x15, 0x11, 0x24, 0x92, 0xa4, 0x54, 0xa5, 0x25, 0x49, 0x12, 0x4a, 0x42, 0x92, 0x54, 0x8a,
0xaa, 0xab, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa5, 0x52, 0x55, 0x29, 0x52, 0x55, 0x2a, 0xa4, 0xa5, 0x48, 0x93, 0x25, 0x11, 0x25, 0x50, 0xa4, 0x92, 0x48, 0x49, 0x0a, 0x50, 0x90, 0x24, 0xa9, 0x21, 0x29, 0x24, 0x82, 0x51,
0xad, 0x55, 0x56, 0xad, 0x55, 0x55, 0x55, 0x55, 0x52, 0x55, 0x25, 0x2a, 0x4a, 0x94, 0xa5, 0x29, 0x49, 0x49, 0x12, 0x28, 0xa5, 0x48, 0x92, 0xa4, 0x90, 0x8a, 0x92, 0x49, 0x25, 0x24, 0xa1, 0x0a, 0x4a, 0x92, 0x04, 0x94, 0x84, 0x92, 0x29, 0x0a,
0x6a, 0xda, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x95, 0x49, 0x54, 0xa9, 0x55, 0x52, 0x94, 0xa5, 0x24, 0xa4, 0xd5, 0x45, 0x12, 0x25, 0x48, 0x4a, 0x4a, 0x52, 0x49, 0x24, 0x92, 0x92, 0x54, 0xa5, 0x22, 0x49, 0x52, 0x42, 0x52, 0x21, 0x44, 0x50,
0xab, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x2a, 0x95, 0x28, 0x95, 0x52, 0x94, 0xaa, 0x15, 0x09, 0x2a, 0x49, 0x52, 0x25, 0x21, 0x25, 0x24, 0x94, 0x92, 0x48, 0x49, 0x05, 0x10, 0x89, 0x24, 0x24, 0x29, 0x08, 0x94, 0x29, 0x0a,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa9, 0x2a, 0xaa, 0xa5, 0x52, 0xa6, 0x52, 0x4a, 0x52, 0x49, 0x52, 0x64, 0x91, 0x24, 0x89, 0x52, 0x94, 0x90, 0x92, 0x42, 0x49, 0x25, 0x10, 0xa8, 0xa4, 0x52, 0x42, 0x91, 0x44, 0x52, 0x42, 0x84, 0xa1,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x4a, 0xa4, 0x92, 0x54, 0xa9, 0x51, 0x49, 0x29, 0x49, 0x25, 0x49, 0x12, 0x4a, 0x92, 0x54, 0x88, 0x4a, 0x4a, 0x49, 0x29, 0x24, 0x90, 0x8a, 0x04, 0x12, 0x08, 0x94, 0x44, 0x22, 0x89, 0x14, 0x52, 0x14,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x49, 0x24, 0xaa, 0x55, 0x4a, 0xa5, 0x15, 0x15, 0x2a, 0xa5, 0x25, 0x52, 0x24, 0xa9, 0x24, 0x49, 0x02, 0x55, 0x21, 0x25, 0x22, 0x04, 0x48, 0x45, 0x21, 0x52, 0x89, 0x44, 0x42, 0x22, 0x90, 0x44, 0x42, 0x08, 0xa2,
0x5a, 0xaa, 0xaa, 0xaa, 0x92, 0xaa, 0xaa, 0x92, 0xa9, 0x29, 0x2a, 0xa4, 0xaa, 0xa4, 0x92, 0x94, 0x89, 0x52, 0x44, 0x92, 0xa4, 0xa9, 0x02, 0x94, 0x90, 0x89, 0x52, 0x22, 0x90, 0x94, 0x20, 0x50, 0x29, 0x11, 0x14, 0x4a, 0x21, 0x29, 0x52, 0x11,
0xaa, 0xaa, 0xaa, 0x94, 0xaa, 0xaa, 0xaa, 0x55, 0x25, 0x55, 0x48, 0xaa, 0x91, 0x2a, 0x48, 0x52, 0x54, 0x89, 0x2a, 0x48, 0x12, 0x4a, 0x54, 0x42, 0x4a, 0x24, 0x24, 0x88, 0x4a, 0x42, 0x8a, 0x85, 0x42, 0x48, 0x81, 0x01, 0x14, 0x04, 0x24, 0x88,
0x55, 0x55, 0x55, 0x52, 0xaa, 0x52, 0x49, 0x54, 0xaa, 0x4a, 0x55, 0x22, 0x4a, 0x91, 0x2b, 0x25, 0x22, 0x54, 0x81, 0x25, 0x49, 0x21, 0x22, 0x29, 0x21, 0x11, 0x49, 0x25, 0x01, 0x10, 0x44, 0x20, 0x11, 0x12, 0x54, 0xaa, 0x42, 0xa1, 0x49, 0x25,
0xaa, 0xaa, 0xaa, 0xaa, 0xa5, 0x4a, 0xaa, 0xa2, 0x92, 0xa5, 0x24, 0x95, 0x28, 0x4a, 0x90, 0x90, 0x94, 0x82, 0x54, 0x92, 0x44, 0x94, 0x89, 0x44, 0x48, 0xa4, 0x22, 0x48, 0xa8, 0x4a, 0x21, 0x15, 0x48, 0x44, 0x82, 0x01, 0x28, 0x14, 0x20, 0x90,
0x55, 0x55, 0x55, 0x55, 0x55, 0x29, 0x4a, 0x55, 0x49, 0x28, 0x92, 0xa8, 0xa5, 0x51, 0x4a, 0x4a, 0x42, 0x54, 0x92, 0x49, 0x28, 0x42, 0x24, 0x22, 0x25, 0x12, 0x88, 0x22, 0x05, 0x01, 0x14, 0x80, 0x22, 0x21, 0x28, 0xa8, 0x02, 0x82, 0x8a, 0x05,
0xaa, 0xaa, 0xa9, 0x24, 0x92, 0xaa, 0x52, 0x94, 0xaa, 0x95, 0x54, 0x95, 0x12, 0x24, 0x25, 0x25, 0x29, 0x12, 0x49, 0x24, 0x45, 0x11, 0x11, 0x14, 0x80, 0x40, 0x22, 0x88, 0xa8, 0xa8, 0x82, 0x55, 0x09, 0x14, 0x04, 0x05, 0x50, 0x50, 0x21, 0x50,
0x55, 0x55, 0x4a, 0x95, 0x54, 0x95, 0x49, 0x4a, 0x49, 0x49, 0x25, 0x42, 0xa9, 0x4a, 0x90, 0x90, 0x88, 0xa4, 0x84, 0x89, 0x10, 0xa8, 0xa4, 0xa2, 0x55, 0x15, 0x48, 0x22, 0x02, 0x04, 0x50, 0x00, 0xa0, 0x81, 0x51, 0x50, 0x0a, 0x0a, 0x88, 0x0a,
0xaa, 0xaa, 0x55, 0x54, 0xaa, 0xa2, 0x54, 0xa2, 0xa4, 0x54, 0x92, 0x28, 0x44, 0x91, 0x4a, 0x4a, 0x55, 0x12, 0x28, 0x44, 0xa5, 0x05, 0x09, 0x08, 0x02, 0x40, 0x12, 0x88, 0xa8, 0xa2, 0x0a, 0xaa, 0x0a, 0x54, 0x08, 0x0a, 0xa1, 0x40, 0x45, 0x50,
0x55, 0x49, 0x52, 0x52, 0x92, 0x55, 0x25, 0x19, 0x15, 0x22, 0x49, 0x4a, 0x92, 0x4a, 0x25, 0x21, 0x00, 0x88, 0x92, 0x92, 0x10, 0x50, 0x44, 0x52, 0xa8, 0x95, 0x40, 0x22, 0x02, 0x11, 0x40, 0x00, 0xa0, 0x01, 0x45, 0x40, 0x14, 0x2a, 0x90, 0x0a,
0xaa, 0xaa, 0xaa, 0xaa, 0x49, 0x49, 0x52, 0xa4, 0xa2, 0x95, 0x24, 0xa4, 0x49, 0x24, 0x90, 0x94, 0xaa, 0x52, 0x44, 0x48, 0x8a, 0x85, 0x21, 0x04, 0x04, 0x20, 0x15, 0x48, 0xa8, 0x88, 0x2a, 0xaa, 0x0a, 0xa8, 0x20, 0x2a, 0x81, 0x10, 0x4a, 0xa1,
0x52, 0x55, 0x25, 0x25, 0x55, 0x24, 0x89, 0x2a, 0x54, 0x48, 0x92, 0x12, 0xa4, 0x92, 0x4a, 0x42, 0x21, 0x09, 0x11, 0x12, 0x40, 0x20, 0x94, 0x51, 0x52, 0x8a, 0xa0, 0x02, 0x02, 0x25, 0x00, 0x00, 0xa0, 0x05, 0x15, 0x00, 0x54, 0xa5, 0x21, 0x14,
0xaa, 0x92, 0x94, 0x92, 0x49, 0x55, 0x54, 0x81, 0x0a, 0xa5, 0x49, 0x48, 0x12, 0x49, 0x21, 0x14, 0x94, 0xa2, 0x48, 0x84, 0x2a, 0x94, 0x02, 0x08, 0x08, 0x20, 0x0a, 0xa9, 0x69, 0x00, 0xaa, 0xaa, 0x15, 0x50, 0x80, 0xaa, 0x02, 0x10, 0x8a, 0x42,
0x4a, 0xa9, 0x52, 0xa9, 0x54, 0x92, 0x22, 0x5a, 0xa1, 0x10, 0x24, 0xa5, 0x49, 0x24, 0x94, 0xa2, 0x42, 0x11, 0x12, 0x51, 0x40, 0x42, 0xa9, 0x45, 0x42, 0x8a, 0xd5, 0x77, 0xbe, 0xf4, 0x00, 0x01, 0x40, 0x04, 0x55, 0x01, 0x54, 0x8a, 0x21, 0x29,
0x54, 0xa5, 0x2a, 0x4a, 0x8a, 0x49, 0x55, 0x24, 0x54, 0xaa, 0x92, 0x11, 0x24, 0x90, 0x42, 0x11, 0x14, 0xa4, 0x44, 0x08, 0x2a, 0x10, 0x04, 0x20, 0x28, 0x23, 0x5b, 0xad, 0x55, 0xaf, 0xb5, 0x54, 0x15, 0x52, 0x80, 0xaa, 0x22, 0x41, 0x4a, 0x44,
0xa5, 0x2a, 0xa5, 0x29, 0x51, 0x24, 0x88, 0x92, 0x8a, 0x04, 0xa9, 0x4a, 0x49, 0x0a, 0x94, 0x8a, 0x42, 0x12, 0x22, 0xa2, 0x81, 0x4a, 0xa1, 0x15, 0x45, 0x16, 0xa4, 0x56, 0xea, 0xd5, 0x6a, 0x81, 0x40, 0x08, 0x54, 0x01, 0x11, 0x2a, 0x21, 0x12,
0x54, 0xa4, 0x92, 0xa4, 0x4a, 0x92, 0x52, 0x48, 0x51, 0x52, 0x04, 0x21, 0x24, 0x50, 0x42, 0x51, 0x28, 0x89, 0x10, 0x11, 0x2a, 0x20, 0x14, 0x80, 0x10, 0xab, 0x12, 0xaa, 0xb7, 0x76, 0xdd, 0x7d, 0x15, 0x52, 0x09, 0x54, 0x88, 0x84, 0x94, 0x48,
0x4a, 0x95, 0x54, 0x92, 0xa4, 0x49, 0x25, 0x25, 0x0a, 0x29, 0x52, 0x94, 0x89, 0x0a, 0x94, 0x84, 0x04, 0x50, 0xa5, 0x4a, 0x40, 0x8a, 0xa2, 0x55, 0x4a, 0x1d, 0xa9, 0x12, 0xaa, 0x9b, 0x6b, 0xab, 0xe8, 0x81, 0x42, 0x08, 0x44, 0x22, 0x02, 0x22,
0x52, 0x52, 0x25, 0x4a, 0x12, 0xa4, 0x90, 0x92, 0xa1, 0x44, 0x48, 0x42, 0x24, 0xa0, 0x42, 0x29, 0x52, 0x84, 0x10, 0x81, 0x15, 0x20, 0x48, 0x08, 0x91, 0x56, 0x94, 0xa9, 0x40, 0x55, 0xb6, 0xf6, 0xb7, 0x6c, 0x28, 0xa2, 0x92, 0x90, 0xa9, 0x08,
0x4a, 0xa9, 0x52, 0x29, 0x49, 0x12, 0x4a, 0x48, 0x54, 0x22, 0x92, 0x94, 0x91, 0x15, 0x28, 0x84, 0x24, 0x52, 0xa5, 0x2a, 0x40, 0x95, 0x25, 0x52, 0x48, 0x3b, 0x22, 0x94, 0xd5, 0x22, 0x5b, 0x5b, 0x5b, 0xb7, 0x82, 0x08, 0x20, 0x0a, 0x00, 0x41,
0x54, 0x95, 0x29, 0x44, 0xa4, 0xa9, 0x25, 0x25, 0x05, 0x54, 0x49, 0x22, 0x44, 0x42, 0x05, 0x29, 0x49, 0x08, 0x88, 0x88, 0x95, 0x04, 0x91, 0x29, 0x25, 0x56, 0x95, 0x22, 0x48, 0x88, 0xa8, 0xaa, 0xed, 0x5a, 0xfd, 0x42, 0x8a, 0xa0, 0xaa, 0x10,
0x4a, 0x48, 0x84, 0xaa, 0x2a, 0x04, 0x90, 0x90, 0xa8, 0x82, 0x24, 0x49, 0x12, 0x94, 0xa8, 0x84, 0x22, 0x45, 0x24, 0x52, 0x44, 0xa9, 0x24, 0x84, 0x91, 0x7a, 0xc8, 0x94, 0xc5, 0x45, 0x31, 0x15, 0x57, 0xed, 0x56, 0xf8, 0x00, 0x08, 0x00, 0x84,
0x51, 0x55, 0x55, 0x11, 0x41, 0x52, 0x4a, 0x4a, 0x22, 0x29, 0x42, 0x24, 0x48, 0x42, 0x44, 0x52, 0x94, 0xa8, 0x92, 0x89, 0x11, 0x12, 0x4a, 0x52, 0x4a, 0xaf, 0x7e, 0xa8, 0xa8, 0x28, 0x94, 0x40, 0xaa, 0x57, 0xbb, 0x57, 0xea, 0x42, 0x88, 0x10,
0x4a, 0x89, 0x28, 0xa4, 0x94, 0xa9, 0x21, 0x21, 0x49, 0x44, 0x29, 0x49, 0x22, 0x29, 0x12, 0x88, 0x42, 0x04, 0x48, 0x44, 0x4a, 0x49, 0x21, 0x09, 0x21, 0x75, 0xdf, 0xd6, 0xc2, 0xa5, 0x62, 0x95, 0x05, 0x5a, 0xd5, 0xdd, 0x7d, 0xa0, 0x22, 0x42,
0x54, 0x54, 0x92, 0x4a, 0x4a, 0x04, 0x94, 0x94, 0x94, 0x29, 0x44, 0x24, 0x95, 0x44, 0x48, 0x52, 0x94, 0xaa, 0x92, 0xa9, 0x21, 0x24, 0x94, 0xa4, 0x95, 0xae, 0xeb, 0xe1, 0x39, 0x01, 0x30, 0x20, 0x56, 0x25, 0x5e, 0xb7, 0xae, 0xfd, 0x00, 0x00,
0x4a, 0xa2, 0x4a, 0x91, 0x21, 0x52, 0x4a, 0x42, 0x42, 0x84, 0x29, 0x42, 0x20, 0x29, 0x25, 0x24, 0x49, 0x10, 0x49, 0x04, 0x94, 0x91, 0x22, 0x12, 0x21, 0x77, 0x7d, 0xf4, 0x45, 0xda, 0x25, 0x0a, 0x02, 0x84, 0x22, 0xda, 0xf7, 0xb6, 0x92, 0x48,
0x22, 0x55, 0x51, 0x24, 0x94, 0x94, 0x91, 0x29, 0x28, 0x52, 0x84, 0x28, 0x95, 0x44, 0x92, 0x92, 0xa4, 0xa5, 0x24, 0xa9, 0x22, 0x44, 0x89, 0x48, 0x95, 0xad, 0xab, 0x61, 0x00, 0x2a, 0xb0, 0x41, 0x56, 0x52, 0x94, 0x7f, 0xba, 0xff, 0xc0, 0x02,
0xa9, 0x08, 0x8a, 0x52, 0x4a, 0x42, 0x48, 0x8a, 0x45, 0x24, 0x52, 0x85, 0x42, 0x2a, 0x48, 0x49, 0x12, 0x12, 0x92, 0x12, 0x49, 0x12, 0x52, 0x25, 0x22, 0xdb, 0xfe, 0xb4, 0xaa, 0x01, 0x57, 0x28, 0x05, 0x09, 0x49, 0x59, 0x5f, 0xdb, 0x49, 0x20,
0x4a, 0xa5, 0x51, 0x09, 0x21, 0x29, 0x25, 0x21, 0x28, 0x92, 0x88, 0xa8, 0x29, 0x41, 0x25, 0x24, 0xa4, 0xa8, 0x48, 0xa4, 0x94, 0xa9, 0x09, 0x50, 0x95, 0x76, 0xab, 0xf2, 0x11, 0x54, 0x08, 0xa4, 0x94, 0xa4, 0x22, 0xff, 0xaa, 0xaa, 0xc0, 0x08,
0x24, 0x52, 0x2a, 0xa4, 0x94, 0x94, 0x92, 0x54, 0x85, 0x49, 0x25, 0x15, 0x4a, 0x2a, 0x92, 0x92, 0x49, 0x05, 0x25, 0x12, 0x42, 0x04, 0xa4, 0x0a, 0x47, 0xbd, 0xfe, 0xa9, 0x4a, 0x02, 0xa2, 0x56, 0xa6, 0x09, 0x55, 0xdb, 0xbf, 0xff, 0xc4, 0x82,
0x92, 0x89, 0x44, 0x52, 0x4a, 0x42, 0x49, 0x0a, 0x52, 0x24, 0x92, 0x42, 0x25, 0x48, 0x48, 0xa9, 0x24, 0xa9, 0x48, 0xa4, 0x94, 0xa9, 0x12, 0xa5, 0x29, 0x6b, 0xb7, 0xf2, 0x21, 0x54, 0x15, 0x08, 0xaa, 0xa2, 0x09, 0xff, 0xed, 0xb6, 0x90, 0x20,
0x49, 0x54, 0xa9, 0x15, 0x21, 0x29, 0x24, 0xa1, 0x29, 0x52, 0x49, 0x29, 0x50, 0xa5, 0x2a, 0x44, 0x92, 0x54, 0x25, 0x12, 0x49, 0x24, 0xa9, 0x28, 0x87, 0xbe, 0xfe, 0xb4, 0x94, 0x49, 0x40, 0xa2, 0x04, 0xac, 0xa7, 0x6d, 0x36, 0xdb, 0x42, 0x08,
0x54, 0x92, 0x25, 0x48, 0x95, 0x55, 0x52, 0x95, 0x44, 0x89, 0x2a, 0x94, 0x8a, 0x12, 0xa5, 0x2a, 0x49, 0x22, 0x92, 0x49, 0x24, 0x92, 0x44, 0x85, 0x2a, 0xd7, 0x5b, 0xe9, 0x42, 0xa4, 0x95, 0x14, 0xa0, 0x12, 0xab, 0xff, 0xab, 0xff, 0xc8, 0xa2,
0x25, 0x4a, 0x92, 0x55, 0x54, 0x92, 0x4a, 0x54, 0x95, 0x24, 0x90, 0x49, 0x21, 0x49, 0x10, 0x91, 0x54, 0x95, 0x49, 0x54, 0x92, 0x49, 0x29, 0x52, 0x4d, 0x7b, 0xff, 0x72, 0x29, 0x10, 0x24, 0x41, 0x12, 0x40, 0xae, 0xea, 0xfe, 0xa4, 0x22, 0x08,
0x92, 0x24, 0xa9, 0x22, 0x4a, 0x49, 0x29, 0x22, 0x52, 0x92, 0x4a, 0xa0, 0x48, 0x2a, 0xaa, 0x4a, 0x4a, 0x48, 0x54, 0x8a, 0x49, 0x24, 0x92, 0x29, 0x2b, 0xad, 0x6b, 0xd9, 0x44, 0x82, 0x12, 0xaa, 0x44, 0x8a, 0x17, 0xff, 0xf8, 0x09, 0x11, 0x52,
0x55, 0x52, 0x95, 0x55, 0x25, 0x55, 0x4a, 0x95, 0x28, 0x49, 0x20, 0x14, 0x22, 0x91, 0x01, 0x25, 0x22, 0xa5, 0x22, 0x51, 0x2a, 0x92, 0x49, 0x44, 0x96, 0xf7, 0xfe, 0xf4, 0x12, 0x20, 0x8a, 0x11, 0x21, 0x20, 0x9d, 0xbd, 0xb2, 0xa2, 0x4a, 0x08,
0x49, 0x2a, 0x52, 0x94, 0xa9, 0x24, 0xa4, 0x52, 0x85, 0x2a, 0x92, 0x81, 0x08, 0x4a, 0x54, 0x11, 0x54, 0x95, 0x55, 0x4a, 0xa4, 0x55, 0x54, 0x92, 0x5b, 0x5d, 0x5b, 0xb2, 0x88, 0x84, 0x52, 0xaa, 0x14, 0x95, 0x6f, 0xf7, 0xe9, 0x11, 0x24, 0xa5,
0x54, 0xa9, 0x4a, 0x4a, 0x94, 0x92, 0x52, 0x94, 0x50, 0x90, 0x44, 0x52, 0x42, 0x20, 0x91, 0x4a, 0x4a, 0x52, 0x95, 0x55, 0x52, 0xa4, 0x8a, 0x55, 0x55, 0xf7, 0xff, 0xf9, 0x20, 0x10, 0x09, 0x00, 0x40, 0x48, 0xbf, 0xff, 0xe4, 0xaa, 0x52, 0xa8,
0x4a, 0x95, 0x55, 0x52, 0x52, 0xaa, 0x89, 0x4a, 0xaa, 0x4a, 0x11, 0x00, 0x28, 0x8a, 0x24, 0x01, 0x2a, 0xad, 0x6a, 0xb5, 0x5d, 0x55, 0x61, 0x24, 0xae, 0xae, 0xd6, 0xd4, 0x8a, 0x82, 0xa4, 0xa9, 0x25, 0x25, 0x7b, 0xbf, 0x92, 0x41, 0x08, 0x92,
0x55, 0x4a, 0x49, 0x29, 0x4a, 0x49, 0x54, 0xa1, 0x01, 0x21, 0x44, 0x4a, 0x02, 0x20, 0x89, 0x5a, 0xaa, 0xd5, 0x56, 0xdb, 0x6b, 0x6d, 0xbd, 0x52, 0x37, 0xfb, 0xff, 0xb8, 0x50, 0x54, 0x12, 0x02, 0x48, 0x92, 0xef, 0xfd, 0xa9, 0x14, 0xa5, 0x4a,
0xa9, 0x29, 0x54, 0x95, 0x29, 0x24, 0x4a, 0x2a, 0xaa, 0x88, 0x10, 0x10, 0xa8, 0x8a, 0x25, 0x55, 0x55, 0x55, 0xb5, 0x55, 0xaa, 0xb6, 0xab, 0xaa, 0xad, 0x5e, 0xb5, 0xf2, 0x8a, 0x21, 0x49, 0x48, 0x82, 0x4b, 0xff, 0xf7, 0x45, 0x55, 0x52, 0x25,
0x4a, 0xa5, 0x25, 0x48, 0xa5, 0x55, 0x22, 0x90, 0x40, 0x45, 0x42, 0x80, 0x00, 0x21, 0x5a, 0xaa, 0xda, 0xad, 0x5b, 0x6d, 0x6d, 0xaa, 0xd5, 0x6d, 0xb7, 0xeb, 0xff, 0x78, 0x51, 0x14, 0x24, 0x80, 0x29, 0x2e, 0xfd, 0xbe, 0xb4, 0xa4, 0x8a, 0x92,
0x54, 0x94, 0xaa, 0x55, 0x52, 0x49, 0x54, 0xa5, 0x15, 0x10, 0x08, 0x25, 0x4a, 0x84, 0x2a, 0xab, 0x55, 0xb5, 0xad, 0xb5, 0xb6, 0xdb, 0x5d, 0xb6, 0xda, 0xbf, 0x5b, 0xd5, 0x2a, 0xc9, 0x2a, 0x21, 0x04, 0xab, 0xdf, 0xfe, 0x4a, 0x52, 0x54, 0x54,
0x4a, 0x55, 0x49, 0x4a, 0x29, 0x24, 0x8a, 0x12, 0x82, 0x41, 0x21, 0x00, 0x2a, 0xb2, 0x02, 0xaa, 0xaa, 0xd6, 0xb5, 0x56, 0xab, 0x6d, 0x6a, 0xdb, 0x6d, 0xab, 0xfe, 0xf9, 0x55, 0x24, 0xa0, 0x84, 0x12, 0xbf, 0xff, 0xf9, 0x52, 0x89, 0x21, 0x0a,
0x52, 0xaa, 0x55, 0x25, 0x45, 0x52, 0x51, 0x48, 0x50, 0x04, 0x00, 0x2b, 0xaa, 0xda, 0x90, 0xad, 0x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xb6, 0xf7, 0x7f, 0xff, 0xbf, 0xff, 0x7f, 0xd2, 0x22, 0x44,
0xb6, 0xab, 0x6d, 0x09, 0x4a, 0x4a, 0xaa, 0x42, 0xa9, 0x55, 0x52, 0x49, 0x10, 0x00, 0x11, 0x14, 0x0b, 0x40, 0x95, 0x6a, 0xaa, 0xab, 0x5a, 0xb5, 0xb5, 0xaa, 0xee, 0xd5, 0xed, 0xf7, 0xff, 0xff, 0xf6, 0xf6, 0xff, 0xf7, 0xff, 0xe0, 0x88, 0x00,
0xab, 0x6d, 0x56, 0xa4, 0x24, 0xa1, 0x29, 0x29, 0x14, 0xa1, 0x2a, 0xa0, 0x00, 0x22, 0x00, 0x18, 0x25, 0x40, 0xda, 0xad, 0x6a, 0xac, 0xab, 0x56, 0xda, 0xdd, 0x55, 0x6e, 0xbb, 0x7d, 0xdf, 0xfd, 0xdf, 0xdf, 0xf5, 0xff, 0xff, 0xca, 0x00, 0x24,
0xba, 0xb6, 0xf8, 0x95, 0x52, 0x14, 0x84, 0x94, 0xa2, 0x14, 0x92, 0x00, 0x00, 0x80, 0x00, 0x50, 0x05, 0x40, 0x55, 0x55, 0xaa, 0xb5, 0x55, 0xb5, 0x6d, 0x6b, 0xb7, 0xb7, 0xdf, 0xdf, 0xfd, 0xdf, 0xff, 0xff, 0xdf, 0xff, 0xff, 0x20, 0x49, 0x00,
0xd7, 0xdb, 0x55, 0x52, 0x09, 0x42, 0x22, 0x42, 0x15, 0x52, 0xa9, 0x00, 0x00, 0x01, 0x57, 0x51, 0x55, 0x62, 0x2d, 0xaa, 0xb5, 0x55, 0xb6, 0xab, 0xab, 0xad, 0x6d, 0x6d, 0x75, 0xf6, 0xf7, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xfa, 0x95, 0x00, 0x09,
0x6d, 0x6d, 0x69, 0x29, 0x50, 0x10, 0x90, 0x29, 0x49, 0x2a, 0x4a, 0x22, 0x20, 0x2a, 0xa9, 0x55, 0x55, 0x50, 0x35, 0x55,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x55, 0x48, 0x4a, 0xa9, 0x44, 0x88, 0xaa, 0xaa, 0xaa, 0xaa, 0xdb, 0x6a, 0xb5, 0x5a, 0xaa, 0xaa, 0xaa, 0xb5, 0x6a, 0xad, 0x56, 0xad, 0xb5, 0x77, 0xfb, 0xfd, 0x55, 0x57, 0xff, 0xd5, 0x7a, 0xfa,
};
#endif

View File

@@ -7,6 +7,7 @@
#include "epd_interface.h"
#include "uc8159-var-m2.h"
#include "uc8176-var-m2.h"
#include "mz100/printf.h"
#include "mz100/eeprom.h"
@@ -30,12 +31,19 @@ extern "C" {
__attribute__((section(".aonshadow"))) epdInterface *epd;
__attribute__((section(".aonshadow"))) tagSpecs tag;
epdInterface::~epdInterface(){
epdInterface::~epdInterface() {
}
void epdSetup() {
epd = new uc8159;
switch (tagProfile.controllerType) {
case 0:
epd = new uc8159;
break;
case 1:
epd = new uc8176;
break;
}
epd->effectiveXRes = tagProfile.xRes;
epd->effectiveYRes = tagProfile.yRes;
epd->Xres = tagProfile.xRes;
@@ -66,7 +74,7 @@ void selectLUT(uint8_t sel) {
static void busyWaitUntilHigh(uint32_t timeout) {
uint32_t v2 = 0;
while (GPIO_ReadPinLevel(EPD_BUSY) == GPIO_IO_LOW) {
delay(10000);
delay(50);
v2++;
if (v2 > timeout)
break;
@@ -78,7 +86,7 @@ static void busyWaitUntilHigh(uint32_t timeout) {
static void busyWaitUntilLow(uint32_t timeout) {
uint32_t v2 = 0;
while (GPIO_ReadPinLevel(EPD_BUSY) == GPIO_IO_HIGH) {
delay(10000);
delay(50);
v2++;
if (v2 > timeout)
break;
@@ -107,7 +115,7 @@ void softSPIWriteByte(char byteOut) {
GPIO_WritePinOutput(EPD_CLK, GPIO_IO_LOW);
byteOut *= 2;
loopCount++;
delay(1);
delay_us(1);
} while (loopCount < 8);
GPIO_WritePinOutput(EPD_MOSI, GPIO_IO_LOW);
delay_us(1);
@@ -134,7 +142,7 @@ uint8_t softSPIReadByte() {
readByte |= 1u;
GPIO_WritePinOutput(EPD_CLK, GPIO_IO_LOW);
delay_us(1);
delay(1);
// delay(1);
loopCount++;
} while (loopCount < 8);
GPIO_SetPinDir(EPD_MOSI, GPIO_OUTPUT);
@@ -144,7 +152,9 @@ uint8_t softSPIReadByte() {
GPIO_WritePinOutput(EPD_CS, GPIO_IO_HIGH);
delay_us(1);
GPIO_WritePinOutput(EPD_BS, GPIO_IO_LOW);
delay(1);
// delay(1);
delay_us(1);
return readByte;
}

View File

@@ -51,11 +51,9 @@ extern void dump(const uint8_t *a, const uint16_t l);
uint64_t __attribute__((section(".ver"))) mCurVersionExport = SW_VER_CURRENT;
uint64_t __attribute__((section(".fwmagic"))) magic = FW_MAGIC;
char macStr[32];
char macStr1[32];
#define TAG_MODE_CHANSEARCH 0
#define TAG_MODE_ASSOCIATED 1
#define TAG_MODE_DEEPSLEEP 0x10
__attribute__((section(".aon"))) uint8_t currentTagMode = TAG_MODE_CHANSEARCH;
__attribute__((section(".aon"))) volatile struct zigbeeCalibDataStruct zigbeeCalibData;
@@ -91,7 +89,7 @@ static void initTagProfile() {
}
tag.imageSize = flashRoundUp(sizeof(struct EepromImageHeader) + (tagProfile.xRes * tagProfile.yRes * tagProfile.bpp) / 8);
tag.OEPLtype = 0x05;
tag.OEPLtype = tagProfile.OEPLType;
}
uint8_t showChannelSelect() { // returns 0 if no accesspoints were found
@@ -104,7 +102,9 @@ uint8_t showChannelSelect() { // returns 0 if no accesspoints were found
if (detectAP(channelList[c])) {
if (mLastLqi > result[c])
result[c] = mLastLqi;
printf("Channel: %d - LQI: %d RSSI %d\n", channelList[c], mLastLqi, mLastRSSI);
#ifdef DEBUG_MAIN
printf("MAIN: Channel: %d - LQI: %d RSSI %d\n", channelList[c], mLastLqi, mLastRSSI);
#endif
}
}
}
@@ -292,6 +292,17 @@ int32_t setupCLKCalib() {
return -1;
}
void checkWDT() {
uint32_t val1 = WDT_GetCounterVal();
delay(10000);
uint32_t val2 = WDT_GetCounterVal();
if (val1 == val2) {
printf("WDT: Not running!\n");
} else {
printf("WDT: 1: %lu 2: %lu divider is now %lu\n", val1, val2, (val2 - val1) / 10000);
}
}
void TagAssociated() {
// associated
struct AvailDataInfo *avail;
@@ -308,8 +319,9 @@ void TagAssociated() {
// check if the battery level is below minimum, and force a redraw of the screen
if ((lowBattery && !lowBatteryShown && tagSettings.enableLowBatSymbol) || (noAPShown && tagSettings.enableNoRFSymbol)) {
printf("For some reason, we're going to redraw the image. lowbat=%d, lowbatshown=%d, noAPShown=%d\n", lowBattery, lowBatteryShown, noAPShown);
if ((lowBattery && !lowBatteryShown && tagSettings.enableLowBatSymbol) ||
(!lowBattery && lowBatteryShown) ||
(noAPShown && tagSettings.enableNoRFSymbol)) {
// Check if we were already displaying an image
if (curImgSlot != 0xFF) {
powerUp(INIT_EEPROM | INIT_EPD);
@@ -317,15 +329,16 @@ void TagAssociated() {
drawImageFromEeprom(curImgSlot, 0);
powerDown(INIT_EEPROM | INIT_EPD);
} else {
WDT_RestartCounter();
powerUp(INIT_EPD);
wdt60s();
showAPFound();
powerDown(INIT_EPD);
wdt60s();
}
}
powerUp(INIT_RADIO);
printf("full request\n");
#ifdef DEBUG_MAIN
printf("MAIN: full request\n");
#endif
avail = getAvailDataInfo();
avail = getAvailDataInfo();
powerDown(INIT_RADIO);
@@ -398,6 +411,7 @@ void TagChanSearch() {
// Check if we should redraw the screen with icons, info screen or screensaver
if ((!currentChannel && !noAPShown && tagSettings.enableNoRFSymbol) ||
(lowBattery && !lowBatteryShown && tagSettings.enableLowBatSymbol) ||
(!lowBattery && lowBatteryShown) ||
(scanAttempts == (INTERVAL_1_ATTEMPTS + INTERVAL_2_ATTEMPTS - 1))) {
powerUp(INIT_EPD);
wdt60s();
@@ -415,7 +429,9 @@ void TagChanSearch() {
// did we find a working channel?
if (currentChannel) {
#ifdef DEBUG_PROTO
printf("PROTO: Found a working channel from the TagChanSearch loop\n");
#endif
// now associated! set up and bail out of this loop.
scanAttempts = 0;
wakeUpReason = WAKEUP_REASON_NETWORK_SCAN;
@@ -425,10 +441,15 @@ void TagChanSearch() {
return;
} else {
// still not associated
doSleep(getNextScanSleep(true) * 1000UL);
sleep_with_with_wakeup(getNextScanSleep(true) * 1000UL);
}
}
void tagDeepSleep() {
printf("MAIN: long sleepy\n");
sleep_with_with_wakeup(1800 * 1000UL);
}
int main(void) {
(*(volatile unsigned int *)0x20124000) = 0x100004; // On WARM RESET: Goto this address. -> entry
(*(volatile unsigned int *)0xE000ED08) = 0x20100000; // Vector table in RAM and offset 0x4000
@@ -442,7 +463,7 @@ int main(void) {
setupCLKCalib();
if (!loadValidateAonRam() || PMU_GetLastResetCause()) {
// cold boot!
printf("BOOT: Cold boot!\n");
// calibrate the 32K RC oscillator (autocal), we'll store the result to flash later
uint32_t rtccal = setupRTC(0);
setupGPIO();
@@ -463,12 +484,13 @@ int main(void) {
} else {
fs->deleteFile((char *)"tagprofile.bin");
}
} else {
printf("BOOT: Loaded tag settings from EEPROM\n");
}
printf("MAIN: MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", tagProfile.macAddress[0], tagProfile.macAddress[1], tagProfile.macAddress[2], tagProfile.macAddress[3], tagProfile.macAddress[4], tagProfile.macAddress[5], tagProfile.macAddress[6], tagProfile.macAddress[7]);
printf("BOOT: MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", tagProfile.macAddress[0], tagProfile.macAddress[1], tagProfile.macAddress[2], tagProfile.macAddress[3], tagProfile.macAddress[4], tagProfile.macAddress[5], tagProfile.macAddress[6], tagProfile.macAddress[7]);
tagProfile.RC32Kcal = rtccal;
printf("MAIN: Rst reason: %i\r\n", PMU_GetLastResetCause());
printf("BOOT: Rst reason: %i\r\n", PMU_GetLastResetCause());
initTagProfile();
@@ -484,17 +506,17 @@ int main(void) {
doVoltageReading();
currentChannel = showChannelSelect();
radioShutdown();
if (currentChannel) {
printf("MAIN: AP Found\r\n");
printf("BOOT: AP Found\n");
wdt10s();
delay(10000);
showAPFound();
sprintf(macStr1, "MAIN: OpenEPaperLink Ch: %i", currentChannel);
wdt10s();
timerDelay(TIMER_TICKS_PER_MSEC * 1000);
currentTagMode = TAG_MODE_ASSOCIATED;
} else {
printf("No AP found\r\n");
printf("BOOT: No AP found\n");
wdt10s();
delay(10000);
showNoAP();
@@ -503,6 +525,9 @@ int main(void) {
currentTagMode = TAG_MODE_CHANSEARCH;
}
writeSettings();
printf("BOOT: Cold boot complete\n");
sleep_with_with_wakeup(5 * 1000UL);
} else {
setupRTC(tagProfile.RC32Kcal);
setupWDT();
@@ -519,6 +544,9 @@ int main(void) {
case TAG_MODE_CHANSEARCH:
TagChanSearch();
break;
case TAG_MODE_DEEPSLEEP:
tagDeepSleep();
break;
}
}
return 0;
@@ -543,7 +571,6 @@ void applyUpdate(uint32_t size) {
setupCLKCalib();
setupRTC(0);
uint64_t test;
FLASH_Read((FLASH_ReadMode_Type)0, fsEnd + 0x0168, (uint8_t *)&test, 8);
if (test != magic) {
@@ -570,5 +597,38 @@ void applyUpdate(uint32_t size) {
}
printf("Resetting!\n");
delay(1000);
sleep_with_with_wakeup(1000);
NVIC_SystemReset();
while (1)
;
}
void executeCommand(uint8_t cmd) {
printf("executing command %d \n", cmd);
delay(20);
switch (cmd) {
case CMD_DO_REBOOT:
NVIC_SystemReset();
break;
case CMD_DO_RESET_SETTINGS:
break;
case CMD_DO_SCAN:
currentChannel = showChannelSelect();
break;
case CMD_ERASE_EEPROM_IMAGES:
eraseImageBlocks();
break;
case CMD_GET_BATTERY_VOLTAGE:
doVoltageReading();
// ensure
longDataReqCounter = LONG_DATAREQ_INTERVAL + 1;
sleep_with_with_wakeup(2 * 1000UL);
break;
case CMD_DO_DEEPSLEEP:
showLongTermSleep();
currentTagMode = TAG_MODE_DEEPSLEEP;
break;
default:
printf("Unimplemented command 0x%02X\n", cmd);
break;
}
}

View File

@@ -31,3 +31,4 @@
#define RADIO_FIRST_CHANNEL (11) //2.4-GHz channels start at 11
void applyUpdate(uint32_t len);
void executeCommand(uint8_t cmd);

View File

@@ -0,0 +1 @@
MAC_BEGINS_HERE>

View File

@@ -16,7 +16,8 @@
#define PROGMEM
#define WINDOW_SIZE 12 // 4096 bytes
//#define WINDOW_SIZE 12 // 4096 bytes
#define WINDOW_SIZE 10 // 1024 bytes
#define FILENAME_LENGTH 32
@@ -243,6 +244,7 @@ int main(){
saveFontData(&FreeSans9pt7b, (char*)"font/FreeSans9pt7b");
/* OTHER STUFF */
addFileFromFS("marker.txt", false);
addFileFromFS("tagprofile.bin", false);
addFileFromFS("norf.bin", true);
addFileFromFS("lowbat.bin", true);

View File

@@ -0,0 +1,8 @@
{
"mac":"00000130C8754110",
"xRes":400,
"yRes":300,
"bpp":2,
"controllerType":1,
"OEPLType":36
}

View File

@@ -0,0 +1,8 @@
{
"mac":"0000021ECA8C743F",
"xRes":640,
"yRes":384,
"bpp":2,
"controllerType":0,
"OEPLType":5
}

View File

@@ -0,0 +1,8 @@
{
"mac":"000001EF0ED27336",
"xRes":640,
"yRes":384,
"bpp":1,
"controllerType":0,
"OEPLType":38
}

View File

@@ -1,8 +1,8 @@
{
"mac":"0000021ECA8C743F",
"mac":"000001EF0ED27336",
"xRes":640,
"yRes":384,
"bpp":2,
"bpp":1,
"controllerType":0,
"OEPLType":5
"OEPLType":38
}

View File

@@ -23,7 +23,7 @@ void setupWDT() {
CLK_ModuleClkEnable(CLK_WDT);
WDT_SetMode(WDT_MODE_RESET);
WDT_SetResetPulseLen(WDT_RESET_PULSE_LEN_256);
WDT_SetTimeoutVal(30);
WDT_SetTimeoutVal(0x0B);
WDT_RestartCounter();
WDT_Enable();
//** WATCHDOG

View File

@@ -129,6 +129,7 @@ void WDT_SetMode(WDT_Mode_Type mode)
void WDT_SetTimeoutVal(uint32_t timeoutVal)
{
/* set WDT timeout value */
// This value can be anything between 0x00 and 0x0F; this configures the WDT to reset at 2^(16+value) cycles (2^16 - 2^31)
WDT->TORR.BF.TOP = timeoutVal;
}

View File

@@ -58,4 +58,16 @@ void timerDelay(uint64_t cycles)
t = timerGet();
while (timerGet() - t < cycles)
;
}
uint32_t timerMs(){
static uint64_t prev = 0;
uint64_t now = timerGet();
uint64_t diff = now - prev;
prev = now;
return (uint32_t)(diff/TIMER_TICKS_PER_MSEC);
}
uint32_t millis(){
return (uint32_t)(timerGet() / TIMER_TICKS_PER_MSEC);
}

View File

@@ -9,6 +9,9 @@
void timerInit(void);
uint64_t timerGet(void);
void timerStop(void);
uint32_t timerMs(void);
uint32_t millis();
void timerDelay(uint64_t cycles);

View File

@@ -15,7 +15,7 @@ extern "C" {
#include "mz100/util.h"
#include "mz100/mz100_flash.h"
#include "zigbee.h"
#include "md5.h"
#include "../common/md5.h"
}
#include "drawing.h"
@@ -31,17 +31,12 @@ extern "C" {
#define FW88MZ100
#define HAL_PacketRX commsRxUnenc
#define millis() timerGet()
#define HAL_TIMER_TICK TIMER_TICKS_PER_MSEC
void inline HAL_msDelay(uint32_t t) {
timerDelay(t * TIMER_TICKS_PER_MSEC);
}
void executeCommand(uint8_t c) {
}
void loadSettingsFromBuffer(uint8_t *buffer) {
}
@@ -87,4 +82,4 @@ static bool validateEepromMD5(uint64_t ver, uint32_t eepromstart, uint32_t flen)
#endif
}
#include "../common/oepl-protocol.cpp"
#include "../common/oepl-protocol.cpp"

View File

@@ -50,7 +50,7 @@ uint32_t OEPLFs::findEntry() {
uint8_t *scan = (uint8_t *)malloc(1024);
uint32_t offset = 0;
// scan flash with some overlap, to ensure the entire string is in the buffer at some point
for (uint32_t c = 60000; c < 180000; c += 512) {
for (uint32_t c = 64000; c < 180000; c += 512) {
FLASH_Read(FLASH_FAST_READ_QUAD_OUT, c, scan, 1024);
uint32_t scan_offset = 0;
bool nextblock = false;
@@ -80,7 +80,6 @@ uint32_t OEPLFs::findEntry() {
} else {
printf("FS: Not found. Did you forget to add it?\n");
FLASH_Read(FLASH_FAST_READ_QUAD_OUT, 0x109C0, scan, 1024);
dump(scan, 1024);
}
free(scan);
return offset;

View File

@@ -1,164 +0,0 @@
#include "powermgt.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
// #include <stdio.h>
#include <string.h>
#include "epd_interface.h"
#include "board.h"
#include "main.h"
#include "oepl-protocol.h"
#include "settings.h"
extern "C" {
#include "mz100/eeprom.h"
#include "mz100/mz100_sleep.h"
#include "mz100/printf.h"
#include "screen.h"
#include "mz100/util.h"
#include "zigbee.h"
}
__attribute__((section(".aonshadow"))) uint16_t dataReqAttemptArr[POWER_SAVING_SMOOTHING] = {0}; // Holds the amount of attempts required per data_req/check-in
__attribute__((section(".aonshadow"))) uint8_t dataReqAttemptArrayIndex = 0;
__attribute__((section(".aonshadow"))) uint8_t dataReqLastAttempt = 0;
__attribute__((section(".aonshadow"))) uint16_t nextCheckInFromAP = 0;
__attribute__((section(".aonshadow"))) uint8_t wakeUpReason = 0;
__attribute__((section(".aonshadow"))) uint8_t scanAttempts = 0;
__attribute__((section(".aonshadow"))) int8_t temperature = 0;
__attribute__((section(".aonshadow"))) uint16_t batteryVoltage = 0;
__attribute__((section(".aonshadow"))) bool lowBattery = false;
__attribute__((section(".aonshadow"))) uint16_t longDataReqCounter = 0;
__attribute__((section(".aonshadow"))) uint16_t voltageCheckCounter = 0;
__attribute__((section(".aonshadow"))) uint8_t capabilities = 0;
bool spiActive = false;
bool uartActive = false;
bool eepromActive = false;
bool i2cActive = false;
extern int8_t adcSampleTemperature(void); // in degrees C
uint8_t checkButtonOrJig() {
return DETECT_P1_0_NOTHING;
}
void setupPortsInitial() {
}
uint16_t doVoltageReading() {
batteryVoltage = (uint16_t)measureBattery();
if (batteryVoltage < tagSettings.batLowVoltage) {
lowBattery = true;
} else {
lowBattery = false;
}
return batteryVoltage;
}
void initPowerSaving(const uint16_t initialValue) {
for (uint8_t c = 0; c < POWER_SAVING_SMOOTHING; c++) {
dataReqAttemptArr[c] = initialValue;
}
}
static void configSPI(const bool setup) {
spiActive = setup;
}
static void configUART(const bool setup) {
/* if (setup == uartActive)
return;
uartActive = setup;
if (setup)
Serial.begin(115200);
else
Serial.end();*/
}
static void configEEPROM(const bool setup) {
}
static void configI2C(const bool setup) {
}
void powerUp(const uint8_t parts) {
// printf("Power up: %d\r\n", parts);
if (parts & INIT_RADIO) {
radioInit();
// radioRxFilterCfg(mSelfMac, 0x10000, PROTO_PAN_ID);
// radioSetTxPower(10);
if (currentChannel >= 11 && currentChannel <= 27) {
radioSetChannel(currentChannel);
} else {
radioSetChannel(RADIO_FIRST_CHANNEL);
}
}
if (parts & INIT_UART) {
configUART(true);
}
if (parts & INIT_EPD) {
configSPI(true);
epdSetup();
}
if (parts & INIT_EEPROM) {
configEEPROM(true);
}
if (parts & INIT_I2C) {
configI2C(true);
}
}
void powerDown(const uint8_t parts) {
if(parts & INIT_EPD){
epdEnterSleep();
}
// printf("Power down: %d\r\n", parts);
}
void doSleep(const uint32_t t) {
printf("Sleeping for: %d ms\r\n", t);
// sleepForMs(t);
delay(t);
}
uint32_t getNextScanSleep(const bool increment) {
if (increment) {
if (scanAttempts < 255)
scanAttempts++;
}
if (scanAttempts < INTERVAL_1_ATTEMPTS) {
return INTERVAL_1_TIME;
} else if (scanAttempts < (INTERVAL_1_ATTEMPTS + INTERVAL_2_ATTEMPTS)) {
return INTERVAL_2_TIME;
} else {
return INTERVAL_3_TIME;
}
}
void addAverageValue() {
uint16_t curval = INTERVAL_AT_MAX_ATTEMPTS - INTERVAL_BASE;
curval *= dataReqLastAttempt;
curval /= DATA_REQ_MAX_ATTEMPTS;
curval += INTERVAL_BASE;
dataReqAttemptArr[dataReqAttemptArrayIndex % POWER_SAVING_SMOOTHING] = curval;
dataReqAttemptArrayIndex++;
}
uint16_t getNextSleep() {
uint16_t avg = 0;
for (uint8_t c = 0; c < POWER_SAVING_SMOOTHING; c++) {
avg += dataReqAttemptArr[c];
}
avg /= POWER_SAVING_SMOOTHING;
return avg;
}

View File

@@ -11,13 +11,14 @@
#include "oepl-protocol.h"
#include "board.h"
extern "C"{
extern "C" {
#include "mz100/eeprom.h"
#include "mz100/mz100_sleep.h"
#include "mz100/printf.h"
#include "screen.h"
#include "mz100/util.h"
#include "zigbee.h"
#include "mz100/timer.h"
}
__attribute__((section(".aonshadow"))) uint16_t dataReqAttemptArr[POWER_SAVING_SMOOTHING] = {0}; // Holds the amount of attempts required per data_req/check-in
@@ -113,16 +114,14 @@ void powerUp(const uint8_t parts) {
}
void powerDown(const uint8_t parts) {
if(parts & INIT_EPD){
if (parts & INIT_EPD) {
epdEnterSleep();
}
// printf("Power down: %d\r\n", parts);
}
void doSleep(const uint32_t t) {
printf("Sleeping for: %d ms\r\n", t);
// sleepForMs(t);
delay(t);
timerDelay(t*TIMER_TICKS_PER_MSEC);
}
uint32_t getNextScanSleep(const bool increment) {
@@ -150,6 +149,9 @@ void addAverageValue() {
}
uint16_t getNextSleep() {
#ifdef DEBUG_FAST_CHECK_IN
return 20;
#endif
uint16_t avg = 0;
for (uint8_t c = 0; c < POWER_SAVING_SMOOTHING; c++) {
avg += dataReqAttemptArr[c];

View File

@@ -27,17 +27,17 @@
// power saving algorithm
#define INTERVAL_BASE 40 // interval (in seconds) (when 1 packet is sent/received) for target current (7.2µA)
#define INTERVAL_AT_MAX_ATTEMPTS 300 // interval (in seconds) (at max attempts) for target average current
#define DATA_REQ_RX_WINDOW_SIZE 5UL // How many milliseconds we should wait for a packet during the data_request.
#define DATA_REQ_RX_WINDOW_SIZE 4UL // How many milliseconds we should wait for a packet during the data_request.
// If the AP holds a long list of data for tags, it may need a little more time to lookup the mac address
#define DATA_REQ_MAX_ATTEMPTS 3 // How many attempts (at most) we should do to get something back from the AP
#define POWER_SAVING_SMOOTHING 8 // How many samples we should use to smooth the data request interval
#define MINIMUM_INTERVAL 45 // IMPORTANT: Minimum interval for check-in; this determines overal battery life!
#define MAXIMUM_PING_ATTEMPTS 3 // How many attempts to discover an AP the tag should do
#define PING_REPLY_WINDOW 5UL
#define PING_REPLY_WINDOW 10UL
#define LONG_DATAREQ_INTERVAL 300 // How often (in seconds, approximately) the tag should do a long datareq (including temperature)
#define VOLTAGE_CHECK_INTERVAL 288 // How often the tag should do a battery voltage check (multiplied by LONG_DATAREQ_INTERVAL)
#define BATTERY_VOLTAGE_MINIMUM 2950 // 2900 or below is the best we can do on the EPD
#define BATTERY_VOLTAGE_MINIMUM 2900 // 2900 or below is the best we can do on the EPD
// power saving when no AP's were found (scanning every X)
#define VOLTAGEREADING_DURING_SCAN_INTERVAL 2 // how often we should read voltages; this is done every scan attempt in interval bracket 3

View File

@@ -3,29 +3,25 @@
#include <stdint.h>
#define FW_VERSION 0x0027 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "-zlib" // suffix, like -RC1 or whatever.
#define FW_VERSION 0x0028 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "-cmds" // suffix, like -RC1 or whatever.
// #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
// #define PRINT_LUT // uncomment if you want the tag to print the LUT for the current temperature bracket
//#define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
//#define PRINT_LUT // uncomment if you want the tag to print the LUT for the current temperature bracket
// #define DEBUG_EPD
// #define DEBUG_FS
// #define DEBUG_COMPRESSION
// #define DEBUG_PROTO
// #define DEBUG_SETTINGS
// #define DEBUG_MAIN
// #define DEBUG_FAST_CHECK_IN
// #define DEBUG_DONTVALIDATEPROTO
//#define DEBUG_EPD
//#define DEBUG_FS
//#define DEBUG_COMPRESSION
//#define DEBUG_PROTO
//#define DEBUG_SETTINGS
//#define DEBUG_DONTVALIDATEPROTO
#if defined(DEBUG_SETTINGS) || defined(DEBUG_EPD) || defined(DEBUGBLOCKS) || defined(DEBUG_PROTO) || defined(DEBUG_COMPRESSION) || defined(DEBUG_FS)
#if defined(DEBUG_SETTINGS) || defined(DEBUG_EPD) || defined(DEBUGBLOCKS) || defined(DEBUG_PROTO) || defined(DEBUG_COMPRESSION) || defined(DEBUG_FS) || defined(DEBUG_MAIN) || defined(DEBUG_FAST_CHECK_IN)
#define DEBUG_BUILD
#endif
#define SETTINGS_STRUCT_VERSION 0x01
#define DEFAULT_SETTING_FASTBOOT 0

View File

@@ -14,11 +14,14 @@ extern "C" {
#include "mz100/mz100_pinmux.h"
#include "mz100/printf.h"
#include "mz100/util.h"
#include "mz100/timer.h"
}
#include "drawing.h"
#include "epd_interface.h"
#include "settings.h"
#define EPD_PANEL_SETTING 0x00
#define EPD_POWER_SETTING 0x01
#define EPD_POWER_OFF 0x02
@@ -122,39 +125,63 @@ struct __attribute__((packed)) epd_xonlut {
void uc8159::epdSetup() {
#ifdef DEBUG_EPD
printf("EPD: Init begin\n");
timerMs();
#endif
// printf("Start=%lu\n", timerMs());
initEPDGPIO();
this->epdReset();
eepromWake();
epdWrite(EPD_POWER_ON, 0);
busyWaitUntil(EPD_IS_NOT_BUSY, 100);
epdWrite(EPD_TRES, 0x04, 2, 128, 1, 128);
// wake the eeprom
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0x01);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_LOW);
epdWrite(EPD_WAKE_EEPROM, 0x00);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_HIGH);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0x00);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
epdWrite(EPD_POWER_SETTING, 4, 0x37, 0x00, 0x05, 0x05); // 0x37 - 00- 05 05 this one worked
busyWaitUntil(EPD_IS_BUSY, 50);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
epdWrite(EPD_PANEL_SETTING, 2, 0xC3, 0x08); // 0xC3-0x88 // lut from EEPROM
epdWrite(EPD_UNKNOWN_1, 1, 0x03); // load lut, probably
epdWrite(0xE3, 1, 0xFF); // max power save
epdWrite(EPD_POWER_OFF_SEQUENCE, 1, 0x00);
epdWrite(EPD_BOOSTER_SOFT_START, 0x03, 199, 204, 45);
epdWrite(EPD_PLL_CONTROL, 0x01, 60);
epdWrite(EPD_TEMP_SELECT, 0x01, 0x00);
epdWrite(EPD_VCOM_DATA_INTERVAL, 0x01, 119);
epdWrite(EPD_TCON_SET, 0x01, 34);
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x2D); // stock - 11 000 111 / 11 001 100 / 00 101 101
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x17); //- default - 00 010 111
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0x07, 0x0C, 0x2D); - no noticable difference
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0x0F, 0x0F, 0x0F); // 00 001 111
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x25); // end: 00 100 101 - works, good greys/no shadow
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x1C); // end: 00 011 101 - works!
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x15); // end: 00 010 101 - works too! Used this one!!!!!
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x0D); // end: 00 001 101 - still works!
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x05); // end: 00 000 101 - not enough
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0x17, 0x17, 0x1C); // ?
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x2D); // stock - 11 000 111 / 11 001 100 / 00 101 101
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xD7, 0xDC, 0x15); // 11 000 111 / 11 001 100 // okay shadowing
epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x26); // end: 00 100 110 - max 38mA?
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x25); // end: 00 100 101 - works, good greys/no shadows, 60mA
// epdWrite(EPD_BOOSTER_SOFT_START, 3, 0xC7, 0xCC, 0x28); // end 00 101 000 - max 170mA
epdWrite(EPD_PLL_CONTROL, 1, 0x3C);
epdWrite(EPD_TEMP_SELECT, 1, 0x00);
epdWrite(EPD_VCOM_DATA_INTERVAL, 1, 0x77);
// epdWrite(EPD_VCOM_DATA_INTERVAL, 1, 0x70);
epdWrite(EPD_TCON_SET, 1, 0x22);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
epdWrite(EPD_TRES, 4, 2, 128, 1, 128);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
EPDtempBracket = this->getTempBracket();
this->loadFrameRatePLL(EPDtempBracket);
this->loadTempVCOMDC(EPDtempBracket);
this->loadTempVCOMDC();
epdWrite(EPD_POWER_OFF, 0);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
epdWrite(EPD_POWER_ON, 0);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
this->loadFrameRatePLL();
// this->loadTempVSH(EPDtempBracket);
// epdWrite(EPD_POWER_SETTING, 4, 0x37, 0x00, this->vshc, this->vslc); // this doesn't work
#ifdef DEBUG_EPD
printf("EPD: Init complete\n");
printf("EPD: Init complete (%lu ms)\n", timerMs());
#endif
}
@@ -170,12 +197,10 @@ uint8_t uc8159::getTempBracket() {
uint8_t v1;
uint8_t temptable[40];
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0x01);
eepromReadBlock(0, 25002, temptable, 10);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0x00);
epdWrite(EPD_TEMP_CALIB, 0);
busyWaitUntil(EPD_IS_NOT_BUSY, 10);
busyWaitUntil(EPD_IS_NOT_BUSY, 200);
v0 = softSPIReadByte();
v1 = (uint8_t)(2 * v0) + ((uint8_t)softSPIReadByte() >> 7);
@@ -191,44 +216,35 @@ uint8_t uc8159::getTempBracket() {
#endif
return bracket;
}
void uc8159::loadFrameRatePLL(uint8_t bracket) {
void uc8159::loadFrameRatePLL() {
uint8_t pllvalue;
uint8_t plltable[12];
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0x01);
eepromReadBlock(0, 25039, plltable, 10);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0x00);
pllvalue = plltable[bracket];
pllvalue = plltable[EPDtempBracket];
#ifdef DEBUG_EPD
printf("loading pll value 0x%02X\n", pllvalue);
printf("EPD: loading pll value 0x%02X\n", pllvalue);
#endif
// pllvalue = 0x3A; // was 0x3C
epdWrite(EPD_PLL_CONTROL, 1, pllvalue);
}
void uc8159::loadTempVCOMDC(uint8_t bracket) {
void uc8159::loadTempVCOMDC() {
uint8_t vcomvalue;
uint8_t vcomtable[12];
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 1);
eepromReadBlock(0, 25049, vcomtable, 10);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0);
vcomvalue = vcomtable[bracket];
vcomvalue = vcomtable[EPDtempBracket];
#ifdef DEBUG_EPD
printf("EPD: loading vcomvalue value 0x%02X\n", vcomvalue);
#endif
epdWrite(EPD_VCOM_DC_SET, 1, vcomvalue);
}
void uc8159::loadTempVSH(uint8_t bracket) {
uint8_t vshtable[20];
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 1);
eepromReadBlock(0, 25011, vshtable, 20);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0);
this->vshc = vshtable[bracket * 2];
this->vslc = vshtable[(bracket * 2) + 1];
}
uint8_t *uc8159::loadLUT(uint8_t index, uint8_t bracket) {
uint8_t *uc8159::loadLUT(uint8_t index) {
uint16_t adr = 0;
uint16_t len = 0;
uint8_t *lutBuffer;
switch (index) {
case EPD_LUT_VCOM:
// VCOM LUT
adr = 20800 + (220 * bracket);
adr = 20800 + (220 * EPDtempBracket);
len = 220;
break;
case EPD_LUT_B:
@@ -239,21 +255,19 @@ uint8_t *uc8159::loadLUT(uint8_t index, uint8_t bracket) {
case EPD_LUT_R1:
case EPD_LUT_R2:
case EPD_LUT_R3:
adr = (bracket * 2080);
adr = (EPDtempBracket * 2080);
adr += (index - 0x21) * 260;
len = 260;
break;
case EPD_LUT_XON:
// XON LUT
adr = 23000 + (200 * bracket);
adr = 23000 + (200 * EPDtempBracket);
len = 200;
break;
}
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 1);
lutBuffer = (uint8_t *)malloc(len);
if (lutBuffer) eepromReadBlock(0, adr, lutBuffer, len);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0);
return lutBuffer;
}
@@ -275,10 +289,10 @@ void xonLutSkip(struct epd_xonlut *colorlut, uint8_t skip) {
}
}
void uc8159::loadLUTSfromEEPROM(uint8_t bracket, bool doRed) {
void uc8159::loadLUTSfromEEPROM(bool doRed) {
doRed = false;
for (uint8_t c = EPD_LUT_B; c <= EPD_LUT_R3; c++) {
struct epd_colorlut *colorlut = (struct epd_colorlut *)loadLUT(c, bracket);
struct epd_colorlut *colorlut = (struct epd_colorlut *)loadLUT(c);
colorLutSkip(colorlut, 0);
colorLutSkip(colorlut, 0);
@@ -289,6 +303,7 @@ void uc8159::loadLUTSfromEEPROM(uint8_t bracket, bool doRed) {
colorLutSkip(colorlut, 2);
colorLutSkip(colorlut, 2);
colorLutSkip(colorlut, 2);
colorLutSkip(colorlut, 2);
}
// colorLutSkip(colorlut, 3);
@@ -297,7 +312,7 @@ void uc8159::loadLUTSfromEEPROM(uint8_t bracket, bool doRed) {
if (colorlut) free(colorlut);
}
struct epd_vcomlut *vcomlut = (struct epd_vcomlut *)loadLUT(EPD_LUT_VCOM, bracket);
struct epd_vcomlut *vcomlut = (struct epd_vcomlut *)loadLUT(EPD_LUT_VCOM);
vcomLutSkip(vcomlut, 0);
vcomLutSkip(vcomlut, 0);
vcomlut->part[0].repeat = 1;
@@ -308,11 +323,12 @@ void uc8159::loadLUTSfromEEPROM(uint8_t bracket, bool doRed) {
vcomLutSkip(vcomlut, 2);
vcomLutSkip(vcomlut, 2);
vcomLutSkip(vcomlut, 2);
vcomLutSkip(vcomlut, 2);
}
epdBlockWrite(EPD_LUT_VCOM, (uint8_t *)vcomlut, 220);
if (vcomlut) free(vcomlut);
struct epd_xonlut *xonlut = (struct epd_xonlut *)loadLUT(EPD_LUT_XON, bracket);
struct epd_xonlut *xonlut = (struct epd_xonlut *)loadLUT(EPD_LUT_XON);
xonLutSkip(xonlut, 0);
xonLutSkip(xonlut, 0);
@@ -323,38 +339,32 @@ void uc8159::loadLUTSfromEEPROM(uint8_t bracket, bool doRed) {
xonLutSkip(xonlut, 2);
xonLutSkip(xonlut, 2);
xonLutSkip(xonlut, 2);
xonLutSkip(xonlut, 2);
}
epdBlockWrite(EPD_LUT_XON, (uint8_t *)xonlut, 200);
if (xonlut) free(xonlut);
}
void uc8159::epdReset() {
uint8_t v0 = 5;
#ifdef DEBUG_EPD
printf("EPD: Reset... ");
printf("EPD: Reset\n");
#endif
while (1) {
uint8_t attempt = 0;
while (attempt < 5) {
GPIO_WritePinOutput(EPD_RESET, GPIO_IO_HIGH);
delay(100);
GPIO_WritePinOutput(EPD_RESET, GPIO_IO_LOW);
delay(3000);
delay(30 + (750 * attempt));
GPIO_WritePinOutput(EPD_RESET, GPIO_IO_HIGH);
delay(3000);
busyWaitUntil(EPD_IS_NOT_BUSY, 500);
delay(600);
if (GPIO_ReadPinLevel(EPD_BUSY))
break;
v0--;
if (!v0) {
printf(" - EPD reset failure!\r\n");
break;
}
printf("EPD: Reset attempt %d\n", attempt + 1);
}
delay(5000);
#ifdef DEBUG_EPD
printf("complete.\n");
#endif
}
void uc8159::eepromReadBlock(char a1, uint16_t readaddress, uint8_t *target, uint16_t length) {
GPIO_WritePinOutput(EPD_CS, GPIO_IO_HIGH);
eepromSelect(true);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_LOW);
softSPIWriteByte(3);
softSPIWriteByte(a1);
@@ -372,7 +382,6 @@ void uc8159::eepromReadBlock(char a1, uint16_t readaddress, uint8_t *target, uin
readbyte |= 1u;
GPIO_WritePinOutput(EPD_CLK, GPIO_IO_HIGH);
delay_us(1);
delay(1);
loopCount++;
} while (loopCount < 8);
delay_us(1);
@@ -380,8 +389,29 @@ void uc8159::eepromReadBlock(char a1, uint16_t readaddress, uint8_t *target, uin
}
GPIO_WritePinOutput(EPD_CLK, GPIO_IO_LOW);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_HIGH);
delay(1);
eepromSelect(false);
}
void uc8159::eepromSelect(bool select) {
if (select) {
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 1);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_LOW);
} else {
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_HIGH);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0);
}
delay(100);
}
void uc8159::eepromWake() {
eepromSelect(true);
softSPIWriteByte(EPD_WAKE_EEPROM);
eepromSelect(false);
}
void uc8159::eepromSleep() {
eepromSelect(true);
softSPIWriteByte(EPD_EEPROM_SLEEP);
eepromSelect(false);
}
void uc8159::interleaveColorToBuffer(uint8_t *dst, uint8_t b, uint8_t r) {
@@ -411,12 +441,11 @@ void uc8159::interleaveColorToBuffer(uint8_t *dst, uint8_t b, uint8_t r) {
}
void uc8159::epdWriteDisplayData() {
uint8_t blocksize = 32;
uint8_t blocksize = 64; // how many rows of pixels will be rendered in one go. Increasing this will increase rendering speed for compressed BWR images, but will use more RAM
uint16_t byteWidth = this->effectiveXRes / 8;
uint8_t screenrow_bw[byteWidth * blocksize];
uint8_t screenrow_r[byteWidth * blocksize];
uint8_t screenrowInterleaved[byteWidth * 4];
// setDisplayWindow(0, 0, 640, 384);
epdWrite(EPD_START_DATA, 0);
enableHardSPI(true);
GPIO_WritePinOutput(EPD_CS, GPIO_IO_LOW);
@@ -429,11 +458,15 @@ void uc8159::epdWriteDisplayData() {
drawItem::renderDrawLine(screenrow_bw + (byteWidth * bcount), curY + bcount, 0);
}
for (uint8_t bcount = 0; bcount < blocksize; bcount++) {
if (this->bpp == 1) {
drawItem::renderDrawLine(screenrow_bw + (byteWidth * bcount), curY + bcount, 1);
} else {
drawItem::renderDrawLine(screenrow_r + (byteWidth * bcount), curY + bcount, 1);
drawItem::renderDrawLine(screenrow_r + (byteWidth * bcount), curY + bcount, 1);
}
// the BW tags need to map Red onto the black buffer
if (this->bpp == 1) {
for (uint16_t i = 0; i < (byteWidth * blocksize); i++) {
screenrow_bw[i] |= screenrow_r[i];
}
memset(screenrow_r, 0, byteWidth * blocksize);
}
for (uint8_t bcount = 0; bcount < blocksize; bcount++) {
@@ -445,7 +478,7 @@ void uc8159::epdWriteDisplayData() {
}
GPIO_WritePinOutput(EPD_CS, GPIO_IO_HIGH);
enableHardSPI(false);
// get rid of the drawItem list
drawItem::flushDrawItems();
}
@@ -455,31 +488,37 @@ void uc8159::draw() {
}
void uc8159::drawNoWait() {
#ifdef DEBUG_EPD
timerMs();
#endif
epdWriteDisplayData();
if (this->bpp == 1) drawLut = 0;
#ifdef DEBUG_EPD
printf("EPD: Rendering took %lu ms\n", timerMs());
#endif
if (drawLut) {
// epdWrite(EPD_PLL_CONTROL, 1, 0x3A); // scan the gates a little faster
epdWrite(EPD_PANEL_SETTING, 2, 0xC3, 0x88); // 0xC3-0x88 // lut from register
bool doReds = true;
if (drawLut == 2) doReds = false;
loadLUTSfromEEPROM(EPDtempBracket, doReds);
loadLUTSfromEEPROM(doReds);
epdWrite(EPD_PLL_CONTROL, 1, 0x3A); // 0x29 turbo turbo
} else {
epdWrite(EPD_PANEL_SETTING, 2, 0xC3, 0x08); // 0xC3-0x88 // lut from EEPROM
epdWrite(EPD_UNKNOWN_1, 1, 0x03); // load lut, probably
busyWaitUntil(EPD_IS_BUSY, 10);
busyWaitUntil(!EPD_IS_BUSY, 100);
}
#ifdef DEBUG_EPD
printf("EPD: Draw start\n");
#endif
wdt10s();
epdWrite(EPD_REFRESH, 0);
busyWaitUntil(EPD_IS_BUSY, 10);
busyWaitUntil(EPD_IS_BUSY, 500);
}
void uc8159::epdWaitRdy() {
delay(15000);
do_sleeped_epd_refresh();
// busyWaitUntil(!EPD_IS_BUSY, 300000);
// busyWaitUntil(!EPD_IS_BUSY, 40000);
#ifdef DEBUG_EPD
printf("EPD: Draw done!\n");
#endif
@@ -488,15 +527,12 @@ void uc8159::epdWaitRdy() {
void uc8159::epdEnterSleep() {
initEPDGPIO();
this->epdReset();
eepromSleep();
epdWrite(EPD_POWER_SETTING, 4, 0x02, 0x00, 0x00, 0x00);
delay_us(50000);
delay_us(10000);
epdWrite(EPD_POWER_OFF, 0);
delay_us(100000);
busyWaitUntil(EPD_IS_NOT_BUSY, 100000);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 1);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_LOW);
softSPIWriteByte(EPD_EEPROM_SLEEP);
GPIO_WritePinOutput(EPD_HLT_CTRL, GPIO_IO_HIGH);
epdWrite(EPD_SPI_FLASH_CONTROL, 1, 0);
delay_us(10000);
busyWaitUntil(EPD_IS_NOT_BUSY, 1000);
epdWrite(EPD_DEEP_SLEEP, 1, 0xA5);
}

View File

@@ -22,12 +22,14 @@ class uc8159 : public epdInterface {
void epdWriteDisplayData();
void interleaveColorToBuffer(uint8_t *dst, uint8_t b, uint8_t r);
void eepromReadBlock(char a1, uint16_t readaddress, uint8_t *target, uint16_t length);
void eepromSelect(bool select);
void eepromWake();
void eepromSleep();
void epdReset();
void loadLUTSfromEEPROM(uint8_t bracket, bool doRed);
uint8_t *loadLUT(uint8_t index, uint8_t bracket);
void loadTempVSH(uint8_t bracket);
void loadTempVCOMDC(uint8_t bracket);
void loadFrameRatePLL(uint8_t bracket);
void loadLUTSfromEEPROM(bool doRed);
uint8_t *loadLUT(uint8_t index);
void loadTempVCOMDC();
void loadFrameRatePLL();
uint8_t getTempBracket();
uint8_t EPDtempBracket = 0;
uint8_t vshc;

View File

@@ -0,0 +1,197 @@
#include "main.h"
#include "uc8176-var-m2.h"
extern "C" {
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "mz100/gpio.h"
#include "mz100/mz100_gpio.h"
#include "mz100/mz100_pinmux.h"
#include "mz100/printf.h"
#include "mz100/util.h"
}
#include "settings.h"
#include "drawing.h"
#include "epd_interface.h"
#define EPD_PANEL_SETTING 0x00
#define EPD_POWER_SETTING 0x01
#define EPD_POWER_OFF 0x02
#define EPD_POWER_OFF_SEQUENCE 0x03
#define EPD_POWER_ON 0x04
#define EPD_BOOSTER_SOFT_START 0x06
#define EPD_DEEP_SLEEP 0x07
#define EPD_START_DTM1 0x10
#define EPD_DATA_STOP 0x11
#define EPD_REFRESH 0x12
#define EPD_START_DTM2 0x13
#define EPD_LUT_VCOM 0x20
#define EPD_LUT_B 0x21
#define EPD_LUT_W 0x22
#define EPD_LUT_G1 0x23
#define EPD_LUT_G2 0x24
#define EPD_LUT_R0 0x25
#define EPD_LUT_R1 0x26
#define EPD_LUT_R2 0x27
#define EPD_LUT_R3 0x28
#define EPD_LUT_XON 0x29
#define EPD_PLL_CONTROL 0x30
#define EPD_TEMP_CALIB 0x40
#define EPD_TEMP_SELECT 0x41
#define EPD_TEMP_WRITE 0x42
#define EPD_TEMP_READ 0x43
#define EPD_VCOM_DATA_INTERVAL 0x50
#define EPD_LPD 0x51
#define EPD_TCON_SET 0x60
#define EPD_TRES 0x61
#define EPD_SPI_FLASH_CONTROL 0x65
#define EPD_REVISION 0x70
#define EPD_GET_STATUS 0x71
#define EPD_AUTOMEASURE_VCOM 0x80
#define EPD_READ_VCOM 0x81
#define EPD_VCOM_DC_SET 0x82
#define EPD_SET_WINDOW 0x90
#define EPD_WAKE_EEPROM 0xAB
#define EPD_EEPROM_SLEEP 0xB9
#define EPD_UNKNOWN_1 0xE5
#define EPD_IS_BUSY false
#define EPD_IS_NOT_BUSY true
extern "C" {
extern void dump(const uint8_t *a, const uint16_t l);
}
void uc8176::epdSetup() {
#ifdef DEBUG_EPD
printf("EPD: Init begin\n");
#endif
initEPDGPIO();
this->epdReset();
epdWrite(0x01, 2, 0x03, 0x00);
epdWrite(0x06, 3, 0x17, 0x17, 0x17);
//epdWrite(0x30, 1, 0x39); // 4hz Framerate < no setup for this in stock
epdWrite(0x60,1, 0x11); // tcon non-overlap
epdWrite(EPD_POWER_ON, 0);
busyWaitUntil(EPD_IS_NOT_BUSY, 100);
delay(10000);
epdWrite(0x61, 4, 0x01, 0x90, 0x01, 0x2C);
epdWrite(0x50, 1, 0x87); // 0x87 correct for polarity and border - 0x8C = 5 interval
epdWrite(0x00, 1, 0x0F); // was 0x07
epdWrite(0x41, 1, 0x0F);
epdWrite(0x40, 0);
busyWaitUntil(EPD_IS_NOT_BUSY, 10000);
delay(1000);
#ifdef DEBUG_EPD
printf("EPD: Init complete\n");
#endif
}
void uc8176::selectLUT(uint8_t lut) {
this->drawLut = lut;
}
uc8176::~uc8176() {
}
void uc8176::epdReset() {
uint8_t v0 = 5;
#ifdef DEBUG_EPD
printf("EPD: Reset... ");
#endif
while (1) {
GPIO_WritePinOutput(EPD_RESET, GPIO_IO_HIGH);
delay(100);
GPIO_WritePinOutput(EPD_RESET, GPIO_IO_LOW);
delay(3000);
GPIO_WritePinOutput(EPD_RESET, GPIO_IO_HIGH);
delay(3000);
if (GPIO_ReadPinLevel(EPD_BUSY))
break;
v0--;
if (!v0) {
printf(" - EPD reset failure!\r\n");
break;
}
}
delay(5000);
#ifdef DEBUG_EPD
printf("complete.\n");
#endif
}
void uc8176::epdWriteDisplayData() {
uint16_t byteWidth = this->effectiveXRes / 8;
uint8_t screenrow[byteWidth];
epdWrite(EPD_START_DTM1, 0);
enableHardSPI(true);
GPIO_WritePinOutput(EPD_CS, GPIO_IO_LOW);
for (uint16_t curY = 0; curY < this->effectiveYRes; curY += 1) { //
memset(screenrow, 0, byteWidth);
drawItem::renderDrawLine(screenrow, curY, 0);
epdBlockWrite(screenrow, byteWidth);
}
GPIO_WritePinOutput(EPD_CS, GPIO_IO_HIGH);
enableHardSPI(false);
epdWrite(EPD_START_DTM2, 0);
enableHardSPI(true);
GPIO_WritePinOutput(EPD_CS, GPIO_IO_LOW);
for (uint16_t curY = 0; curY < this->effectiveYRes; curY += 1) { //
memset(screenrow, 0, byteWidth);
drawItem::renderDrawLine(screenrow, curY, 1);
epdBlockWrite(screenrow, byteWidth);
}
GPIO_WritePinOutput(EPD_CS, GPIO_IO_HIGH);
enableHardSPI(false);
drawItem::flushDrawItems();
}
void uc8176::draw() {
this->drawNoWait();
this->epdWaitRdy();
}
void uc8176::drawNoWait() {
#ifdef DEBUG_EPD
printf("EPD: Draw start\n");
#endif
epdWriteDisplayData();
wdt10s();
#ifdef DEBUG_EPD
printf("EPD: Refresh start\n");
#endif
epdWrite(EPD_REFRESH, 0);
busyWaitUntil(EPD_IS_BUSY, 10);
}
void uc8176::epdWaitRdy() {
delay(15000);
do_sleeped_epd_refresh();
// delay(150000);
// busyWaitUntil(!EPD_IS_BUSY, 300000);
#ifdef DEBUG_EPD
printf("EPD: Draw done!\n");
#endif
delay(1000);
}
void uc8176::epdEnterSleep() {
initEPDGPIO();
this->epdReset();
epdWrite(EPD_POWER_OFF, 0);
delay_us(100000);
busyWaitUntil(EPD_IS_NOT_BUSY, 100000);
epdWrite(EPD_DEEP_SLEEP, 1, 0xA5);
}

View File

@@ -0,0 +1,23 @@
#pragma once
// #include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "epd_interface.h"
class uc8176 : public epdInterface {
public:
~uc8176();
void epdSetup();
void epdEnterSleep();
void draw();
void drawNoWait();
void epdWaitRdy();
void selectLUT(uint8_t lut);
protected:
uint8_t drawLut;
void epdWriteDisplayData();
void epdReset();
};

View File

@@ -3,7 +3,6 @@
#include <stdbool.h>
#include <string.h>
#include "bitmaps.h"
#include "board.h"
#include "comms.h"
#include "epd_interface.h"
@@ -22,12 +21,12 @@ const char fwVersionSuffix[] = FW_VERSION_SUFFIX;
extern uint8_t capabilities;
bool __attribute__((section(".aonshadow"))) lowBatteryShown = false;
bool __attribute__((section(".aonshadow"))) noAPShown = false;
bool __attribute__((section(".aonshadow"))) lowBatteryShown;
bool __attribute__((section(".aonshadow"))) noAPShown;
void addOverlay() {
if ((currentChannel == 0) && (tagSettings.enableNoRFSymbol)) {
// drawImg(0, 3, norf);
fs->init();
drawMask((epd->Xres - 48) - 5, 8, 48, 42, COLOR_BLACK);
drawMask((epd->Xres - 48) - 5, 8, 48, 42, COLOR_RED);
addCompressedFSImage((epd->Xres - 48) - 5, 8, rotation::ROTATE_0, (char *)"norf.bin.z");
@@ -35,7 +34,9 @@ void addOverlay() {
} else {
noAPShown = false;
}
if ((batteryVoltage < tagSettings.batLowVoltage) && (tagSettings.enableLowBatSymbol)) {
if ((lowBattery) && (tagSettings.enableLowBatSymbol)) {
fs->init();
drawMask((epd->Xres - 48) - 5, (epd->Yres - 26) - 7, 48, 26, COLOR_BLACK);
drawMask((epd->Xres - 48) - 5, (epd->Yres - 26) - 7, 48, 26, COLOR_RED);
addCompressedFSImage((epd->Xres - 48) - 5, (epd->Yres - 26) - 7, rotation::ROTATE_0, (char *)"lowbat.bin.z");
@@ -43,6 +44,7 @@ void addOverlay() {
} else {
lowBatteryShown = false;
}
#ifdef DEBUG_BUILD
fs->init();
fontrender fr((char *)"font/FreeSansBold18pt7b");
@@ -72,10 +74,16 @@ void showSplashScreen() {
fontrender fr((char *)"font/FreeSansBold24pt7b");
fr.epdPrintf(5, 5, 0, rotation::ROTATE_0, (char *)"OpenEPaperLink");
fr.setFont((char *)"font/FreeSansBold18pt7b");
fr.epdPrintf(20, 70, 1, rotation::ROTATE_0, "M2 7.5\"");
if (tagProfile.bpp == 2) {
fr.epdPrintf(15, 70, 1, rotation::ROTATE_0, "M2 7.5\" BWR");
} else {
fr.epdPrintf(20, 70, 1, rotation::ROTATE_0, "M2 7.5\" BW");
}
fr.epdPrintf(10, 350, 0, rotation::ROTATE_0, "Tag MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(80, 160, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.setFont((char *)"font/FreeSans9pt7b");
fr.epdPrintf(622, 280, 0, rotation::ROTATE_270, "v%04X%s", FW_VERSION, FW_VERSION_SUFFIX);
selectLUT(1);
draw();
epdEnterSleep();
@@ -108,7 +116,10 @@ void showAPFound() {
fr.epdPrintf(20, 110, 0, rotation::ROTATE_0, "AP MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", APmac[7], APmac[6], APmac[5], APmac[4], APmac[3], APmac[2], APmac[1], APmac[0]);
fr.epdPrintf(10, 315, 0, rotation::ROTATE_0, "Battery: %d.%dV", batteryVoltage / 1000, batteryVoltage % 1000);
fr.epdPrintf(10, 350, 0, rotation::ROTATE_0, "Tag MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.setFont((char *)"font/FreeSans9pt7b");
fr.epdPrintf(622, 280, 0, rotation::ROTATE_270, "v%04X%s", FW_VERSION, FW_VERSION_SUFFIX);
addOverlay();
if (lowBatteryShown) {
selectLUT(0);
} else {
@@ -140,16 +151,12 @@ void showNoAP() {
}
void showLongTermSleep() {
// selectLUT(EPD_LUT_NO_REPEATS);
// clearScreen();
// epdPrintBegin(2, SCREEN_HEIGHT - 16, EPD_DIRECTION_X, EPD_SIZE_SINGLE, EPD_COLOR_BLACK);
// epdpr("zZ");
// epdPrintEnd();
addOverlay();
// drawWithSleep();
epdSetup();
selectLUT(0);
draw();
epdEnterSleep();
}
void showNoEEPROM() {
// selectLUT(EPD_LUT_NO_REPEATS);
// clearScreen();

View File

@@ -134,7 +134,7 @@ void getTemperature() {
temperature = (uint8_t)(temp / 100);
printf("temp = %lu.%lu\n", temp / 100, temp % 100);
//printf("temp = %lu.%lu\n", temp / 100, temp % 100);
}
void boardGetOwnMac(uint8_t *mac) {

View File

@@ -105,6 +105,7 @@ struct tagSpecs {
uint8_t buttonCount = 0;
bool hasNFC = false;
bool hasLED = false;
bool hasThirdColor = false;
uint16_t macSuffix = 0x0000;
uint8_t OEPLtype = 0;
uint8_t solumType = 0;

View File

@@ -36,6 +36,13 @@ void identifyTagInfo() {
CA FE BA DE 15 0B 12 04 00 10 01 E0 01 20 03 39 00 03 81 9D 00 00 4C FF FF FF FF FF FF FF FF FF 7.4 UC8179
F3 22 BC 05 15 0A 0D 04 00 19 01 A0 02 C0 03 38 07 07 01 80 00 00 64 FF FF FF FF FF FF FF FF FF 9.7 SSD
AD BA FE CA 15 0A 1B 04 00 19 01 A0 02 C0 03 38 07 07 01 80 00 00 64 FF FF FF FF FF FF FF FF FF 9.7 type 2
92 C3 80 05 15 08 19 04 00 12 01 18 03 10 01 04 07 07 01 80 00 00 63 FF FF FF FF FF FF FF FF FF 5.85 BWR
22 F0 BF 05 15 0A 14 04 00 12 00 18 03 10 01 04 07 07 01 80 00 00 24 FF FF FF FF FF FF FF FF FF 5.85 BW
99 78 B1 05 15 0A 06 04 00 0D 01 68 01 B8 00 38 07 07 01 80 00 00 43 FF FF FF FF FF FF FF FF FF 2.6"
72 92 1E 7E 15 0B 09 04 00 15 00 80 01 A8 00 38 00 01 01 9C 00 00 22 FF FF FF FF FF FF FF FF FF 2.9" FREEZER
31 50 53 06 16 02 19 04 00 12 01 C8 00 C8 00 04 00 07 01 9C 00 00 40 FF FF FF FF FF FF FF FF FF
MAC | calib | |?????|Xres |Yres | ??? |capab| |type|
@@ -49,7 +56,7 @@ void identifyTagInfo() {
0x12 - SSD (var1.6)
0x15 - SSD (2.9 lite)
0x19 - SSD (9.7)
0x0A - Have third color?
0x12 - 0x01 | (0x80 if it has a button)
0x13 - 0x80 | (0x10 if it has a LED) | (0x0C ?? ) | (0x01 if it has a button)
*/
@@ -65,12 +72,20 @@ void identifyTagInfo() {
capabilities[1] = getUICRByte(0x13);
tag.solumType = getUICRByte(0x16);
if (getUICRByte(0x0A) == 0x01) {
tag.hasThirdColor = true;
}
switch (controllerType) {
case 0x0F:
case 0x12:
case 0x15:
case 0x19:
epd = new unissd;
if (epdXRes == 792 && epdYRes == 272) {
epd = new dualssd;
} else {
epd = new unissd;
}
break;
case 0x0D:
epd = new epdvar29;
@@ -106,6 +121,28 @@ void identifyTagInfo() {
if (capabilities[1] & 0x10) tag.hasLED = true;
if (capabilities[0] & 0x01) tag.hasNFC = true;
#ifdef DEBUG_SHOW_TAGINFO
printf("TagType report:\n");
printf("Resolution: %d*%d Px\n", epd->Xres, epd->Yres);
printf("Nb of buttons: %d\n", tag.buttonCount);
if (tag.hasLED) {
printf("This tag have a led: Yes\n");
} else {
printf("This tag have a led: No\n");
}
if (tag.hasNFC) {
printf("This tag have NFC: Yes\n");
} else {
printf("This tag have NFC: No\n");
}
if (tag.hasThirdColor) {
printf("This tag is Black and white only: No\n");
} else {
printf("This tag is Black and white only: Yes\n");
}
#endif
// we'll calculate image slot size here
uint32_t imageSize = epd->Xres * epd->Yres / 4;
tag.imageSize = ((imageSize + EEPROM_ERZ_SECTOR_SZ - 1) / EEPROM_ERZ_SECTOR_SZ) * EEPROM_ERZ_SECTOR_SZ;
@@ -115,6 +152,8 @@ void identifyTagInfo() {
tag.macSuffix = 0xB0D0;
epd->epdMirrorV = true;
tag.OEPLtype = SOLUM_M3_BWR_16;
epd->effectiveXRes = epdXRes;
epd->effectiveYRes = epdYRes - 1; // Yeah... I wonder why too....
break;
case STYPE_SIZE_022:
tag.macSuffix = 0xB190;
@@ -122,6 +161,12 @@ void identifyTagInfo() {
tag.OEPLtype = SOLUM_M3_BWR_22;
epd->XOffset = 8;
break;
case STYPE_SIZE_026:
tag.macSuffix = 0xB3D0;
epd->drawDirectionRight = true;
tag.OEPLtype = SOLUM_M3_BWR_26;
epd->XOffset = 8;
break;
case STYPE_SIZE_029:
tag.OEPLtype = SOLUM_M3_BWR_29;
if (tag.buttonCount == 2) {
@@ -134,6 +179,12 @@ void identifyTagInfo() {
epd->drawDirectionRight = true;
epd->XOffset = 8;
break;
case STYPE_SIZE_029_FREEZER:
tag.OEPLtype = SOLUM_M3_BW_29;
tag.macSuffix = 0x82D0;
epd->drawDirectionRight = true;
epd->XOffset = 8;
break;
case STYPE_SIZE_042:
tag.macSuffix = 0xB6D0;
tag.OEPLtype = SOLUM_M3_BWR_42;
@@ -145,6 +196,14 @@ void identifyTagInfo() {
// epd->mirrorH = true;
tag.OEPLtype = SOLUM_M3_BWR_43;
break;
case STYPE_SIZE_058:
tag.macSuffix = 0xE3D0;
tag.OEPLtype = SOLUM_M3_BWR_58;
break;
case STYPE_SIZE_058_FREEZER:
tag.macSuffix = 0x84D0;
tag.OEPLtype = SOLUM_M3_BW_58;
break;
case STYPE_SIZE_060:
tag.macSuffix = 0xB890;
tag.OEPLtype = SOLUM_M3_BWR_60;

View File

@@ -49,6 +49,8 @@
#define BATTERY_VOLTAGE_MINIMUM 2450 // 2600 or below is the best we can do on the EPD
#define WAKE_SECOND_CHECKIN_DELAY 10000UL
// power saving when no AP's were found (scanning every X)
#define VOLTAGEREADING_DURING_SCAN_INTERVAL 2 // how often we should read voltages; this is done every scan attempt in interval bracket 3
#define INTERVAL_1_TIME 3600UL // Try every hour

View File

@@ -5,12 +5,26 @@
#define FW_VERSION 0x0027 // version number (max 2.5.5 :) )
#define FW_VERSION_SUFFIX "ZLIB" // suffix, like RC1 or whatever.
#define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
// #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
#endif
// #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
// #define DEBUG_SHOW_TAGINFO
// #define DEBUG_DRAWING
// #define DEBUG_EPD
// #define DEBUG_FS
// #define DEBUG_COMPRESSION
// #define DEBUG_PROTO
// #define DEBUG_SETTINGS
// #define DEBUG_MAIN
// #define DEBUG_FAST_CHECK_IN
// #define DEBUG_DONTVALIDATEPROTO
#if defined(DEBUG_SETTINGS) || defined(DEBUG_EPD) || defined(DEBUGBLOCKS) || defined(DEBUG_PROTO) || defined(DEBUG_COMPRESSION) || defined(DEBUG_FS) || defined(DEBUG_MAIN) || defined(DEBUG_FAST_CHECK_IN) || defined(DEBUG_SHOW_TAGINFO) || defined(DEBUG_DONTVALIDATEPROTO) || defined(DEBUG_DRAWING)
#define DEBUG_BUILD
#define DEBUG_DRAWING
#endif
#define SETTINGS_STRUCT_VERSION 0x01

View File

@@ -1,5 +1,5 @@
[platformio]
core_dir = $PROJECT_DIR/core
core_dir = D:/Documents/GitHub/OpenEPaperLink/ARM_Tag_FW/Newton_M3_nRF52811/core
[env]
platform = nordicnrf52@9.6.0

View File

@@ -0,0 +1,212 @@
#include <Arduino.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lut.h"
#include "settings.h"
#include "hal.h"
#include "wdt.h"
#include "drawing.h"
#include "dualssd.h"
#define CMD_DRV_OUTPUT_CTRL 0x01
#define CMD_SOFT_START_CTRL 0x0C
#define CMD_ENTER_SLEEP 0x10
#define CMD_DATA_ENTRY_MODE 0x11
#define CMD_SOFT_RESET 0x12
#define CMD_SOFT_RESET2 0x13
#define CMD_SETUP_VOLT_DETECT 0x15
#define CMD_TEMP_SENSOR_CONTROL 0x18
#define CMD_ACTIVATION 0x20
#define CMD_DISP_UPDATE_CTRL 0x21
#define CMD_DISP_UPDATE_CTRL2 0x22
#define CMD_WRITE_FB_BW 0x24
#define CMD_WRITE_FB_RED 0x26
#define CMD_VCOM_GLITCH_CTRL 0x2B
#define CMD_LOAD_OTP_LUT 0x31
#define CMD_WRITE_LUT 0x32
#define CMD_BORDER_WAVEFORM_CTRL 0x3C
#define CMD_WINDOW_X_SIZE 0x44
#define CMD_WINDOW_Y_SIZE 0x45
#define CMD_WRITE_PATTERN_RED 0x46
#define CMD_WRITE_PATTERN_BW 0x47
#define CMD_XSTART_POS 0x4E
#define CMD_YSTART_POS 0x4F
#define CMD_ANALOG_BLK_CTRL 0x74
#define CMD_DIGITAL_BLK_CTRL 0x7E
#define SCREEN_CMD_CLOCK_ON 0x80
#define SCREEN_CMD_CLOCK_OFF 0x01
#define SCREEN_CMD_ANALOG_ON 0x40
#define SCREEN_CMD_ANALOG_OFF 0x02
#define SCREEN_CMD_LATCH_TEMPERATURE_VAL 0x20
#define SCREEN_CMD_LOAD_LUT 0x10
#define SCREEN_CMD_USE_MODE_2 0x08 // modified commands 0x10 and 0x04
#define SCREEN_CMD_REFRESH 0xC7
#define CONTROLLER_ONE 0x00
#define CONTROLLER_TWO 0x80
void dualssd::selectLUT(uint8_t lut) {
// implement alternative LUTs here. Currently just reset the watchdog to two minutes,
// to ensure it doesn't reset during the much longer bootup procedure
lut += 1; // make the compiler a happy camper
wdt120s();
return;
}
void dualssd::epdEnterSleep() {
epdWrite(CMD_ENTER_SLEEP, 1, 0x01);
}
void dualssd::epdSetup() {
printf("init epd...\n");
epdReset();
epdWrite(CMD_SOFT_RESET, 0);
delay(10);
switch (this->controllerType) {
case 0x0F:
case 0x12:
case 0x15:
/* 5.85 INIT SEQUENCE
0x11, 0x00
0x91, 0x01
0x44, 0x31, 0x00
0x45, 0x0F, 0x01, 0x00, 0x00
0x4E, 0x31
0x4F, 0x0F, 0x01
0xC4, 0x00, 0x31
0xC5, 0x0F, 0x01, 0x00, 0x00
0xCE, 0x00
0xCF, 0x0F, 0x01
0x3C, 0x01
*/
/* 5.85 BW INIT SEQUENCE
0x11, 0x00
0x91, 0x01
0x44, 0x31, 0x00
0x45, 0x0F, 0x01, 0x00, 0x00
0x4E, 0x31
0x4F, 0x0F, 0x01
0xC4, 0x00, 0x31
0xC5, 0x0F, 0x01, 0x00, 0x00
0xCE, 0x00
0xCF, 0x0F, 0x01
0x3C, 0x01
*/
epdWrite(CMD_DATA_ENTRY_MODE + CONTROLLER_ONE, 1, 0x02);
epdWrite(CMD_DATA_ENTRY_MODE + CONTROLLER_TWO, 1, 0x03);
if (tag.hasThirdColor) {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x10);
} else {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x48, 0x10);
}
epdWrite(CMD_WINDOW_X_SIZE + CONTROLLER_ONE, 2, 0x31, 0x00);
epdWrite(CMD_WINDOW_Y_SIZE + CONTROLLER_ONE, 4, 0x00, 0x00, 0x0F, 0x01);
epdWrite(CMD_XSTART_POS + CONTROLLER_ONE, 1, 0x31);
epdWrite(CMD_YSTART_POS + CONTROLLER_ONE, 2, 0x00, 0x00);
epdWrite(CMD_WINDOW_X_SIZE + CONTROLLER_TWO, 2, 0x00, 0x31);
epdWrite(CMD_WINDOW_Y_SIZE + CONTROLLER_TWO, 4, 0x00, 0x00, 0x0F, 0x01);
epdWrite(CMD_XSTART_POS + CONTROLLER_TWO, 1, 0x00);
epdWrite(CMD_YSTART_POS + CONTROLLER_TWO, 2, 0x0F, 0x01);
epdWrite(CMD_BORDER_WAVEFORM_CTRL, 1, 0x01);
break;
}
}
void dualssd::epdWriteDisplayData() {
uint8_t *buf[2] = {0, 0}; // this will hold pointers to odd/even data lines
// Those dual SSD controller (SSD1683??) behave as 2 400pxx wide screens, that needs independent data transfers.
uint8_t c_increment = 1;
if (!tag.hasThirdColor) {
c_increment = 2;
}
for (uint8_t c = 0; c < 4; c = c + c_increment) {
delay(10);
if (c == 0) epd_cmd(CMD_WRITE_FB_BW + CONTROLLER_ONE); // BW
if (c == 1) epd_cmd(CMD_WRITE_FB_RED + CONTROLLER_ONE); // RED
if (c == 2) epd_cmd(CMD_WRITE_FB_BW + CONTROLLER_TWO); // BW
if (c == 3) epd_cmd(CMD_WRITE_FB_RED + CONTROLLER_TWO); // RED
delay(10);
markData();
epdSelect();
for (uint16_t curY = 0; curY < epd->effectiveYRes; curY += 2) {
// Get 'even' screen line
buf[0] = (uint8_t *)calloc(epd->effectiveXRes / 8, 1);
drawItem::renderDrawLine(buf[0], curY, c % 2);
if (epd->epdMirrorH) drawItem::reverseBytes(buf[0], epd->effectiveXRes / 8);
// on the first pass, the second (buf[1]) buffer is unused, so we don't have to wait for it to flush to the display / free it
if (buf[1]) {
// wait for 'odd' display line to finish writing to the screen
epdSPIWait();
free(buf[1]);
}
// start transfer of even data line to the screen
if (c < 2) {
epdSPIAsyncWrite(buf[0] + (epd->effectiveXRes / 16), (epd->effectiveXRes / 16) + 1);
} else {
epdSPIAsyncWrite(buf[0], (epd->effectiveXRes / 16) + 1);
}
// Get 'odd' screen display line
buf[1] = (uint8_t *)calloc(epd->effectiveXRes / 8, 1);
drawItem::renderDrawLine(buf[1], curY + 1, c % 2);
if (epd->epdMirrorH) drawItem::reverseBytes(buf[1], epd->effectiveXRes / 8);
// wait until the 'even' data has finished writing
epdSPIWait();
free(buf[0]);
// start transfer of the 'odd' data line
if (c < 2) {
epdSPIAsyncWrite(buf[1] + (epd->effectiveXRes / 16), (epd->effectiveXRes / 16) + 1);
} else {
epdSPIAsyncWrite(buf[1], (epd->effectiveXRes / 16) + 1);
}
}
// check if this was the first pass. If it was, we'll need to wait until the last display line finished writing
if (c == 0 || c == 2) {
epdSPIWait();
epdDeselect();
free(buf[1]);
buf[1] = nullptr;
}
}
// flush the draw list, make sure items don't appear on subsequent screens
drawItem::flushDrawItems();
// wait until the last line of display has finished writing and clean our stuff up
epdSPIWait();
epdDeselect();
if (buf[1]) free(buf[1]);
}
void dualssd::draw() {
drawNoWait();
getVoltage();
epdBusyWaitFalling(120000);
}
void dualssd::drawNoWait() {
epdWriteDisplayData();
// epdWrite(CMD_DISP_UPDATE_CTRL2, 1, 0xF7);
epdWrite(CMD_ACTIVATION, 0);
}
void dualssd::epdWaitRdy() {
epdBusyWaitFalling(120000);
}

View File

@@ -0,0 +1,23 @@
#ifndef _EPD_DUALSSD_H_
#define _EPD_DUALSSD_H_
class dualssd : public epdInterface {
public:
void epdSetup();
void epdEnterSleep();
void draw();
void drawNoWait();
void epdWaitRdy();
void epdWriteDisplayData();
void selectLUT(uint8_t lut);
protected:
void commandReadBegin(uint8_t cmd);
void commandReadEnd();
uint8_t epdReadByte();
void setWindowX(uint16_t start, uint16_t end);
void setWindowY(uint16_t start, uint16_t end);
void setPosXY(uint16_t x, uint16_t y);
};
#endif

View File

@@ -21,6 +21,7 @@ void selectLUT(uint8_t lut);
#include "uc_variant_043.h"
#include "unissd.h"
#include "dualssd.h"
#include "uc_variant_029.h"
#include "uc8159.h"
#include "uc8179.h"

View File

@@ -75,14 +75,23 @@ void unissd::epdSetup() {
case 0x15:
// stock init 1.6"
epdWrite(CMD_DRV_OUTPUT_CTRL, 3, this->effectiveYRes & 0xFF, this->effectiveYRes >> 8, 0x00);
epdWrite(CMD_DATA_ENTRY_MODE, 1, 0x01);
if (epd->epdMirrorV) {
epdWrite(CMD_DATA_ENTRY_MODE, 1, 0x03);
epdWrite(CMD_WINDOW_Y_SIZE, 4, this->YOffset & 0xFF, this->YOffset >> 8, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8);
} else {
epdWrite(CMD_DATA_ENTRY_MODE, 1, 0x01);
epdWrite(CMD_WINDOW_Y_SIZE, 4, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8, this->YOffset & 0xFF, this->YOffset >> 8);
}
epdWrite(CMD_WINDOW_X_SIZE, 2, this->XOffset / 8, ((this->XOffset + this->effectiveXRes) / 8) - 1);
epdWrite(CMD_WINDOW_Y_SIZE, 4, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8, this->YOffset & 0xFF, this->YOffset >> 8);
epdWrite(CMD_BORDER_WAVEFORM_CTRL, 1, 0x05);
epdWrite(CMD_TEMP_SENSOR_CONTROL, 1, 0x80);
// end stock init
// added
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00); // fix reversed image with stock setup
if (tag.hasThirdColor) {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x08, 0x00); // fix reversed image with stock setup
} else {
epdWrite(CMD_DISP_UPDATE_CTRL, 2, 0x48, 0x00); // fix reversed image with stock setup
}
break;
case 0x19:
// stock init 9.7"
@@ -108,13 +117,21 @@ void unissd::epdSetup() {
void unissd::epdWriteDisplayData() {
// this display expects two entire framebuffers worth of data to be written, one for b/w and one for red
uint8_t *buf[2] = {0, 0}; // this will hold pointers to odd/even data lines
for (uint8_t c = 0; c < 2; c++) {
uint8_t c_end = 2; // The loop must be executed 2 times if BWR, 1 time if BW
if (!tag.hasThirdColor) {
c_end = 1;
}
for (uint8_t c = 0; c < c_end; c++) {
switch (this->controllerType) {
case 0x0F:
case 0x12:
case 0x15:
epdWrite(CMD_XSTART_POS, 1, (this->XOffset / 8));
epdWrite(CMD_YSTART_POS, 2, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8);
if (epd->epdMirrorV) {
epdWrite(CMD_YSTART_POS, 2, this->YOffset & 0xFF, (this->YOffset) >> 8);
} else {
epdWrite(CMD_YSTART_POS, 2, (this->YOffset + this->effectiveYRes) & 0xFF, (this->YOffset + this->effectiveYRes) >> 8);
}
break;
case 0x19:
epdWrite(CMD_XSTART_POS, 2, 0xBF, 0x03);
@@ -130,11 +147,8 @@ void unissd::epdWriteDisplayData() {
// Get 'even' screen line
buf[0] = (uint8_t *)calloc(epd->effectiveXRes / 8, 1);
if (epd->epdMirrorV) {
drawItem::renderDrawLine(buf[0], (epd->effectiveYRes - 1) - curY, c);
} else {
drawItem::renderDrawLine(buf[0], curY, c);
}
drawItem::renderDrawLine(buf[0], curY, c);
if (epd->epdMirrorH) drawItem::reverseBytes(buf[0], epd->effectiveXRes / 8);
// on the first pass, the second (buf[1]) buffer is unused, so we don't have to wait for it to flush to the display / free it
if (buf[1]) {
@@ -148,11 +162,9 @@ void unissd::epdWriteDisplayData() {
// Get 'odd' screen display line
buf[1] = (uint8_t *)calloc(epd->effectiveXRes / 8, 1);
if (epd->epdMirrorV) {
drawItem::renderDrawLine(buf[1], (epd->effectiveYRes - 1) - (curY + 1), c);
} else {
drawItem::renderDrawLine(buf[1], curY + 1, c);
}
drawItem::renderDrawLine(buf[1], curY + 1, c);
if (epd->epdMirrorH) drawItem::reverseBytes(buf[1], epd->effectiveXRes / 8);
// wait until the 'even' data has finished writing

View File

@@ -84,25 +84,10 @@ bool displayCustomImage(uint8_t imagetype) {
return false;
}
void externalWakeHandler(uint8_t type) {
if (displayCustomImage(type)) {
doSleep(2000);
// if something else was previously on the display, draw that
if (curImgSlot != 0xFF) {
powerUp(INIT_EEPROM);
uint8_t lut = getEepromImageDataArgument(curImgSlot);
lut &= 0x03;
powerUp(INIT_EPD);
drawImageFromEeprom(curImgSlot, lut);
powerDown(INIT_EPD | INIT_EEPROM);
}
}
}
void TagAssociated() {
// associated
bool fastNextCheckin = false;
uint32_t fastNextCheckinDelay = WAKE_SECOND_CHECKIN_DELAY;
struct AvailDataInfo *avail;
static bool buttonCheckOut = false; // send another full request if the previous was a trigger reason (buttons, nfc)
// Is there any reason why we should do a long (full) get data request (including reason, status)?
@@ -139,23 +124,23 @@ void TagAssociated() {
switch (wakeUpReason) {
case WAKEUP_REASON_BUTTON1:
externalWakeHandler(CUSTOM_IMAGE_BUTTON1);
if (displayCustomImage(CUSTOM_IMAGE_BUTTON1)) fastNextCheckinDelay = 0;
fastNextCheckin = true;
break;
case WAKEUP_REASON_BUTTON2:
externalWakeHandler(CUSTOM_IMAGE_BUTTON2);
if (displayCustomImage(CUSTOM_IMAGE_BUTTON2)) fastNextCheckinDelay = 0;
fastNextCheckin = true;
break;
case WAKEUP_REASON_GPIO:
externalWakeHandler(CUSTOM_IMAGE_GPIO);
if (displayCustomImage(CUSTOM_IMAGE_GPIO)) fastNextCheckinDelay = 0;
fastNextCheckin = true;
break;
case WAKEUP_REASON_RF:
externalWakeHandler(CUSTOM_IMAGE_RF_WAKE);
if (displayCustomImage(CUSTOM_IMAGE_RF_WAKE)) fastNextCheckinDelay = 0;
fastNextCheckin = true;
break;
case WAKEUP_REASON_NFC:
externalWakeHandler(CUSTOM_IMAGE_NFC_WAKE);
if (displayCustomImage(CUSTOM_IMAGE_NFC_WAKE)) fastNextCheckinDelay = 0;
fastNextCheckin = true;
break;
}
@@ -168,7 +153,7 @@ void TagAssociated() {
}
// since we've had succesful contact, and communicated the wakeup reason succesfully, we can now reset to the 'normal' status
if ((wakeUpReason == WAKEUP_REASON_BUTTON1) | (wakeUpReason == WAKEUP_REASON_BUTTON2) | (wakeUpReason == WAKEUP_REASON_NFC) | (wakeUpReason == CUSTOM_IMAGE_RF_WAKE)) {
if ((wakeUpReason == WAKEUP_REASON_GPIO) | (wakeUpReason == WAKEUP_REASON_BUTTON1) | (wakeUpReason == WAKEUP_REASON_BUTTON2) | (wakeUpReason == WAKEUP_REASON_NFC) | (wakeUpReason == CUSTOM_IMAGE_RF_WAKE)) {
buttonCheckOut = true;
}
wakeUpReason = WAKEUP_REASON_TIMED;
@@ -225,9 +210,13 @@ void TagAssociated() {
if (fastNextCheckin) {
// do a fast check-in next
fastNextCheckin = false;
doSleep(100UL);
if (fastNextCheckinDelay) {
doSleep(fastNextCheckinDelay);
} else {
doSleep(100UL);
}
} else {
if (nextCheckInFromAP) {
if (nextCheckInFromAP & 0x7FFF) {
// if the AP told us to sleep for a specific period, do so.
if (nextCheckInFromAP & 0x8000) {
doSleep((nextCheckInFromAP & 0x7FFF) * 1000UL);

View File

@@ -25,20 +25,21 @@ struct fwmetadata {
#define EEPROM_SETTINGS_SIZE 4096
#define BLOCKSIZE_MS 240 // was 270
#define BLOCKSIZE_MS 280 // was 270
#define FWNRF
#define LEDSENABLED
#define PERSISTENTVAR
#define HAL_TIMER_TICK 1
#define PERSISTENTVAR
#define EEPROM_IMG_START 0
;
#define HAL_PacketRX commsRxUnencrypted
#define HAL_msDelay delay
void dump(const uint8_t *a, const uint16_t l);
extern void executeCommand(uint8_t cmd); // this is defined in main.c
static void saveUpdateMetadata(uint32_t size) {
struct fwmetadata metadata;
metadata.magic1 = MAGIC1;
@@ -71,8 +72,12 @@ static bool validateEepromMD5(uint64_t ver, uint32_t eepromstart, uint32_t flen)
printf("This is what we got:\n");
dump(hash, 16);
}
#ifdef DEBUG_DONTVALIDATEPROTO
return true;
#else
return isValid;
#endif
}
#include "../../common/oepl-protocol.cpp"

View File

@@ -26,12 +26,19 @@ bool lowBatteryShown = false;
bool noAPShown = false;
void addOverlay() {
if (currentChannel == 0) {
drawMask(epd->Xres - 27, 5, 22, 22, COLOR_BLACK);
drawMask(epd->Xres - 27, 5, 22, 22, COLOR_RED);
drawRoundedRectangle(epd->Xres - 28, 4, 24, 24, COLOR_RED);
addBufferedImage(epd->Xres - 24, 8, COLOR_BLACK, rotation::ROTATE_0, ant, DRAW_NORMAL);
addBufferedImage(epd->Xres - 16, 15, COLOR_RED, rotation::ROTATE_0, cross, DRAW_NORMAL);
drawMask(epd->Xres - 28, 4, 24, 24, COLOR_BLACK);
if(tag.hasThirdColor){
drawMask(epd->Xres - 28, 4, 24, 24, COLOR_RED);
drawRoundedRectangle(epd->Xres - 28, 4, 24, 24, COLOR_RED);
addBufferedImage(epd->Xres - 24, 8, COLOR_BLACK, rotation::ROTATE_0, ant, DRAW_NORMAL);
addBufferedImage(epd->Xres - 16, 15, COLOR_RED, rotation::ROTATE_0, cross, DRAW_NORMAL);
}else{
drawRoundedRectangle(epd->Xres - 28, 4, 24, 24, COLOR_BLACK);
addBufferedImage(epd->Xres - 24, 8, COLOR_BLACK, rotation::ROTATE_0, ant, DRAW_NORMAL);
addBufferedImage(epd->Xres - 16, 15, COLOR_BLACK, rotation::ROTATE_0, cross, DRAW_NORMAL);
}
noAPShown = true;
} else {
noAPShown = false;
@@ -39,8 +46,13 @@ void addOverlay() {
if (lowBattery) {
drawMask(epd->Xres - 27, epd->Yres - 26, 22, 22, COLOR_BLACK);
drawMask(epd->Xres - 27, epd->Yres - 26, 22, 22, COLOR_RED);
drawRoundedRectangle(epd->Xres - 28, epd->Yres - 26, 24, 24, COLOR_RED);
if(tag.hasThirdColor){
drawMask(epd->Xres - 27, epd->Yres - 26, 22, 22, COLOR_RED);
drawRoundedRectangle(epd->Xres - 28, epd->Yres - 26, 24, 24, COLOR_RED);
}else{
drawMask(epd->Xres - 27, epd->Yres - 26, 22, 22, COLOR_BLACK);
drawRoundedRectangle(epd->Xres - 28, epd->Yres - 26, 24, 24, COLOR_BLACK);
}
addBufferedImage(epd->Xres - 24, epd->Yres - 19, COLOR_BLACK, rotation::ROTATE_0, battery, DRAW_NORMAL);
lowBatteryShown = true;
} else {
@@ -48,10 +60,16 @@ void addOverlay() {
}
#ifdef DEBUG_BUILD
fontrender fr(&FreeSansBold18pt7b);
drawMask(15, epd->Yres - 53, 129, 33, COLOR_BLACK);
drawMask(15, epd->Yres - 53, 129, 33, COLOR_RED);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_RED);
fr.epdPrintf(17, epd->Yres - 50, COLOR_RED, rotation::ROTATE_0, "DEBUG");
drawMask(15, epd->Yres - 53, 130, 33, COLOR_BLACK);
if(tag.hasThirdColor){
drawMask(15, epd->Yres - 53, 130, 33, COLOR_RED);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_RED);
fr.epdPrintf(17, epd->Yres - 50, COLOR_RED, rotation::ROTATE_0, "DEBUG");
}else{
drawMask(15, epd->Yres - 53, 130, 33, COLOR_BLACK);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_BLACK);
fr.epdPrintf(17, epd->Yres - 50, COLOR_BLACK, rotation::ROTATE_0, "DEBUG");
}
#endif
}
@@ -67,9 +85,9 @@ void showSplashScreen() {
case STYPE_SIZE_016:
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
fr.epdPrintf(10, 38, COLOR_RED, rotation::ROTATE_0, "Newton M3 2.2\"");
fr.epdPrintf(10, 38, COLOR_RED, rotation::ROTATE_0, "Newton M3 1.6\"");
fr.epdPrintf(5, epd->Yres - 40, 0, rotation::ROTATE_0, "FW: %04X-%s", fwVersion, fwVersionSuffix);
fr.epdPrintf(2, epd->Yres - 20, 0, rotation::ROTATE_0, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.epdPrintf(2, epd->Yres - 20, 0, rotation::ROTATE_0, "%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_022:
fr.setFont(&FreeSansBold18pt7b);
@@ -81,6 +99,16 @@ void showSplashScreen() {
fr.epdPrintf(5, epd->Yres - 20, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_026:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 38, COLOR_RED, rotation::ROTATE_0, "Newton M3 2.6\"");
// fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(5, epd->Yres - 40, 0, rotation::ROTATE_0, "FW: %04X-%s", fwVersion, fwVersionSuffix);
fr.epdPrintf(5, epd->Yres - 20, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_029:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
@@ -91,6 +119,16 @@ void showSplashScreen() {
fr.epdPrintf(5, epd->Yres - 20, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_029_FREEZER:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 38, COLOR_BLACK, rotation::ROTATE_0, "Newton M3 2.9\" Freezer");
// fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(epd->Xres - 17, 0, COLOR_BLACK, rotation::ROTATE_270, "FW: %04X-%s", fwVersion, fwVersionSuffix);
fr.epdPrintf(5, epd->Yres - 20, COLOR_BLACK, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_042:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
@@ -111,6 +149,26 @@ void showSplashScreen() {
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 32, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_058:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 38, COLOR_RED, rotation::ROTATE_0, "Newton M3 5.85\"");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(epd->Xres - 17, 0, 0, rotation::ROTATE_270, "FW: %04X-%s", fwVersion, fwVersionSuffix);
fr.epdPrintf(5, epd->Yres - 20, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_058_FREEZER:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(2, 2, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 38, COLOR_BLACK, rotation::ROTATE_0, "Newton M3 5.85\" Freezer");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(epd->Xres - 17, 0, COLOR_BLACK, rotation::ROTATE_270, "FW: %04X-%s", fwVersion, fwVersionSuffix);
fr.epdPrintf(5, epd->Yres - 20, COLOR_BLACK, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_060:
fr.setFont(&FreeSansBold24pt7b);
fr.epdPrintf(10, 10, COLOR_BLACK, rotation::ROTATE_0, "OpenEPaperLink");
@@ -145,12 +203,19 @@ void showSplashScreen() {
addQR(260, 160, 3, 7, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
}
#ifdef DEBUGBLOCKS
#ifdef DEBUG_BUILD
drawMask(15, epd->Yres - 53, 129, 33, COLOR_BLACK);
drawMask(15, epd->Yres - 53, 129, 33, COLOR_RED);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_RED);
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(17, epd->Yres - 50, COLOR_RED, rotation::ROTATE_0, "DEBUG");
if(tag.hasThirdColor){
drawMask(15, epd->Yres - 53, 129, 33, COLOR_RED);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_RED);
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(17, epd->Yres - 50, COLOR_RED, rotation::ROTATE_0, "DEBUG");
}else{
drawMask(15, epd->Yres - 53, 129, 33, COLOR_BLACK);
drawRoundedRectangle(15, epd->Yres - 53, 129, 33, COLOR_BLACK);
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(17, epd->Yres - 50, COLOR_BLACK, rotation::ROTATE_0, "DEBUG");
}
#endif
draw();
}
@@ -198,6 +263,18 @@ void showAPFound() {
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_026:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 53, COLOR_RED, rotation::ROTATE_0, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", APmac[7], APmac[6], APmac[5], APmac[4], APmac[3], APmac[2], APmac[1], APmac[0]);
fr.epdPrintf(10, 71, COLOR_RED, rotation::ROTATE_0, "RSSI: %ddBm LQI: %d", mLastRSSI, mLastLqi);
fr.epdPrintf(10, 89, COLOR_RED, rotation::ROTATE_0, "Ch %d", currentChannel);
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, epd->Yres - 43, 0, rotation::ROTATE_0, "Battery: %d.%dV Temp: %d'C", batteryVoltage / 1000, batteryVoltage % 1000, temperature);
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_029:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found");
@@ -210,6 +287,18 @@ void showAPFound() {
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_029_FREEZER:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 53, COLOR_BLACK, rotation::ROTATE_0, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", APmac[7], APmac[6], APmac[5], APmac[4], APmac[3], APmac[2], APmac[1], APmac[0]);
fr.epdPrintf(10, 71, COLOR_BLACK, rotation::ROTATE_0, "RSSI: %ddBm LQI: %d", mLastRSSI, mLastLqi);
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "Ch %d", currentChannel);
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, epd->Yres - 43, 0, rotation::ROTATE_0, "Battery: %d.%dV Temp: %d'C", batteryVoltage / 1000, batteryVoltage % 1000, temperature);
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_042:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found");
@@ -235,6 +324,30 @@ void showAPFound() {
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_058:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 53, COLOR_RED, rotation::ROTATE_0, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", APmac[7], APmac[6], APmac[5], APmac[4], APmac[3], APmac[2], APmac[1], APmac[0]);
fr.epdPrintf(10, 71, COLOR_RED, rotation::ROTATE_0, "RSSI: %ddBm LQI: %d", mLastRSSI, mLastLqi);
fr.epdPrintf(10, 89, COLOR_RED, rotation::ROTATE_0, "Ch %d", currentChannel);
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, epd->Yres - 43, 0, rotation::ROTATE_0, "Battery: %d.%dV Temp: %d'C", batteryVoltage / 1000, batteryVoltage % 1000, temperature);
fr.epdPrintf(10, epd->Yres - 25, 0, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_058_FREEZER:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found");
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, 53, COLOR_BLACK, rotation::ROTATE_0, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", APmac[7], APmac[6], APmac[5], APmac[4], APmac[3], APmac[2], APmac[1], APmac[0]);
fr.epdPrintf(10, 71, COLOR_BLACK, rotation::ROTATE_0, "RSSI: %ddBm LQI: %d", mLastRSSI, mLastLqi);
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "Ch %d", currentChannel);
fr.setFont(&FreeSans9pt7b);
fr.epdPrintf(10, epd->Yres - 43, COLOR_BLACK, rotation::ROTATE_0, "Battery: %d.%dV Temp: %d'C", batteryVoltage / 1000, batteryVoltage % 1000, temperature);
fr.epdPrintf(10, epd->Yres - 25, COLOR_BLACK, rotation::ROTATE_0, "MAC: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
break;
case STYPE_SIZE_060:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "AP Found - Waiting for data");
@@ -296,6 +409,16 @@ void showNoAP() {
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(10, 109, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by pressing a button");
break;
case STYPE_SIZE_026:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found");
fr.setFont(&FreeSans9pt7b);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.epdPrintf(10, 69, COLOR_BLACK, rotation::ROTATE_0, "Couldn't find an AP :(");
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(10, 109, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by scanning");
fr.epdPrintf(10, 129, COLOR_BLACK, rotation::ROTATE_0, "the NFC-wake area with your phone");
break;
case STYPE_SIZE_029:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found");
@@ -305,6 +428,15 @@ void showNoAP() {
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(10, 109, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by pressing a button");
break;
case STYPE_SIZE_029_FREEZER:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found");
fr.setFont(&FreeSans9pt7b);
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.epdPrintf(10, 69, COLOR_BLACK, rotation::ROTATE_0, "Couldn't find an AP :(");
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(10, 109, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by pressing a button");
break;
case STYPE_SIZE_042:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found");
@@ -328,6 +460,26 @@ void showNoAP() {
fr.epdPrintf(152, 89, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by scanning");
fr.epdPrintf(152, 109, COLOR_BLACK, rotation::ROTATE_0, "the NFC-wake area with your phone");
break;
case STYPE_SIZE_058:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found");
fr.setFont(&FreeSans9pt7b);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.epdPrintf(10, 69, COLOR_BLACK, rotation::ROTATE_0, "Couldn't find an AP :(");
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(152, 109, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by scanning");
fr.epdPrintf(152, 129, COLOR_BLACK, rotation::ROTATE_0, "the NFC-wake area with your phone");
break;
case STYPE_SIZE_058_FREEZER:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found");
fr.setFont(&FreeSans9pt7b);
addQR(epd->Xres - 120, 42, 3, 3, "https://openepaperlink.eu/tag/0/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.epdPrintf(10, 69, COLOR_BLACK, rotation::ROTATE_0, "Couldn't find an AP :(");
fr.epdPrintf(10, 89, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(152, 109, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by scanning");
fr.epdPrintf(152, 129, COLOR_BLACK, rotation::ROTATE_0, "the NFC-wake area with your phone");
break;
case STYPE_SIZE_060:
fr.setFont(&FreeSansBold18pt7b);
fr.epdPrintf(7, 7, COLOR_BLACK, rotation::ROTATE_0, "No AP Found U_U");
@@ -357,7 +509,8 @@ void showNoAP() {
addQR(epd->Xres - 66, 47, 3, 2, "https://openepaperlink.eu/tag/1/%02X/%02X%02X%02X%02X%02X%02X%02X%02X/", tag.OEPLtype, mSelfMac[7], mSelfMac[6], mSelfMac[5], mSelfMac[4], mSelfMac[3], mSelfMac[2], mSelfMac[1], mSelfMac[0]);
fr.epdPrintf(10, 39, COLOR_BLACK, rotation::ROTATE_0, "Couldn't find an AP :(");
fr.epdPrintf(10, 58, COLOR_BLACK, rotation::ROTATE_0, "I'll try again in a little while, but you");
fr.epdPrintf(10, 77, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by pressing a button");
fr.epdPrintf(10, 77, COLOR_BLACK, rotation::ROTATE_0, "can force a retry now by scanning");
fr.epdPrintf(10, 98, COLOR_BLACK, rotation::ROTATE_0, "the NFC-wake area with your phone");
addFlashImage(200, 128, COLOR_BLACK, rotation::ROTATE_0, pandablack);
addFlashImage(312, 274, COLOR_RED, rotation::ROTATE_0, pandared);
break;

View File

@@ -16,7 +16,9 @@ int decompCallback(TINF_DATA *d) {
return dec->getNextCompressedBlockFromFlash();
}
}
#ifdef DEBUG_COMPRESSION
printf("FS: Couldn't find callback...\n");
#endif
return -1;
}
@@ -42,13 +44,17 @@ bool decompress::readHeader() {
// check if the file served has a sensible window size
if (window > MAX_WINDOW_SIZE) {
#ifdef DEBUG_COMPRESSION
printf("FS: Asked to decompress a file with a specified window size of %d, I don't see that happening\n", window);
#endif
return false;
} else {
//printf("FS: Opened compressed file with dictionary size %d\n", window);
#ifdef DEBUG_COMPRESSION
printf("FS: Opened compressed file with dictionary size %d\n", window);
#endif
}
window = 8192;
// window = 8192;
// allocate dict/window if not already allocated
if (!this->dictionary) this->dictionary = (uint8_t *)malloc(window);

View File

@@ -63,7 +63,7 @@ void addBufferedImage(uint16_t x, uint16_t y, bool color, enum rotation ro, cons
di->type = drawItem::drawType::DRAW_MASK;
else
di->type = drawItem::drawType::DRAW_BUFFERED_1BPP;
di->checkBounds();
di->addToList();
}
@@ -85,6 +85,7 @@ void addFlashImage(uint16_t x, uint16_t y, bool color, enum rotation ro, const u
di->color = color;
di->cleanUp = false;
di->type = drawItem::drawType::DRAW_BUFFERED_1BPP;
di->checkBounds();
di->addToList();
}
#ifdef ENABLE_OEPLFS
@@ -119,6 +120,7 @@ void addFSImage(uint16_t x, uint16_t y, uint8_t color, enum rotation ro, char *n
} else {
di->type = drawItem::drawType::DRAW_OEPLFS_1BPP;
}
di->checkBounds();
di->addToList();
}
@@ -153,6 +155,7 @@ void addCompressedFSImage(uint16_t x, uint16_t y, enum rotation ro, char *name)
di->color = imgheader.bpp;
if (di->color == 1) di->color = 0;
di->cleanUp = true;
di->checkBounds();
di->addToList();
}
#endif
@@ -207,12 +210,12 @@ void addQR(uint16_t x, uint16_t y, uint8_t version, uint8_t scale, const char *c
di->ypos = y;
di->color = 0;
di->type = drawItem::drawType::DRAW_BUFFERED_1BPP;
di->checkBounds();
di->addToList();
}
void drawImageAtAddressWrap(uint32_t addr, uint8_t lut) {
// powerUp(INIT_EEPROM);
// epdSetup();
selectLUT(lut);
struct EepromImageHeader eih;
HAL_flashRead(addr, (uint8_t *)&eih, sizeof(struct EepromImageHeader));
@@ -229,8 +232,12 @@ void drawImageAtAddressWrap(uint32_t addr, uint8_t lut) {
di->addItem((uint8_t *)addr, epd->effectiveXRes, epd->effectiveYRes);
di->type = drawItem::drawType::DRAW_EEPROM_1BPP;
di->direction = false;
if (di->mirrorH) di->mirrorV = !di->mirrorV;
if (di->mirrorH) {
di->mirrorH = 0;
di->mirrorV = !di->mirrorV;
}
di->cleanUp = false;
di->checkBounds();
di->addToList();
} break;
case DATATYPE_IMG_RAW_2BPP: {
@@ -242,8 +249,12 @@ void drawImageAtAddressWrap(uint32_t addr, uint8_t lut) {
di->addItem((uint8_t *)addr, epd->effectiveXRes, epd->effectiveYRes);
di->type = drawItem::drawType::DRAW_EEPROM_2BPP;
di->direction = false;
if (di->mirrorH) di->mirrorV = !di->mirrorV;
if (di->mirrorH) {
di->mirrorH = 0;
di->mirrorV = !di->mirrorV;
}
di->cleanUp = false;
di->checkBounds();
di->addToList();
} break;
case DATATYPE_IMG_ZLIB: {
@@ -273,15 +284,18 @@ void drawImageAtAddressWrap(uint32_t addr, uint8_t lut) {
di->xpos = 0;
di->ypos = 0;
di->direction = false;
if (di->mirrorH) di->mirrorV = !di->mirrorV;
if (di->mirrorH) {
di->mirrorH = 0;
di->mirrorV = !di->mirrorV;
}
if (imgheader.bpp == 1) di->color = 0;
if (imgheader.bpp == 2) di->color = 2;
di->cleanUp = true;
di->checkBounds();
di->addToList();
} break;
}
addOverlay();
draw();
}
@@ -294,17 +308,19 @@ void drawImageAtAddress(uint32_t addr, uint8_t lut) {
void drawRoundedRectangle(uint16_t xpos, uint16_t ypos, uint16_t width, uint16_t height, bool color) {
uint16_t widthBytes = width / 8;
if (width % 8) widthBytes++;
uint32_t framebufferSize = (widthBytes + 1) * height;
uint32_t framebufferSize = widthBytes * height;
uint8_t *framebuffer = (uint8_t *)calloc(framebufferSize + 4, 1);
if (framebuffer == NULL) {
return;
}
((uint16_t *)framebuffer)[0] = width + 1;
uint8_t frameBufferZerosize = width;
if ((width % 8) != 0) {
frameBufferZerosize++;
}
((uint16_t *)framebuffer)[0] = frameBufferZerosize;
((uint16_t *)framebuffer)[1] = height;
framebuffer += 4;
uint16_t w = width - 1;
uint16_t x = 1;
while (w--) {
@@ -456,9 +472,9 @@ void drawItem::getXLine(uint8_t *line, uint16_t y, uint8_t c) {
}
}
if (mirrorH) {
copyWithByteShift(line, &buffer[((height - (y - ypos)) * widthBytes)], widthBytes, xpos / 8);
copyWithByteShift(line, &buffer[((height - (y - ypos)) * widthBytes)], drawnWidthBytes, xpos / 8);
} else {
copyWithByteShift(line, &buffer[((y - ypos) * widthBytes)], widthBytes, xpos / 8);
copyWithByteShift(line, &buffer[((y - ypos) * widthBytes)], drawnWidthBytes, xpos / 8);
}
}
break;
@@ -479,7 +495,7 @@ void drawItem::getXLine(uint8_t *line, uint16_t y, uint8_t c) {
if (mirrorV) {
reverseBytes(dbuffer, widthBytes);
}
copyWithByteShift(line, dbuffer, widthBytes, xpos / 8);
copyWithByteShift(line, dbuffer, drawnWidthBytes, xpos / 8);
free(dbuffer);
}
break;
@@ -499,20 +515,36 @@ void drawItem::getXLine(uint8_t *line, uint16_t y, uint8_t c) {
if (mirrorV) {
reverseBytes(dbuffer, widthBytes);
}
copyWithByteShift(line, dbuffer, widthBytes, xpos / 8);
copyWithByteShift(line, dbuffer, drawnWidthBytes, xpos / 8);
free(dbuffer);
}
break;
case DRAW_EEPROM_1BPP:
if (c != color) return;
if (epd->drawDirectionRight)
if (mirrorH)
y = epd->effectiveYRes - 1 - y;
HAL_flashRead((uint32_t)buffer + sizeof(struct EepromImageHeader) + (y * (epd->effectiveXRes / 8)), line, (epd->effectiveXRes / 8));
if (mirrorV) {
uint8_t *dbuffer = (uint8_t *)malloc(widthBytes);
HAL_flashRead((uint32_t)buffer + sizeof(struct EepromImageHeader) + (y * (epd->effectiveXRes / 8)), dbuffer, (epd->effectiveXRes / 8));
reverseBytes(dbuffer, widthBytes);
memcpy(line, dbuffer, widthBytes);
free(dbuffer);
} else {
HAL_flashRead((uint32_t)buffer + sizeof(struct EepromImageHeader) + (y * (epd->effectiveXRes / 8)), line, (epd->effectiveXRes / 8));
}
break;
case DRAW_EEPROM_2BPP:
if (epd->drawDirectionRight)
if (mirrorH)
y = epd->effectiveYRes - 1 - y;
HAL_flashRead((uint32_t)(buffer + sizeof(struct EepromImageHeader) + ((y + (c * epd->effectiveYRes)) * (epd->effectiveXRes / 8))), line, (epd->effectiveXRes / 8));
if (mirrorV) {
uint8_t *dbuffer = (uint8_t *)malloc(widthBytes);
HAL_flashRead((uint32_t)(buffer + sizeof(struct EepromImageHeader) + ((y + (c * epd->effectiveYRes)) * (epd->effectiveXRes / 8))), dbuffer, (epd->effectiveXRes / 8));
reverseBytes(dbuffer, widthBytes);
memcpy(line, dbuffer, widthBytes);
free(dbuffer);
} else {
HAL_flashRead((uint32_t)(buffer + sizeof(struct EepromImageHeader) + ((y + (c * epd->effectiveYRes)) * (epd->effectiveXRes / 8))), line, (epd->effectiveXRes / 8));
}
break;
default:
printf("DRAW: Not supported mode!\n");
@@ -642,6 +674,16 @@ bool drawItem::addToList() {
return false;
}
void drawItem::checkBounds() {
drawnWidthBytes = widthBytes;
// if(!direction){ // draw X lines
uint8_t availBytesWidth = epd->effectiveXRes / 8;
availBytesWidth -= (xpos / 8);
if (widthBytes < availBytesWidth) availBytesWidth = widthBytes;
drawnWidthBytes = availBytesWidth;
}
drawItem::~drawItem() {
if (cleanUp) {
switch (this->type) {
@@ -936,5 +978,6 @@ void fontrender::epdPrintf(uint16_t x, uint16_t y, bool color, enum rotation ro,
di->xpos = x;
di->color = color;
di->type = drawItem::drawType::DRAW_FONT;
di->checkBounds();
di->addToList();
}

View File

@@ -72,6 +72,8 @@ class drawItem {
static void renderDrawLine(uint8_t *line, uint16_t number, uint8_t c);
static void flushDrawItems();
void checkBounds();
// these are also used for rotated screens
static void reverseBytes(uint8_t *src, uint8_t src_len);
static uint8_t bitReverse(uint8_t byte);
@@ -113,6 +115,7 @@ class drawItem {
void getXLine(uint8_t *line, uint16_t yPos, uint8_t color);
void getYLine(uint8_t *line, uint16_t xPos, uint8_t color);
uint8_t widthBytes = 0;
uint8_t drawnWidthBytes = 0;
uint8_t *buffer = nullptr;
};

View File

@@ -23,8 +23,6 @@ volatile uint8_t PERSISTENTVAR currentChannel = 0;
static uint8_t inBuffer[128] = {0};
static uint8_t outBuffer[128] = {0};
extern void executeCommand(uint8_t cmd); // this is defined in main.c
// tools
static uint8_t getPacketType(const void *buffer) {
const struct MacFcs *fcs = (MacFcs *)buffer;
@@ -112,7 +110,7 @@ uint8_t detectAP(const uint8_t channel) {
radioRxEnable(true);
for (uint8_t c = 1; c <= MAXIMUM_PING_ATTEMPTS; c++) {
sendPing();
t = millis() + (HAL_TIMER_TICK * (PING_REPLY_WINDOW));
t = millis() + PING_REPLY_WINDOW;
while (millis() < t) {
int8_t ret = HAL_PacketRX(inBuffer);
if (ret > 1) {
@@ -126,7 +124,7 @@ uint8_t detectAP(const uint8_t channel) {
}
}
}
HAL_msDelay(1);
HAL_msDelay(10);
}
}
return 0;
@@ -179,7 +177,7 @@ struct AvailDataInfo *getAvailDataInfo() {
uint32_t t;
for (uint8_t c = 0; c < DATA_REQ_MAX_ATTEMPTS; c++) {
sendAvailDataReq();
t = millis() + (HAL_TIMER_TICK * (DATA_REQ_RX_WINDOW_SIZE));
t = millis() + DATA_REQ_RX_WINDOW_SIZE;
while (millis() < t) {
int8_t ret = HAL_PacketRX(inBuffer);
if (ret > 1) {
@@ -203,8 +201,7 @@ struct AvailDataInfo *getShortAvailDataInfo() {
uint32_t t;
for (uint8_t c = 0; c < DATA_REQ_MAX_ATTEMPTS; c++) {
sendShortAvailDataReq();
// sendAvailDataReq();
t = millis() + (HAL_TIMER_TICK * (DATA_REQ_RX_WINDOW_SIZE));
t = millis() + DATA_REQ_RX_WINDOW_SIZE;
while (millis() < t) {
int8_t ret = HAL_PacketRX(inBuffer);
if (ret > 1) {
@@ -251,7 +248,7 @@ static bool blockRxLoop(const uint32_t timeout, uint8_t *blockbuffer) {
uint32_t t;
bool success = false;
radioRxEnable(true);
t = millis() + (HAL_TIMER_TICK * (timeout + 20));
t = millis() + (timeout + 20);
bool blockComplete = false;
@@ -316,16 +313,17 @@ static struct blockRequestAck *performBlockRequest() {
uint32_t t;
radioRxEnable(true);
radioRxFlush();
for (uint8_t c = 0; c < 30; c++) {
for (uint8_t c = 0; c < 10; c++) {
sendBlockRequest();
t = millis() + (HAL_TIMER_TICK * ((7UL + c / 10)));
t = millis() + 6UL;
do {
int8_t ret = HAL_PacketRX(inBuffer);
if (ret > 1) {
switch (getPacketType(inBuffer)) {
case PKT_BLOCK_REQUEST_ACK:
if (checkCRC((inBuffer + sizeof(struct MacFrameNormal) + 1), sizeof(struct blockRequestAck)))
if (checkCRC((inBuffer + sizeof(struct MacFrameNormal) + 1), sizeof(struct blockRequestAck))) {
return (struct blockRequestAck *)(inBuffer + sizeof(struct MacFrameNormal) + 1);
}
break;
case PKT_BLOCK_PART:
return continueToRX();
@@ -370,7 +368,7 @@ static void sendXferComplete() {
for (uint8_t c = 0; c < 16; c++) {
sendXferCompletePacket();
uint32_t start = millis();
while ((millis() - start) < (HAL_TIMER_TICK * (6UL))) {
while ((millis() - start) < (6UL)) {
int8_t ret = HAL_PacketRX(inBuffer);
if (ret > 1) {
if (getPacketType(inBuffer) == PKT_XFER_COMPLETE_ACK) {
@@ -591,7 +589,7 @@ static uint8_t *getDataBlock(const uint16_t blockSize) {
}
#ifdef FWNRF
doSleep(ack->pleaseWaitMs + 40);
doSleep(ack->pleaseWaitMs);
powerUp(INIT_UART | INIT_RADIO);
radioRxEnable(true);
#endif
@@ -656,8 +654,8 @@ static uint8_t *getDataBlock(const uint16_t blockSize) {
}
static uint32_t downloadFWUpdate(const struct AvailDataInfo *avail) {
uint16_t dataRequestSize = 0;
uint32_t curXferSize = 0;
static uint32_t PERSISTENTVAR curXferSize = 0;
// check if we already started the transfer of this information & haven't completed it
if (!memcmp((const void *)&avail->dataVer, (const void *)&xferDataInfo.dataVer, 8) && xferDataInfo.dataSize) {
// looks like we did. We'll carry on where we left off.
@@ -672,6 +670,7 @@ static uint32_t downloadFWUpdate(const struct AvailDataInfo *avail) {
}
while (xferDataInfo.dataSize) {
uint16_t dataRequestSize = 0;
wdt10s();
if (xferDataInfo.dataSize > BLOCK_DATA_SIZE) {
// more than one block remaining
@@ -709,8 +708,8 @@ static uint32_t downloadFWUpdate(const struct AvailDataInfo *avail) {
}
static bool downloadImageDataToEEPROM(const struct AvailDataInfo *avail) {
uint16_t dataRequestSize = 0;
uint32_t curXferSize = 0;
static uint32_t PERSISTENTVAR curXferSize = 0;
powerUp(INIT_EEPROM);
// check if we already started the transfer of this information & haven't completed it
if (!memcmp((const void *)&avail->dataVer, (const void *)&xferDataInfo.dataVer, 8) && xferDataInfo.dataSize) {
@@ -772,6 +771,7 @@ static bool downloadImageDataToEEPROM(const struct AvailDataInfo *avail) {
}
while (xferDataInfo.dataSize) {
uint16_t dataRequestSize = 0;
wdt10s();
if (xferDataInfo.dataSize > BLOCK_DATA_SIZE) {
// more than one block remaining
@@ -828,6 +828,15 @@ static bool downloadImageDataToEEPROM(const struct AvailDataInfo *avail) {
bool processImageDataAvail(struct AvailDataInfo *avail) {
struct imageDataTypeArgStruct arg = *((struct imageDataTypeArgStruct *)avail->dataTypeArgument);
// check if the size sent can be contained in the image slot
if (avail->dataSize > tag.imageSize) {
printf("PROTO: Unable to save image, it's too big!\n");
powerUp(INIT_RADIO);
sendXferComplete();
powerDown(INIT_RADIO);
return false;
}
if (arg.preloadImage) {
#ifdef DEBUG_PROTO
printf("PROTO: Preloading image with type 0x%02X from arg 0x%02X\n", arg.specialType, avail->dataTypeArgument);

View File

@@ -61,5 +61,26 @@
"days": [ "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" ],
"months": [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre" ],
"date_format": [ "%d-%m-%Y", "%d-%m" ]
},
"9": {
"language": "sv",
"daysShort": [ "SÖ", "MÅ", "TI", "ON", "TO", "FR", "LÖ" ],
"days": [ "Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag" ],
"months": [ "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" ],
"date_format": [ "%d-%m-%Y", "%d-%m" ]
},
"10": {
"language": "dk",
"daysShort": [ "SØ", "MA", "TI", "ON", "TO", "FR", "LØ" ],
"days": [ "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag" ],
"months": [ "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December" ],
"date_format": [ "%d-%m-%Y", "%d-%m" ]
},
"11": {
"language": "et",
"daysShort": [ "P", "E", "T", "K", "N", "R", "L" ],
"days": [ "Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev" ],
"months": [ "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" ],
"date_format": [ "%d-%m-%Y", "%d-%m" ]
}
}

View File

@@ -13,6 +13,6 @@
},
"shortlut": 0,
"options": ["button"],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 27],
"usetemplate": 1
}

View File

@@ -0,0 +1,18 @@
{
"name": "M2 2.7\"",
"width": 264,
"height": 176,
"rotatebuffer": 1,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"shortlut": 0,
"options": ["button"],
"contentids": [ 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20],
"usetemplate": 1
}

View File

@@ -0,0 +1,57 @@
{
"name": "M2 7.5\" BW",
"width": 640,
"height": 384,
"rotatebuffer": 0,
"bpp": 1,
"colors": 2,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0]
},
"shortlut": 1,
"zlib_compression": "27",
"highlight_color": 5,
"options": [],
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20],
"template": {
"1": {
"weekday": [ 320, -5, "Signika-SB.ttf", 100 ],
"month": [ 320, 265, "Signika-SB.ttf", 100 ],
"day": [ 320, 60, "Signika-SB.ttf", 220 ]
},
"4": {
"location": [ 20, 20, "fonts/calibrib30" ],
"wind": [ 90, 83, "fonts/calibrib30" ],
"temp": [ 20, 170, "fonts/calibrib30" ],
"icon": [ 385, 0, 100, 2 ],
"dir": [ 40, 50, 80 ],
"umbrella": [ 325, 155, 78 ]
},
"8": {
"location": [ 10, 10, "fonts/calibrib30" ],
"column": [ 6, 66 ],
"day": [ 33, 60, "fonts/bahnschrift20", 104, 230 ],
"rain": [ 34, 260 ],
"icon": [ 32, 145, 30 ],
"wind": [ 17, 90 ],
"line": [ 50, 300 ]
},
"9": {
"title": [ 6, 0, "Signika-SB.ttf", 32 ],
"items": 5,
"line": [ 9, 40, "calibrib16.vlw" ],
"desc": [ 2, 8, "REFSAN12.vlw", 1.2 ]
},
"10": {
"title": [ 320, 10, "fonts/bahnschrift20" ],
"pos": [ 320, 40 ]
},
"11": {
"rotate": 0,
"mode": 1,
"days": 7,
"gridparam": [ 3, 17, 30, "calibrib16.vlw", "BellCent10.vlw", 14 ]
}
}
}

View File

@@ -1,20 +1,21 @@
{
"name": "M3 9.7\"",
"width": 960,
"height": 672,
"rotatebuffer": 0,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
},
"shortlut": 0,
"options": ["button"],
"contentids": [ 22, 23, 1, 5, 8, 9, 7, 19, 10, 11 ],
"usetemplate": 1,
"name": "M3 9.7\"",
"width": 960,
"height": 672,
"rotatebuffer": 2,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"zlib_compression": "27",
"options": [ "button" ],
"contentids": [ 22, 23, 1, 5, 8, 9, 7, 19, 10, 11 ],
"usetemplate": 1,
"template": {
"1": {
"weekday": [ 480, -5, "Signika-SB.ttf", 160 ],
@@ -37,5 +38,5 @@
"days": 7,
"gridparam": [ 7, 19, 30, "calibrib16.vlw", "REFSAN12.vlw", 16 ]
}
}
}
}

View File

@@ -2,19 +2,20 @@
"name": "M3 4.3\"",
"width": 522,
"height": 152,
"rotatebuffer": 1,
"rotatebuffer": 3,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": ["button"],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 11, 17, 18, 19, 20, 27],
"usetemplate": 1,
"zlib_compression": "27",
"options": [ "button" ],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 11, 17, 18, 19, 20, 27 ],
"usetemplate": 1,
"template": {
"1": {
"weekday": [ 160, 5, "Signika-SB.ttf", 60 ],

View File

@@ -6,13 +6,14 @@
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": ["button"],
"contentids": [ 22, 23, 1, 2, 3, 4, 8, 7, 19, 10, 21 ],
"usetemplate": 0
"zlib_compression": "27",
"options": [ "button" ],
"contentids": [ 22, 23, 1, 2, 3, 4, 8, 7, 19, 10, 21 ],
"usetemplate": 0
}

View File

@@ -2,22 +2,23 @@
"name": "M3 2.2\"",
"width": 296,
"height": 160,
"rotatebuffer": 1,
"rotatebuffer": 3,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": ["button", "led"],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26],
"zlib_compression": "27",
"options": [ "button", "led" ],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26 ],
"template": {
"1": {
"weekday": [148, 5, "Signika-SB.ttf", 60],
"date": [148, 75, "Signika-SB.ttf", 50]
"weekday": [ 148, 5, "Signika-SB.ttf", 60 ],
"date": [ 148, 75, "Signika-SB.ttf", 50 ]
},
"2": {
"fonts": [ "Signika-SB.ttf", 150, 150, 110, 80, 60, 50 ],
@@ -30,20 +31,20 @@
"bars": [ 5, 141, 10 ]
},
"4": {
"location": [5, 5, "fonts/bahnschrift30"],
"wind": [280, 5, "fonts/bahnschrift30"],
"temp": [5, 65, "fonts/bahnschrift70"],
"icon": [285, 20, 70, 2],
"dir": [245, -12, 40],
"umbrella": [190, -50, 25]
"location": [ 5, 5, "fonts/bahnschrift30" ],
"wind": [ 280, 5, "fonts/bahnschrift30" ],
"temp": [ 5, 65, "fonts/bahnschrift70" ],
"icon": [ 285, 20, 70, 2 ],
"dir": [ 245, -12, 40 ],
"umbrella": [ 190, -50, 25 ]
},
"8": {
"location": [5, 12, "t0_14b_tf"],
"column": [5, 59],
"day": [30, 18, "fonts/twcondensed20", 41, 108],
"icon": [30, 55, 30],
"wind": [18, 26],
"line": [20, 128]
"location": [ 5, 12, "t0_14b_tf" ],
"column": [ 5, 59 ],
"day": [ 30, 18, "fonts/twcondensed20", 41, 108 ],
"icon": [ 30, 55, 30 ],
"wind": [ 18, 26 ],
"line": [ 20, 128 ]
},
"9": {
"title": [ 5, 4, "bahnschrift20.vlw", 25 ],
@@ -52,8 +53,8 @@
"desc": [ 0, 5, "", 1 ]
},
"10": {
"title": [149, 5, "fonts/bahnschrift20"],
"pos": [149, 30]
"title": [ 149, 5, "fonts/bahnschrift20" ],
"pos": [ 149, 30 ]
},
"11": {
"mode": 0,

View File

@@ -0,0 +1,18 @@
{
"name": "M3 2.6\"",
"width": 360,
"height": 184,
"rotatebuffer": 3,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"zlib_compression": "27",
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26 ],
"usetemplate": 1
}

View File

@@ -2,18 +2,19 @@
"name": "M3 2.9\"",
"width": 384,
"height": 168,
"rotatebuffer": 1,
"rotatebuffer": 3,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": ["button", "led"],
"contentids": [22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26, 27],
"zlib_compression": "27",
"options": [ "button", "led" ],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26, 27 ],
"usetemplate": 1,
"template": {
"1": {
@@ -31,12 +32,12 @@
"bars": [ 5, 141, 14 ]
},
"8": {
"location": [5, 12, "t0_14b_tf"],
"column": [5, 76],
"day": [39, 23, "bahnschrift20.vlw", 48, 140],
"icon": [39, 65, 45],
"wind": [23, 26],
"line": [20, 168]
"location": [ 5, 12, "t0_14b_tf" ],
"column": [ 5, 76 ],
"day": [ 39, 23, "bahnschrift20.vlw", 48, 140 ],
"icon": [ 39, 65, 45 ],
"wind": [ 23, 26 ],
"line": [ 20, 168 ]
},
"9": {
"title": [ 5, 4, "bahnschrift20.vlw", 25 ],
@@ -56,12 +57,12 @@
"items": 10,
"red": [ 0, 21, 384, 16 ],
"line": [ 5, 23, 18, "calibrib16.vlw", 55 ]
},
},
"27": {
"bars": [ 12, 360, 110, 20 ],
"time": [ "calibrib16.vlw" ],
"yaxis": [ "BellCent10.vlw", 1, 6 ],
"head": [ "calibrib30.vlw" ]
}
}
}
}

View File

@@ -6,13 +6,14 @@
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": ["led"],
"zlib_compression": "27",
"options": [ "led" ],
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20 ],
"usetemplate": 2
}

View File

@@ -12,6 +12,7 @@
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"zlib_compression": "27",
"options": [ "led" ],
"contentids": [ 22, 23, 1, 4, 5, 8, 9, 7, 19, 10, 11 ],
"usetemplate": 1,

View File

@@ -6,13 +6,14 @@
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": ["button", "led"],
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20],
"usetemplate": 1
"zlib_compression": "27",
"options": [ "button", "led" ],
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20 ],
"usetemplate": 46
}

View File

@@ -0,0 +1,18 @@
{
"name": "M3 2.9\" FREEZER",
"width": 384,
"height": 168,
"rotatebuffer": 3,
"bpp": 1,
"colors": 2,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"zlib_compression": "27",
"options": [ "button", "led" ],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26, 27 ],
"usetemplate": 51
}

View File

@@ -0,0 +1,19 @@
{
"name": "M3 5.85\"",
"width": 792,
"height": 272,
"rotatebuffer": 0,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"zlib_compression": "27",
"options": [ ],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26, 27 ],
"usetemplate": 51
}

View File

@@ -0,0 +1,18 @@
{
"name": "M3 5.85\" FREEZER",
"width": 792,
"height": 272,
"rotatebuffer": 0,
"bpp": 1,
"colors": 2,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"zlib_compression": "27",
"options": [ ],
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20, 26, 27 ],
"usetemplate": 51
}

View File

@@ -0,0 +1,84 @@
{
"name": "HS BWR 2.13\"",
"width": 256,
"height": 128,
"rotatebuffer": 1,
"bpp": 2,
"colors": 3,
"colortable": {
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"shortlut": 0,
"options": [ "led" ],
"contentids": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 27 ],
"template": {
"1": {
"weekday": [ 128, 3, "Signika-SB.ttf", 50 ],
"date": [ 128, 62, "Signika-SB.ttf", 40 ]
},
"2": {
"fonts": [ "Signika-SB.ttf", 150, 150, 150, 115, 90, 70 ],
"xy": [ 128, 53 ]
},
"16": {
"location": [ 7, 15, "t0_14b_tf" ],
"title": [ 210, 11, "glasstown_nbp_tf" ],
"cols": [ 4, 121, 10, "glasstown_nbp_tf" ],
"bars": [ 10, 110, 8 ]
},
"4": {
"location": [ 5, 3, "fonts/bahnschrift30" ],
"wind": [ 245, 3, "fonts/bahnschrift30" ],
"temp": [ 10, 60, "fonts/bahnschrift70" ],
"icon": [ 240, 20, 70, 2 ],
"dir": [ 210, -12, 40 ],
"umbrella": [ 175, -50, 25 ]
},
"8": {
"location": [ 5, 12, "t0_14b_tf" ],
"column": [ 5, 51 ],
"day": [ 28, 18, "fonts/twcondensed20", 41, 108 ],
"icon": [ 28, 55, 30 ],
"wind": [ 18, 26 ],
"line": [ 20, 128 ]
},
"9": {
"title": [ 8, 2, "bahnschrift20.vlw", 25 ],
"items": 5,
"line": [ 8, 25, "REFSAN12.vlw" ],
"desc": [ 0, 5, "", 1 ]
},
"10": {
"title": [ 128, 2, "calibrib16.vlw" ],
"pos": [ 128, 16 ]
},
"11": {
"mode": 0,
"days": 1,
"title": [ 10, 2, "fonts/bahnschrift20" ],
"date": [ 245, 2 ],
"items": 7,
"red": [ 0, 21, 256, 14 ],
"line": [ 10, 32, 15, "t0_14b_tf", 50 ]
},
"21": [
{ "text": [ 10, 5, "OpenEpaperLink AP", "bahnschrift20", 1, 0, 0 ] },
{ "text": [ 10, 50, "IP address:", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 110, 50, "{ap_ip}", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 10, 70, "Channel:", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 110, 70, "{ap_ch}", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 10, 90, "Tag count:", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 110, 90, "{ap_tagcount}", "t0_14b_tf", 1, 0, 0 ] }
],
"27": {
"bars": [ 26, 216, 80, 20 ],
"time": [ "BellCent10.vlw" ],
"yaxis": [ "BellCent10.vlw", 6, 6 ],
"head": [ "bahnschrift20.vlw" ]
}
}
}

View File

@@ -6,76 +6,11 @@
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"contentids": [ 22, 23, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 27 ],
"template": {
"1": {
"weekday": [ 148, -3, "Signika-SB.ttf", 60 ],
"date": [ 148, 65, "Signika-SB.ttf", 48 ]
},
"2": {
"fonts": [ "Signika-SB.ttf", 150, 150, 150, 120, 100, 80 ],
"xy": [ 148, 53 ]
},
"16": {
"location": [ 5, 5, "fonts/bahnschrift30" ],
"title": [ 247, 11, "glasstown_nbp_tf" ],
"cols": [ 1, 125, 12, "glasstown_nbp_tf" ],
"bars": [ 5, 111, 10 ]
},
"4": {
"location": [5, 5, "fonts/bahnschrift30"],
"wind": [280, 5, "fonts/bahnschrift30"],
"temp": [5, 65, "fonts/bahnschrift70"],
"icon": [285, 20, 70, 2],
"dir": [235, -12, 40],
"umbrella": [190, -50, 25]
},
"8": {
"location": [5, 12, "t0_14b_tf"],
"column": [5, 59],
"day": [30, 18, "fonts/twcondensed20", 41, 108],
"icon": [30, 55, 30],
"wind": [18, 26],
"line": [20, 128]
},
"9": {
"title": [ 2, 0, "bahnschrift20.vlw", 25 ],
"items": 8,
"line": [ 1, 25, "REFSAN12.vlw" ],
"desc": [ 0, 5, "", 1 ]
},
"10": {
"title": [149, 5, "fonts/bahnschrift20"],
"pos": [149, 27]
},
"11": {
"mode": 0,
"days": 1,
"title": [5, 2, "fonts/bahnschrift20"],
"date": [290, 2],
"items": 7,
"red": [0, 21, 296, 14],
"line": [5, 32, 15, "t0_14b_tf", 50]
},
"21": [
{ "text": [ 5, 5, "OpenEpaperLink AP", "bahnschrift20", 1, 0, 0 ] },
{ "text": [ 5, 50, "IP address:", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 120, 50, "{ap_ip}", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 5, 70, "Channel:", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 120, 70, "{ap_ch}", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 5, 90, "Tag count:", "t0_14b_tf", 1, 0, 0 ] },
{ "text": [ 120, 90, "{ap_tagcount}", "t0_14b_tf", 1, 0, 0 ] }
],
"27": {
"bars": [ 9, 288, 90, 10 ],
"time": [ "BellCent10.vlw" ],
"yaxis": [ "BellCent10.vlw", 0, 6 ],
"head": [ "calibrib30.vlw" ]
}
}
"usetemplate": 1
}

View File

@@ -6,50 +6,11 @@
"bpp": 2,
"colors": 3,
"colortable": {
"white": [255, 255, 255],
"black": [0, 0, 0],
"red": [255, 0, 0],
"gray": [150, 150, 150]
"white": [ 255, 255, 255 ],
"black": [ 0, 0, 0 ],
"red": [ 255, 0, 0 ],
"gray": [ 150, 150, 150 ]
},
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20],
"template": {
"1": {
"weekday": [ 200, 0, "Signika-SB.ttf", 70 ],
"month": [ 200, 210, "Signika-SB.ttf", 70 ],
"day": [ 200, 45, "Signika-SB.ttf", 170 ]
},
"4": {
"location": [ 20, 20, "fonts/calibrib30" ],
"wind": [ 90, 83, "fonts/calibrib50" ],
"temp": [ 20, 170, "fonts/calibrib100" ],
"icon": [ 385, 0, 100, 2 ],
"dir": [ 40, 50, 80 ],
"umbrella": [ 325, 155, 78 ]
},
"8": {
"location": [ 10, 10, "fonts/calibrib30" ],
"column": [ 6, 66 ],
"day": [ 33, 60, "fonts/bahnschrift20", 104, 230 ],
"rain": [ 34, 260 ],
"icon": [ 32, 145, 30 ],
"wind": [ 17, 90 ],
"line": [ 50, 300 ]
},
"9": {
"title": [ 6, 0, "Signika-SB.ttf", 25 ],
"items": 4,
"line": [ 9, 40, "calibrib16.vlw" ],
"desc": [ 2, 8, "REFSAN12.vlw", 1.2 ]
},
"10": {
"title": [ 200, 10, "fonts/bahnschrift20" ],
"pos": [ 200, 35 ]
},
"11": {
"rotate": 0,
"mode": 1,
"days": 4,
"gridparam": [ 5, 17, 20, "calibrib16.vlw", "BellCent10.vlw", 14 ]
}
}
"contentids": [ 22, 23, 1, 4, 5, 7, 8, 9, 10, 11, 17, 18, 19, 20 ],
"usetemplate": 2
}

Binary file not shown.

Binary file not shown.

View File

@@ -54,6 +54,7 @@ class tagRecord {
struct Config {
uint8_t channel;
uint8_t subghzchannel;
char alias[32];
uint8_t led;
uint8_t tft;

View File

@@ -1,3 +1,5 @@
#include <Arduino.h>
#include "miniz-oepl.h"
#include <stdio.h>
@@ -226,7 +228,7 @@ int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits,
pStream->state = (struct mz_internal_state *)pComp;
if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY)
if (tdefl_initOEPL(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY)
{
mz_deflateEnd(pStream);
return MZ_PARAM_ERROR;
@@ -240,7 +242,7 @@ int mz_deflateReset(mz_streamp pStream)
if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree))
return MZ_STREAM_ERROR;
pStream->total_in = pStream->total_out = 0;
tdefl_init((tdefl_compressor *)pStream->state, NULL, NULL, ((tdefl_compressor *)pStream->state)->m_flags);
tdefl_initOEPL((tdefl_compressor *)pStream->state, NULL, NULL, ((tdefl_compressor *)pStream->state)->m_flags);
return MZ_OK;
}
@@ -269,7 +271,7 @@ int mz_deflate(mz_streamp pStream, int flush)
in_bytes = pStream->avail_in;
out_bytes = pStream->avail_out;
defl_status = tdefl_compress((tdefl_compressor *)pStream->state, pStream->next_in, &in_bytes, pStream->next_out, &out_bytes, (tdefl_flush)flush);
defl_status = tdefl_compressOEPL((tdefl_compressor *)pStream->state, pStream->next_in, &in_bytes, pStream->next_out, &out_bytes, (tdefl_flush)flush);
pStream->next_in += (mz_uint)in_bytes;
pStream->avail_in -= (mz_uint)in_bytes;
pStream->total_in += (mz_uint)in_bytes;
@@ -1591,7 +1593,9 @@ static mz_bool tdefl_compress_fast(tdefl_compressor *d)
if (!probe_len)
cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0;
if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
// fixme: hardcoded 8*1024
// if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 4U * 1024U)))
{
cur_match_len = 1;
*pLZ_code_buf++ = (mz_uint8)first_trigram;
@@ -1924,8 +1928,9 @@ static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d)
return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY;
}
tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush)
tdefl_status tdefl_compressOEPL(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush)
{
Serial.println("tdefl_compress");
if (!d)
{
if (pIn_buf_size)
@@ -1995,11 +2000,12 @@ tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pI
tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush)
{
MZ_ASSERT(d->m_pPut_buf_func);
return tdefl_compress(d, pIn_buf, &in_buf_size, NULL, NULL, flush);
return tdefl_compressOEPL(d, pIn_buf, &in_buf_size, NULL, NULL, flush);
}
tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
tdefl_status tdefl_initOEPL(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
{
Serial.println("tdefl_init");
d->m_pPut_buf_func = pPut_buf_func;
d->m_pPut_buf_user = pPut_buf_user;
d->m_flags = (mz_uint)(flags);
@@ -2053,7 +2059,7 @@ mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put
pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor));
if (!pComp)
return MZ_FALSE;
succeeded = (tdefl_init(pComp, pPut_buf_func, pPut_buf_user, flags) == TDEFL_STATUS_OKAY);
succeeded = (tdefl_initOEPL(pComp, pPut_buf_func, pPut_buf_user, flags) == TDEFL_STATUS_OKAY);
succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE);
MZ_FREE(pComp);
return succeeded;
@@ -2171,7 +2177,7 @@ void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int
for (z = 41; z; --z)
tdefl_output_buffer_putter(&z, 1, &out_buf);
/* compress image data */
tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER);
tdefl_initOEPL(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER);
for (y = 0; y < h; ++y)
{
tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH);

View File

@@ -149,7 +149,7 @@ namespace Miniz {
/*#define MINIZ_NO_ZLIB_APIS */
/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */
/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES
/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc
@@ -316,7 +316,7 @@ enum
};
/* Window bits */
#define MZ_DEFAULT_WINDOW_BITS 15
#define MZ_DEFAULT_WINDOW_BITS 12
struct mz_internal_state;
@@ -797,10 +797,10 @@ typedef struct
/* pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. */
/* If pBut_buf_func is NULL the user should always call the tdefl_compress() API. */
/* flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) */
MINIZ_EXPORT tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags);
MINIZ_EXPORT tdefl_status tdefl_initOEPL(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags);
/* Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. */
MINIZ_EXPORT tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush);
MINIZ_EXPORT tdefl_status tdefl_compressOEPL(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush);
/* tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. */
/* tdefl_compress_buffer() always consumes the entire input buffer. */

View File

@@ -59,7 +59,6 @@ build_flags =
-D BOARD_HAS_PSRAM
-D SAVE_SPACE
-D POWER_NO_SOFT_POWER
-D SAVE_SPACE
-D FLASHER_AP_SS=11
-D FLASHER_AP_CLK=9
-D FLASHER_AP_MOSI=10
@@ -199,7 +198,6 @@ build_flags =
-D FLASHER_AP_TXD=17
-D FLASHER_AP_RXD=16
-D FLASHER_LED=22
-D SAVE_SPACE
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>-<ips_display.cpp>-<webflasher.cpp>
; ----------------------------------------------------------------------------------------

View File

@@ -82,7 +82,6 @@ void contentRunner() {
if (minutesUntilNextUpdate > 1 && (wsClientCount() == 0 || config.stopsleep == 0)) {
taginfo->pendingIdle = minutesUntilNextUpdate * 60;
if (taginfo->isExternal == false) {
Serial.printf("sleeping for %d more minutes\n", minutesUntilNextUpdate);
prepareIdleReq(taginfo->mac, minutesUntilNextUpdate);
}
}
@@ -1186,7 +1185,7 @@ bool getCalFeed(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgPa
int temp = imageParams.height;
imageParams.height = imageParams.width;
imageParams.width = temp;
imageParams.rotatebuffer = 1 - imageParams.rotatebuffer;
imageParams.rotatebuffer = 1 - (imageParams.rotatebuffer%2);
initSprite(spr, imageParams.width, imageParams.height, imageParams);
} else {
initSprite(spr, imageParams.width, imageParams.height, imageParams);
@@ -2085,7 +2084,7 @@ void rotateBuffer(uint8_t rotation, uint8_t &currentOrientation, TFT_eSprite &sp
initSprite(spr, sprCpy.width(), sprCpy.height(), imageParams);
sprCpy.pushToSprite(&spr, 0, 0);
sprCpy.deleteSprite();
imageParams.rotatebuffer = 1 - imageParams.rotatebuffer;
imageParams.rotatebuffer = 1 - (imageParams.rotatebuffer%2);
}
currentOrientation = rotation;
}

View File

@@ -17,7 +17,7 @@ int currentLanguage = 0;
void updateLanguageFromConfig() {
int tempLang = config.language;
if (tempLang < 0 || tempLang > 8) {
if (tempLang < 0 || tempLang > 11) {
Serial.println("Language not supported");
return;
}

View File

@@ -147,6 +147,8 @@ void setup() {
#ifdef HAS_USB
// We'll need to start the 'usbflasher' task for boards with a second (USB) port. This can be used as a 'flasher' interface, using a python script on the host
xTaskCreate(usbFlasherTask, "usbflasher", 10000, NULL, 5, NULL);
#else
pinMode(0, INPUT_PULLUP);
#endif
#ifdef HAS_EXT_FLASHER

View File

@@ -88,10 +88,16 @@ uint32_t colorDistance(Color &c1, Color &c2, Error &e1) {
void spr2color(TFT_eSprite &spr, imgParam &imageParams, uint8_t *buffer, size_t buffer_size, bool is_red) {
uint8_t rotate = imageParams.rotate;
long bufw = spr.width(), bufh = spr.height();
if (imageParams.rotatebuffer) {
if (imageParams.rotatebuffer % 2) {
//turn the image 90 or 270
rotate = (rotate + 3) % 4;
rotate = (rotate + (imageParams.rotatebuffer - 1)) % 4;
bufw = spr.height();
bufh = spr.width();
} else {
// rotate 180
rotate = (rotate + (imageParams.rotatebuffer)) % 4;
}
memset(buffer, 0, buffer_size);
@@ -234,8 +240,8 @@ size_t prepareHeader(uint8_t headerbuf[], uint16_t bufw, uint16_t bufh, imgParam
uint8_t headersize = 6;
headerbuf[0] = headersize;
memcpy(headerbuf + (imageParams.rotatebuffer == 1 ? 3 : 1), &bufw, sizeof(uint16_t));
memcpy(headerbuf + (imageParams.rotatebuffer == 1 ? 1 : 3), &bufh, sizeof(uint16_t));
memcpy(headerbuf + (imageParams.rotatebuffer % 2 == 1 ? 3 : 1), &bufw, sizeof(uint16_t));
memcpy(headerbuf + (imageParams.rotatebuffer % 2 == 1 ? 1 : 3), &bufh, sizeof(uint16_t));
if (imageParams.hasRed && imageParams.bpp > 1) {
totalbytes = buffer_size * 2 + headersize;
@@ -249,7 +255,7 @@ size_t prepareHeader(uint8_t headerbuf[], uint16_t bufw, uint16_t bufh, imgParam
}
bool initializeCompressor(Miniz::tdefl_compressor *comp, int flags) {
return Miniz::tdefl_init(comp, NULL, NULL, flags) == Miniz::TDEFL_STATUS_OKAY;
return Miniz::tdefl_initOEPL(comp, NULL, NULL, flags) == Miniz::TDEFL_STATUS_OKAY;
}
size_t compressAndWrite(Miniz::tdefl_compressor *comp, const void *inbuf, size_t inbytes, void *zlibbuf, size_t outsize, size_t totalbytes, File &f_out, Miniz::tdefl_flush flush) {
@@ -257,8 +263,8 @@ size_t compressAndWrite(Miniz::tdefl_compressor *comp, const void *inbuf, size_t
size_t outbytes_compressed = outsize;
uint32_t t = millis();
tdefl_compress(comp, inbuf, &inbytes_compressed, zlibbuf, &outbytes_compressed, flush);
Serial.printf("zlib: compressed %d into %d bytes in %d ms\n", inbytes_compressed, outbytes_compressed, millis()-t);
Miniz::tdefl_compressOEPL(comp, inbuf, &inbytes_compressed, zlibbuf, &outbytes_compressed, flush);
Serial.printf("zlib: compressed %d into %d bytes in %d ms\n", inbytes_compressed, outbytes_compressed, millis() - t);
f_out.write((const uint8_t *)zlibbuf, outbytes_compressed);
return outbytes_compressed;
@@ -266,7 +272,8 @@ size_t compressAndWrite(Miniz::tdefl_compressor *comp, const void *inbuf, size_t
void rewriteHeader(File &f_out) {
// https://www.rfc-editor.org/rfc/rfc1950
const uint8_t cmf = 0x48;
const uint8_t cmf = 0x48; // 4096
// const uint8_t cmf = 0x58; // 8192
uint8_t flg, flevel = 3;
uint16_t header = cmf << 8 | (flevel << 6);
header += 31 - (header % 31);
@@ -276,7 +283,6 @@ void rewriteHeader(File &f_out) {
f_out.write(flg);
}
void spr2buffer(TFT_eSprite &spr, String &fileout, imgParam &imageParams) {
long t = millis();
@@ -333,6 +339,7 @@ void spr2buffer(TFT_eSprite &spr, String &fileout, imgParam &imageParams) {
f_out.write(reinterpret_cast<uint8_t *>(&totalbytes), sizeof(uint32_t));
// 768 = compression level 9, 1500 = unofficial level 10
if (comp == NULL || zlibbuf == NULL || totalbytes == 0 || !initializeCompressor(comp, Miniz::TDEFL_WRITE_ZLIB_HEADER | 1500)) {
Serial.println("Failed to initialize compressor or allocate memory for zlib");
if (zlibbuf != NULL) free(zlibbuf);
@@ -348,10 +355,10 @@ void spr2buffer(TFT_eSprite &spr, String &fileout, imgParam &imageParams) {
compressAndWrite(comp, buffer, buffer_size, zlibbuf, buffer_size, buffer_size, f_out, Miniz::TDEFL_FINISH);
}
rewriteHeader(f_out);
free(zlibbuf);
free(comp);
rewriteHeader(f_out);
} else {
f_out.write(buffer, buffer_size);
if (imageParams.hasRed && imageParams.bpp > 1) {

View File

@@ -74,15 +74,15 @@ void prepareCancelPending(const uint8_t dst[8]) {
}
void prepareIdleReq(const uint8_t* dst, uint16_t nextCheckin) {
if (nextCheckin > 0) {
if (nextCheckin > 0 && countQueueItem(dst) == 0) {
struct pendingData pending = {0};
memcpy(pending.targetMac, dst, 8);
pending.availdatainfo.dataType = DATATYPE_NOUPDATE;
pending.availdatainfo.nextCheckIn = nextCheckin;
pending.attemptsLeft = 10 + config.maxsleep;
Serial.printf(">SDA %02X%02X%02X%02X%02X%02X%02X%02X NOP\n", dst[7], dst[6], dst[5], dst[4], dst[3], dst[2], dst[1], dst[0]);
queueDataAvail(&pending, true);
Serial.printf(">SDA %02X%02X%02X%02X%02X%02X%02X%02X sleeping %d minutes\n", dst[7], dst[6], dst[5], dst[4], dst[3], dst[2], dst[1], dst[0], nextCheckin);
sendDataAvail(&pending);
}
}
@@ -209,6 +209,15 @@ bool prepareDataAvail(String& filename, uint8_t dataType, uint8_t dataTypeArgume
file.close();
uint16_t attempts = 60 * 24;
if (memcmp(md5bytes, taginfo->md5, 16) == 0) {
wsLog("new image is the same as current image. not updating tag.");
wsSendTaginfo(dst, SYNC_TAGSTATUS);
if (contentFS->exists(filename) && resend == false) {
contentFS->remove(filename);
}
return true;
}
if (dataType != DATATYPE_FW_UPDATE) {
char dst_path[64];
sprintf(dst_path, "/current/%02X%02X%02X%02X%02X%02X%02X%02X_%lu.pending", dst[7], dst[6], dst[5], dst[4], dst[3], dst[2], dst[1], dst[0], millis() % 1000000);
@@ -440,7 +449,7 @@ void processXferComplete(struct espXferComplete* xfc, bool local) {
if (config.preview && (queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_2BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_RAW_1BPP || queueItem->pendingdata.availdatainfo.dataType == DATATYPE_IMG_ZLIB)) {
contentFS->rename(queueItem->filename, String(dst_path));
} else {
contentFS->remove(queueItem->filename);
if (queueItem->pendingdata.availdatainfo.dataType != DATATYPE_FW_UPDATE) contentFS->remove(queueItem->filename);
}
}
memcpy(md5bytes, &queueItem->pendingdata.availdatainfo.dataVer, sizeof(uint64_t));
@@ -508,10 +517,16 @@ void processDataReq(struct espAvailDataReq* eadr, bool local, IPAddress remoteIP
}
char buffer[64];
char hexmac[17];
mac2hex(eadr->src, hexmac);
tagRecord* taginfo = tagRecord::findByMAC(eadr->src);
if (taginfo == nullptr) {
if (config.lock == 1 || (config.lock == 2 && eadr->adr.wakeupReason != WAKEUP_REASON_FIRSTBOOT)) return;
if (eadr->adr.currentChannel > 0 && eadr->adr.currentChannel != apInfo.channel) return;
if (eadr->adr.currentChannel > 0 && eadr->adr.currentChannel != apInfo.channel) {
Serial.printf("Tag %s reports illegal channel %d\n", hexmac, eadr->adr.currentChannel);
return;
}
taginfo = new tagRecord;
memcpy(taginfo->mac, eadr->src, sizeof(taginfo->mac));
taginfo->pendingCount = 0;
@@ -520,9 +535,6 @@ void processDataReq(struct espAvailDataReq* eadr, bool local, IPAddress remoteIP
time_t now;
time(&now);
char hexmac[17];
mac2hex(eadr->src, hexmac);
if (!local) {
if (taginfo->isExternal == false) {
wsLog("moved AP from local to external " + String(hexmac));
@@ -573,7 +585,7 @@ void processDataReq(struct espAvailDataReq* eadr, bool local, IPAddress remoteIP
taginfo->temperature = eadr->adr.temperature;
taginfo->batteryMv = eadr->adr.batteryMv;
taginfo->hwType = eadr->adr.hwType;
if (eadr->adr.wakeupReason > 0) taginfo->wakeupReason = eadr->adr.wakeupReason;
taginfo->wakeupReason = eadr->adr.wakeupReason;
taginfo->capabilities = eadr->adr.capabilities;
taginfo->currentChannel = eadr->adr.currentChannel;
taginfo->tagSoftwareVersion = eadr->adr.tagSoftwareVersion;
@@ -637,8 +649,11 @@ void setAPchannel() {
udpsync.getAPList();
} else {
if (curChannel.channel != config.channel) {
curChannel.channel = config.channel;
sendChannelPower(&curChannel);
curChannel.channel = config.channel;
#ifdef HAS_SUBGHZ
curChannel.subghzchannel = config.subghzchannel;
#endif
sendChannelPower(&curChannel);
}
}
}

View File

@@ -755,6 +755,9 @@ bool bringAPOnline() {
}
bool checkRadio() {
#ifndef C6_OTA_FLASHING
return true;
#endif
// make a short between FLASHER_AP_TXD and FLASHER_AP_RXD to indicate that no radio is present
// e.g. for flasher only, or just to use the S3 to generate images for smaller AP's
pinMode(FLASHER_AP_TXD, OUTPUT);

View File

@@ -57,7 +57,10 @@ void logLine(const String& text) {
contentFS->remove("/logold.txt");
contentFS->rename("/log.txt", "/logold.txt");
logFile = contentFS->open("/log.txt", "a");
if (!logFile) return;
if (!logFile) {
xSemaphoreGive(fsMutex);
return;
}
}
logFile.print(timeStr);

View File

@@ -315,6 +315,7 @@ void initAPconfig() {
configFile.close();
}
config.channel = APconfig.containsKey("channel") ? APconfig["channel"] : 0;
config.subghzchannel = APconfig.containsKey("subghzchannel") ? APconfig["subghzchannel"] : 0;
if (APconfig["alias"]) strlcpy(config.alias, APconfig["alias"], sizeof(config.alias));
config.led = APconfig.containsKey("led") ? APconfig["led"] : 255;
config.tft = APconfig.containsKey("tft") ? APconfig["tft"] : 255;
@@ -343,6 +344,7 @@ void saveAPconfig() {
fs::File configFile = contentFS->open("/current/apconfig.json", "w");
DynamicJsonDocument APconfig(500);
APconfig["channel"] = config.channel;
APconfig["subghzchannel"] = config.subghzchannel;
APconfig["alias"] = config.alias;
APconfig["led"] = config.led;
APconfig["tft"] = config.tft;

View File

@@ -492,7 +492,7 @@ void init_web() {
#ifdef C6_OTA_FLASHING
response->print("\"C6\": \"1\", ");
#else
response->print("\"C6\": \"1\", ");
response->print("\"C6\": \"0\", ");
#endif
#ifdef SAVE_SPACE
response->print("\"savespace\": \"1\", ");
@@ -509,6 +509,13 @@ void init_web() {
#else
response->print("\"hasBLE\": \"0\", ");
#endif
#ifdef HAS_SUBGHZ
response->print("\"hasSubGhz\": \"1\", ");
#else
response->print("\"hasSubGhz\": \"0\", ");
#endif
response->print("\"apstate\": \"" + String(apInfo.state) + "\"");
File configFile = contentFS->open("/current/apconfig.json", "r");
@@ -542,6 +549,9 @@ void init_web() {
if (request->hasParam("channel", true)) {
config.channel = static_cast<uint8_t>(request->getParam("channel", true)->value().toInt());
}
if (request->hasParam("subghzchannel", true)) {
config.subghzchannel = static_cast<uint8_t>(request->getParam("subghzchannel", true)->value().toInt());
}
if (request->hasParam("led", true)) {
config.led = static_cast<uint8_t>(request->getParam("led", true)->value().toInt());
updateBrightnessFromConfig();

Some files were not shown because too many files have changed in this diff Show More