This commit is contained in:
akasaka 2023-05-17 19:53:17 +09:00
commit 574a019cbb
14 changed files with 639 additions and 0 deletions

32
README.md Normal file
View File

@ -0,0 +1,32 @@
# wacca-vfd-arduino
Controls the VFD display of WACCA cabinet from an Arduino.
## Schematic
(sorry, no picture)
Rx,Tx of Arduino Pro Micro -> MAX232 -> Tx,Rx of VFD display (COM2 cable on WACCA cabinet)
For other connections around MAX232 see tutorials online such as the one in [DIYODE Magazine](https://diyodemag.com/education/the_classroom_rs232_the_max232_ic_arduino_uno).
For RS232 pinout see e.g. [PinoutGuide](https://pinoutguide.com/SerialPorts/Serial9_pinout.shtml)
## Thanks
Thanks to Obiwan for helping with this protocol.
Thanks to [image2cpp](https://javl.github.io/image2cpp/) for helping to convert the graphics.
## Graphics Data Format
1 bit, recorded as bytes where each byte is a quarter column. Thus the screen is laid out like this:
```
[0][4][8]
[1][5][9]
[2][6]...
[3][7]...
```
When converting on image2cpp you can upload a horizontal image and then enable *Rotate: 90* and *Flip: horizontally* to get the correct data bytes.

1
firm/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.pio

60
firm/.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,60 @@
//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
"configurations": [
{
"name": "PlatformIO",
"includePath": [
"d:/Code/wacca-vfd/firm/include",
"d:/Code/wacca-vfd/firm/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/cores/arduino",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/variants/sparkfun_promicro",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/HID/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/SPI/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/Wire/src",
""
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"d:/Code/wacca-vfd/firm/include",
"d:/Code/wacca-vfd/firm/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/cores/arduino",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/variants/sparkfun_promicro",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/HID/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/SPI/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src",
"C:/Users/akasaka/.platformio/packages/framework-arduino-avr/libraries/Wire/src",
""
]
},
"defines": [
"PLATFORMIO=60107",
"ARDUINO_AVR_PROMICRO8",
"F_CPU=8000000L",
"ARDUINO_ARCH_AVR",
"ARDUINO=10808",
"USB_VID=0x1B4F",
"USB_PID=0x9203",
"USB_PRODUCT=\"SparkFun Pro Micro\"",
"USB_MANUFACTURER=\"SparkFun\"",
"__AVR_ATmega32U4__",
""
],
"cStandard": "c11",
"cppStandard": "c++11",
"compilerPath": "C:/Users/akasaka/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe",
"compilerArgs": [
"-mmcu=atmega32u4",
""
]
}
],
"version": 4
}

10
firm/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

44
firm/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,44 @@
// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
//
// PIO Unified Debugger
//
// Documentation: https://docs.platformio.org/page/plus/debugging.html
// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html
{
"version": "0.2.0",
"configurations": [
{
"type": "platformio-debug",
"request": "launch",
"name": "PIO Debug",
"executable": "d:/Code/wacca-vfd/firm/.pio/build/sparkfun_promicro8/firmware.elf",
"projectEnvName": "sparkfun_promicro8",
"toolchainBinDir": "C:/Users/akasaka/.platformio/packages/toolchain-atmelavr/bin",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": {
"type": "PlatformIO",
"task": "Pre-Debug"
}
},
{
"type": "platformio-debug",
"request": "launch",
"name": "PIO Debug (skip Pre-Debug)",
"executable": "d:/Code/wacca-vfd/firm/.pio/build/sparkfun_promicro8/firmware.elf",
"projectEnvName": "sparkfun_promicro8",
"toolchainBinDir": "C:/Users/akasaka/.platformio/packages/toolchain-atmelavr/bin",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "platformio-debug",
"request": "launch",
"name": "PIO Debug (without uploading)",
"executable": "d:/Code/wacca-vfd/firm/.pio/build/sparkfun_promicro8/firmware.elf",
"projectEnvName": "sparkfun_promicro8",
"toolchainBinDir": "C:/Users/akasaka/.platformio/packages/toolchain-atmelavr/bin",
"internalConsoleOptions": "openOnSessionStart",
"loadMode": "manual"
}
]
}

39
firm/include/README Normal file
View File

@ -0,0 +1,39 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

45
firm/include/futaba.h Normal file
View File

@ -0,0 +1,45 @@
#ifndef FUTABA_H_
#define FUTABA_H_
#include <rsrc.h>
void ftb_init();
void ftb_reset();
void ftb_clear();
void ftb_power(bool on);
typedef enum {
BRIGHT_0 = 0,
BRIGHT_25 = 1,
BRIGHT_50 = 2,
BRIGHT_75 = 3,
BRIGHT_100 = 4
} ftb_bright_t;
void ftb_brightness(ftb_bright_t);
void ftb_canvas_shift(uint16_t left);
void ftb_draw_image(img_data_t * image, uint16_t left, uint8_t top);
void ftb_cursor(uint16_t left, uint8_t top);
typedef enum {
SIMP_CHINESE,
TRAD_CHINESE,
JAPANESE,
KOREAN
} ftb_lang_t;
void ftb_language(ftb_lang_t);
typedef enum {
FONT_16_16,
FONT_6_8
} ftb_font_size_t;
void ftb_font_size(ftb_font_size_t);
void ftb_scroll_box_make(uint16_t left, uint8_t top, uint16_t width, uint8_t height);
void ftb_scroll_speed(uint8_t divisor);
void ftb_scroll_text(const char * text);
void ftb_scroll_start();
void ftb_write(const char * text);
#endif

19
firm/include/rsrc.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef RSRC_H_
#define RSRC_H_
#include <Arduino.h>
typedef struct {
bool is_progmem;
const unsigned char * data;
uint16_t width_pixels;
uint8_t height_strides;
bool inverse;
} img_data_t;
size_t img_offset_at(img_data_t * image, uint16_t left, uint8_t top);
img_data_t img_invert(img_data_t * image);
extern img_data_t IMG_WOCAO;
extern img_data_t IMG_TANOC;
#endif

46
firm/lib/README Normal file
View File

@ -0,0 +1,46 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.
The source code of each library should be placed in a an own separate directory
("lib/your_library_name/[here are source files]").
For example, see a structure of the following two libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html

17
firm/platformio.ini Normal file
View File

@ -0,0 +1,17 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:sparkfun_promicro8]
platform = atmelavr
board = sparkfun_promicro8
upload_port = COM25
monitor_port = COM25
monitor_speed = 9600
framework = arduino

113
firm/src/futaba.cpp Normal file
View File

@ -0,0 +1,113 @@
#include <futaba.h>
#include <Arduino.h>
//
// Thanks to
// OBIWAN
// for help with this protocol
//
#ifndef FTB_PORT
#define FTB_PORT Serial1
#endif
#define LEFT_HI(x) (((x) & 0x100) >> 8)
#define LEFT_LO(x) ((x) & 0xFF)
#define FTB_PORT_WRITE_LEFT(x) {FTB_PORT.write(LEFT_HI(x)); FTB_PORT.write(LEFT_LO(x));}
void ftb_init() {
FTB_PORT.begin(115200);
}
void ftb_reset() {
FTB_PORT.write("\x1B\x0B"); // reset
}
void ftb_clear() {
FTB_PORT.write("\x1B\x0C");
}
void ftb_power(bool on) {
FTB_PORT.write("\x1B\x21"); // on
FTB_PORT.write(on ? 0x1 : 0x0);
}
void ftb_brightness(ftb_bright_t brightness) {
FTB_PORT.write("\x1b\x20");
FTB_PORT.write((char) brightness);
}
void ftb_canvas_shift(uint16_t left) {
FTB_PORT.write("\x1B\x22");
FTB_PORT_WRITE_LEFT(left);
}
void ftb_cursor(uint16_t left, uint8_t top) {
FTB_PORT.write("\x1B\x30"); // cursor set
FTB_PORT_WRITE_LEFT(left);
FTB_PORT.write(top);
}
void ftb_language(ftb_lang_t lang) {
FTB_PORT.write("\x1B\x32");
FTB_PORT.write((char) lang);
}
void ftb_font_size(ftb_font_size_t font) {
FTB_PORT.write("\x1B\x33");
FTB_PORT.write((char) font);
}
void ftb_scroll_box_make(uint16_t left, uint8_t top, uint16_t width, uint8_t height) {
FTB_PORT.write("\x1B\x40");
FTB_PORT_WRITE_LEFT(left);
FTB_PORT.write(top);
FTB_PORT_WRITE_LEFT(width);
FTB_PORT.write(height);
}
void ftb_scroll_speed(uint8_t divisor) {
FTB_PORT.write("\x1B\x41");
FTB_PORT.write((char) divisor);
}
void ftb_scroll_text(const char * text) {
size_t len = strlen(text);
if(len > 255) return;
FTB_PORT.write("\x1B\x50");
FTB_PORT.write(len);
FTB_PORT.write(text);
}
void ftb_scroll_start() {
FTB_PORT.write("\x1B\x51");
}
void ftb_write(const char * text) {
FTB_PORT.write(text);
}
void ftb_draw_image(img_data_t * image, uint16_t left, uint8_t top) {
FTB_PORT.write("\x1B\x2E"); // bmp out
FTB_PORT_WRITE_LEFT(left);
FTB_PORT.write(top);
FTB_PORT_WRITE_LEFT(image->width_pixels - 1);
FTB_PORT.write(image->height_strides - 1);
for(unsigned int i = 0; i < (image->width_pixels) * (image->height_strides); i++) {
byte c;
if(image->is_progmem) {
c = pgm_read_byte(&image->data[i]);
} else {
c = image->data[i];
}
if(image->inverse) {
c = ~c;
}
FTB_PORT.write(c);
}
}

82
firm/src/main.cpp Normal file
View File

@ -0,0 +1,82 @@
#include <Arduino.h>
#include <futaba.h>
#include <rsrc.h>
extern "C" {
void setup();
void loop();
}
void setup() {
ftb_init();
delay(1000);
ftb_reset();
ftb_power(true);
ftb_brightness(BRIGHT_25);
ftb_canvas_shift(0);
ftb_cursor(0, 0);
ftb_font_size(FONT_16_16);
}
void scroll_from_to(uint16_t from, uint16_t to, uint16_t w) {
for(uint16_t x = from; x < to; x++) {
ftb_canvas_shift(x);
delay(w);
}
}
void loop() {
img_data_t tmp;
ftb_canvas_shift(0);
tmp = img_invert(&IMG_WOCAO);
ftb_draw_image(&IMG_WOCAO, 160, 0);
scroll_from_to(0, 160, 10);
delay(1000);
for(int i = 0; i < 4; i++) {
ftb_cursor(0, 0);
ftb_draw_image(&tmp, 160, 0);
delay(250);
ftb_cursor(0, 0);
ftb_draw_image(&IMG_WOCAO, 160, 0);
delay(250);
}
scroll_from_to(160, 160 * 2, 10);
ftb_cursor(160 * 3, 0);
ftb_write(" ");
ftb_canvas_shift(0);
tmp = img_invert(&IMG_TANOC);
ftb_cursor(0, 0);
ftb_draw_image(&IMG_TANOC, 160, 0);
scroll_from_to(0, 160, 10);
delay(1000);
for(int i = 0; i < 4; i++) {
ftb_cursor(0, 0);
ftb_draw_image(&tmp, 160, 0);
delay(250);
ftb_cursor(0, 0);
ftb_draw_image(&IMG_TANOC, 160, 0);
delay(250);
}
scroll_from_to(160, 160 * 2, 10);
ftb_cursor(160 * 3, 0);
ftb_write("** ALL SAS OELUTZ **");
scroll_from_to(160*2, 160 * 3, 10);
ftb_scroll_box_make(0, 2, 160, 2);
ftb_scroll_speed(2);
ftb_scroll_text("Are you ready to RAVE to the music of HARDCORE TANO-C?? ENJOY the SUPER COOL mega Game WACCA, sunovabitch!! ");
ftb_scroll_start();
delay(10000);
ftb_scroll_text("");
}

120
firm/src/rsrc.cpp Normal file
View File

@ -0,0 +1,120 @@
#include <rsrc.h>
const unsigned char bmp_wocao [] PROGMEM = {
// 'wocao', 32x160px
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff,
0xf8, 0x3f, 0xff, 0xff, 0xf8, 0x0f, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xf8, 0x00, 0xff, 0xff,
0xf8, 0x00, 0x3f, 0xff, 0xfc, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x03, 0xff, 0xf8, 0xc0, 0x00, 0xff,
0xf8, 0x38, 0x00, 0x1f, 0xf8, 0x0e, 0x00, 0x07, 0xf8, 0x03, 0x80, 0x01, 0xf8, 0x00, 0xe0, 0x00,
0xf8, 0x00, 0x38, 0x00, 0xf8, 0x00, 0x06, 0x00, 0xf8, 0x00, 0x01, 0x80, 0xf8, 0x00, 0x00, 0x61,
0xf8, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x01, 0xff,
0xf8, 0x00, 0x07, 0xff, 0xf8, 0x00, 0x03, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x00, 0x3f,
0xff, 0xe0, 0x00, 0x1f, 0xff, 0x80, 0x00, 0x3f, 0xfe, 0x00, 0x00, 0xcf, 0xf8, 0x00, 0x07, 0x0f,
0xf8, 0x00, 0x1c, 0x0f, 0xf8, 0x00, 0x70, 0x0f, 0xf8, 0x01, 0xc0, 0x0f, 0xf8, 0x06, 0x00, 0x0f,
0xf8, 0x18, 0x00, 0x0f, 0xf8, 0x60, 0x00, 0x0f, 0xf9, 0x80, 0x00, 0x3f, 0xfe, 0x00, 0x01, 0xff,
0xfc, 0x00, 0x03, 0xff, 0xe6, 0x00, 0x00, 0xfb, 0xc1, 0x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fe, 0x03, 0xe0, 0x3f, 0xff, 0x03, 0xe0, 0x7f, 0xff, 0xc3, 0xe1, 0xcf, 0xff, 0xf3, 0xe7, 0x0f,
0xff, 0xff, 0xfc, 0x0f, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0x80, 0x0f, 0xff, 0xfe, 0x00, 0x0f,
0xff, 0xf8, 0x00, 0x0f, 0xff, 0xe0, 0x00, 0x0f, 0xff, 0x80, 0x00, 0x3f, 0xfe, 0x00, 0x01, 0xff,
0xfc, 0x00, 0x03, 0xff, 0xe6, 0x00, 0x00, 0xff, 0x81, 0xc0, 0x00, 0x3f, 0x00, 0x70, 0x00, 0x0f,
0x00, 0x1c, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x0f, 0xc0, 0x00, 0xc0, 0x0f, 0xf0, 0x00, 0x30, 0x0f,
0xfc, 0x00, 0x0c, 0x0f, 0xff, 0x00, 0x03, 0x0f, 0xff, 0xc0, 0x00, 0xef, 0xff, 0xf0, 0x00, 0x3f,
0xff, 0xfc, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x0f, 0xff, 0xff, 0xe0, 0x0f, 0xff, 0xff, 0xf8, 0x0f,
0xff, 0xff, 0xfe, 0x0f, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
const unsigned char bmp_tanoc [] PROGMEM = {
// 'tanoc', 32x160px
0xff, 0xe0, 0x0f, 0xff, 0xff, 0x80, 0x03, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xfe, 0x3f, 0xf8, 0x7f,
0xfc, 0xff, 0xfe, 0x3f, 0xf9, 0xef, 0xff, 0x1f, 0xf1, 0xe7, 0xff, 0x9f, 0xf3, 0xc7, 0xff, 0x8f,
0xe7, 0xc7, 0xff, 0xcf, 0xe7, 0xff, 0xff, 0xcf, 0xe7, 0xe0, 0x01, 0xe7, 0xe7, 0xe7, 0xf9, 0xe7,
0xef, 0xef, 0xf9, 0xe7, 0xef, 0xef, 0xf9, 0xe7, 0xff, 0xef, 0xf9, 0xe7, 0xff, 0xe0, 0x01, 0xe7,
0xff, 0xf8, 0x01, 0xc7, 0xff, 0xef, 0xff, 0xcf, 0xff, 0xe7, 0xff, 0xcf, 0xff, 0x87, 0xff, 0x9f,
0xff, 0xc7, 0xff, 0x1f, 0xff, 0xff, 0xfe, 0x3f, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xf8, 0xff,
0xff, 0xff, 0xc1, 0xff, 0xff, 0xfe, 0x07, 0xff, 0xff, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xfc, 0x1b, 0xff, 0xff, 0xfc, 0x38, 0xff, 0xff, 0xff, 0x78, 0x7f, 0xff,
0xff, 0x78, 0x7f, 0xff, 0xff, 0x78, 0x7f, 0xff, 0xfc, 0x3c, 0x7f, 0xff, 0xfc, 0x1c, 0x7f, 0xff,
0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0xff,
0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0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0x80, 0x3f, 0xff, 0xfc, 0x00, 0x3f,
0xfc, 0x1c, 0x00, 0x3f, 0xfc, 0x1c, 0x7e, 0x3f, 0xfd, 0x7c, 0x7e, 0x3f, 0xfd, 0x3c, 0x7e, 0x3f,
0xfd, 0x1c, 0x7e, 0x3f, 0xfc, 0x1c, 0x7e, 0x3f, 0xfc, 0x5c, 0x7e, 0x3f, 0xff, 0xfc, 0x7e, 0x3f,
0xff, 0xfc, 0x7e, 0x3f, 0xff, 0xfc, 0x7e, 0x3f, 0xff, 0xfc, 0x7e, 0x3f, 0xff, 0xfc, 0x7f, 0xff,
0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xfc, 0x7f, 0xff,
0xff, 0xfc, 0x7f, 0xff, 0xfc, 0x1c, 0x7f, 0xff, 0xfc, 0x1c, 0x7f, 0xff, 0xfd, 0x58, 0x7f, 0xff,
0xfd, 0x58, 0x7f, 0xff, 0xfd, 0x58, 0xff, 0xff, 0xfd, 0xdb, 0xff, 0xff, 0xfd, 0xdf, 0xff, 0xff
};
img_data_t IMG_WOCAO = {
true,
bmp_wocao,
160,
4, // 32pix div 8bit
true
};
img_data_t IMG_TANOC = {
true,
bmp_tanoc,
160,
4, // 32pix div 8bit
true
};
size_t img_offset_at(img_data_t * image, uint16_t left, uint8_t top) {
return left * image->height_strides + top;
}
img_data_t img_invert(img_data_t * image) {
img_data_t new_data = {
image->is_progmem,
image->data,
image->width_pixels,
image->height_strides,
!image->inverse
};
return new_data;
}

11
firm/test/README Normal file
View File

@ -0,0 +1,11 @@
This directory is intended for PlatformIO Test Runner and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PlatformIO Unit Testing:
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html