update Wii EC

This commit is contained in:
VerstreuteSeele
2023-01-11 01:51:39 +01:00
parent 5eb43403eb
commit de8bdd4469
116 changed files with 3220 additions and 3885 deletions

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 BlueChip
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,234 +0,0 @@
# [FlipperZero] Wii Extension Controller Protocol Analyser
This Protocol Analyser offers a full Test and Calibrate system for Wii Extension Controllers.
__Disclaimer:__ *Use of this plugin, and notably connecting an Extension Controller to the FlipperZero is performed entirely at your own risk.*
# Notes
This plugin has (todate) only been tested with official Nintendo Nunchucks and Classic Controllers - namely Nunchucks and Classic Controllers.
# Encryption
This plugin has SOME code to handle encryption, but it it unused, untested, and some of it is known to un-work.
This plugin (currently) only works with Extension Controllers which implement the encryption-bypass strategy. IE. `i2c_write(0xf0, 0x55) ; i2c_write(0xfb, 0x00)`
If you need this functionality, either raise an Issue or, better still, a Pull Request.
# Screen: SPLASH
<img src="_images/SPLASH.png" width="256"/><br/>
The SPLASH Screen is displayed when the Plugin starts. It can be cleared by pressing any key, else it will auto-clear after 3.5 seconds.
# Screen: WAIT
<img src="_images/WAIT.png" width="256"/>&nbsp;&nbsp;&nbsp;<img src="_images/Wiring.png" width="512"/><br/><br/>
The WAIT screen will display which pins you need to connect between the flipper and the Wii Extension Controller.
__Disclaimer:__ Use of this plugin, and notably connecting the Controller to the FlipperZero is performed entirely at your own risk.
Looking in to the exposed side of the Extension Controller plug, with the notch on the bottom
| EC Pin # | EC Position | EC Pin ID | Pin Function | FZ GPIO Pin Name | FZ GPIO Pin # |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 1 | top-left | +3v3 | Power | 3v3 | 9 |
| 2 | bottom-left | SCL | i2c clock | C0 | 16 |
| 3 | top-centre | EN | ¿detect? | | |
| 4 | bottom-centre | -x- | -none- | | |
| 5 | top-right | SDA | i2c data | C1 | 15 |
| 6 | bottom-right | Gnd | Power | Gnd | 18 |
Keys:
* Left - Show splash screen
* Back - exit plugin
The easiest way to connect a Wii Extension Controller to a FlipperZero is arguably with a ["WiiChuck"](https://www.ebay.co.uk/sch/?_nkw=wiichuck) or a ["Nunchucky"](https://www.solarbotics.com/product/31040)<br/><br/>
<table style="border:none">
<tr><td><img src="_images/WiiChuck.png" width="166"/></td>
<td><img src="_images/Nunchucky.png" width="128"/></td></tr>
<tr><td align="center"><a href="https://www.ebay.co.uk/sch/?_nkw=wiichuck">WiiChuck</a></td>
<td align="center"><a href="https://www.solarbotics.com/product/31040">Nunchucky</a></td></tr>
</table>
### ** WARNING **
Neither the WiiChuck, nor the Nunchucky have a pin polarisation mechanism.<br/>
If you plug the adaptor in the wrong way around you WILL apply voltage to the Controller the wrong way round!!<br/>
I have no idea if THIS WILL PERMANENTLY KILL THE CONTROLLER ...Who wants to try it?
On all the WiiChucks I have seen:
* The WiiChuck has THREE connectors on one side, and TWO connectors on the other.
* The side with TWO connectors should go against the side of the Controller plug with the big indent.
```
+-------------+
| _________ |
| | = = = | |
| |_=_____=_| | <-- notice missing pin
| ___ |
| | | | <-- notice indent
+----+ +----+
```
<img src="_images/plug.png" width="128"/><br/>
...BUT I *highly* recommend you check the pins on your adaptor to make sure everything goes well.
I believe the unconnected pin on the top is a "presence detect" function, but I have not (yet) verified this.<br/>
This feature is NOT required by this plugin, as the detection is performed by means of an i2c handshake.
When a device is connected it will be immediately recognised. If it is not, either:
* The Controller is not correctly connected<br/>
...This may be as simple as a broken wire.
* The controller board in the Controller is faulty.<br/>
...Repair of which is beyond the scope of this document.
To get the list of "known" Controllers, run `./info.sh`<br/>
As of writing this, that returns:
```c
[PID_UNKNOWN ] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, "Unknown Perhipheral", SCENE_DUMP,
[PID_NUNCHUCK ] = { {0x00, 0x00, 0xA4, 0x20, 0x00, 0x00}, "Nunchuck", SCENE_NUNCHUCK,
[PID_CLASSIC ] = { {0x00, 0x00, 0xA4, 0x20, 0x01, 0x01}, "Classic Controller", SCENE_CLASSIC,
[PID_BALANCE ] = { {0x00, 0x00, 0xA4, 0x20, 0x04, 0x02}, "Balance Board", SCENE_DUMP,
[PID_GH_GUITAR ] = { {0x00, 0x00, 0xA4, 0x20, 0x01, 0x03}, "Guitar Hero Guitar", SCENE_DUMP,
[PID_GH_DRUMS ] = { {0x01, 0x00, 0xA4, 0x20, 0x01, 0x03}, "Guitar Hero World Tour Drums", SCENE_DUMP,
[PID_TURNTABLE ] = { {0x03, 0x00, 0xA4, 0x20, 0x01, 0x03}, "DJ Hero Turntable", SCENE_DUMP,
[PID_TAIKO_DRUMS] = { {0x00, 0x00, 0xA4, 0x20, 0x01, 0x11}, "Taiko Drum Controller)", SCENE_DUMP,
```
You can see that there are EIGHT known devices. One is the default for an unknown controller; SEVEN devices are known by name; and TWO (of those seven) have bespoke "scenes" (ie. SCENE_NUNCHUCK & SCENE_CLASSIC).
# Screen: NUNCHUCK - MAIN
<img src="_images/NUNCHUCK.png" width="256"/><br/>
When you connect a Nunchuck, you will see a screen displaying:
* Accelerometer{X,Y,Z} values
* Joystick{X,Y} values
* Joystick graphic
* Button{C,Z}
Keys:
* Left - Go to the DUMP screen
* Right - Go to the NUNCHUCK_ACC accelerometers screen
* Up/Down/OK - [qv. Peak Meters]
* Short-Back - Reset controller
* Long-Back - Exit plugin
# Screen: NUNCHUCK - ACCELEROMETERS
<img src="_images/NUNCHUCK_anal.png" width="256" align="top"/>&nbsp;&nbsp;&nbsp;<img src="_images/NUNCHUCK_acc.png" width="200"/><br/>
| Axis | Movement | Lower | Higher |
| :---: | :---: | :---: | :---: |
| X | Left / Right | Left | Right |
| Y | Fwd / Bkwd | Fwd | Bkwd |
| Z | Down / Up | Down | Up |
* Movement in the direction of an axis changes that axis reading
* Twisting/tilting around an axis changes the other two readings
* EG.
* Move left (along the X axis) will effect X
* Turn left (a rotation around the Y axis) will effect X and Z
Keys:
* Left - go to the main NUNCHUCK screen
* Up
* Auto-Pause Disabled --> Enable Auto-Pause
* Paused at the end of a page --> Restart scanner
* Running with Auto-Pause Enabled --> Disable Auto-Pause
* Nunchuck-Z - Toggle pause
* Nunchuck-C - Toggle auto-pause
* Long-OK - Enter Software Calibration mode [qv. Calibration]
* Calibration mode on the Accelerometer screen will ONLY calibrate the accelerometer
* Short-OK - Leave Software Calibration mode *and* Calibrate CENTRE position(s)
* Short-Back - Reset controller
* Long-Back - Exit plugin
<sub>NB. Code DOES exist to scroll the display, but the LCD refresh rate is too low, and it looks awful</sub>
# Screen: CLASSIC
<img src="_images/CLASSIC.png" width="256"/><img src="_images/CLASSIC_N.png" width="256"/><br/>
When you connect a Classic Controller [Pro], you will see a screen displaying a Classic Controller
* The Classic Controller will animate in line with controller events
* The scan rate is set to 30fps, but in reality there is a bit of lag with the LCD screen, so YMMV.
Keys:
* Left - go to the DUMP screen
* Right - show analogue readings (Left to hide them again)
* Up/Down/OK - [qv. Peak Meters]
* Short-Back - Reset controller
* Long-Back - Exit plugin
# Screen: DUMP
<img src="_images/DUMP.png" width="256"/><br/>
The Dump screen will show you the raw readings from the device.<br/>
If you connect a device which does not have a bespoke `_decode()` function (etc.), you will see (only) this screen.
* SID - String ID - human-readable name (from the `info` table)
* PID - Peripheral ID - The 6 bytes which identify the device.
* Cal - Calibration data - 16 bytes
* The bottom row of hex shows the SIX bytes of Controller data
* Below each hex digit is the binary representation of that digit
* By example. With a Nunchuck connected, click the Z button, and watch the bit on the far right
Keys:
* Right - return to controller-specific screen (if there is one)
* Short-Back - Reset controller
* Long-Back - Exit plugin
# Peak Meters (Calibration values)
On any Controller-specific screen with a Peak/Trough menu displayed:
* Up - [toggle] only show peak values
* Down - [toggle] only show trough values
* Long-OK - Enter Software Calibration mode [qv. Calibration]
* Short-OK - Leave Software Calibration mode / Calibrate CENTRE position(s)
# Calibration
<img src="_images/NUNCHUCK_cal.gif" width="256"/><br/>
* __This project handles Calibration of Analogue Controls, but has NO understanding of Accelerometer values (yet).__
Digital buttons do NOT require Calibration.
Some Calibration data is calculated at the factory, and stored in memory (¿OTP?) on the Controller.
Each device has a different way to interpret the Calibration Data.<br/>
EG. A Nunchuck has one joystick, and an accelerometer ...whereas a Classic Controller has 2 joysticks and 2 analogue buttons.
I have personally found the calibration data to be inaccurate (when compared to actual readings), I guess Controllers drift over the years‽
If the factory-values LIMIT movement, this is easily resolved - by expanding them on-the-fly.<br/>
BUT, I have seen Controllers with factory calibration data that suggests the limits are FURTHER than the joystick can reach ...and this requires a full re-calibration of the Controller!
Probably the best way to calibrate is to:
* Take a/some reading(s) while the Controller is 'at rest', IE. perfectly still and level.
* Move the Controller to all extremes and store the extreme {peak/trough} values.
Nintendo (allegedly) take the 'at rest' reading immediately after the Controller is connected, and a 're-calibration' can be performed at any time by pressing {`A`, `B`, `+`, `-`} at the same time, for at least 3 seconds. Although I have no details on what this actually does.
### This tool calibrates as such:
* When the Controller is first recognised
* The factory Calibration data is used to decide the Centre/Middle position and extreme values (eg. far-left & far-right) for each analogue Control
* Long-OK button press (on the FlipperZero) ...Do NOT touch ANY of the analogue controllers while you are pressing Long-OK
* Start the calibrate button flashing
* Take the current reading as the Centre position
* Set the range limits to "no range"
* You must now move the Control between its extremes, so the code can work out the new Calibration/range/peak+trough values
* When done, press Short-OK to end Software Calibration mode
* Short-OK button press (on the FlipperZero) ...Do NOT touch ANY of the analogue controllers while you are pressing Short-OK
* Stop the calibrate button flashing
* Calibrate the centre position of all analogue controls (accelerometers not supported (yet))
# Screen: DEBUG
<img src="_images/DEBUG.png" width="256"/><br/>
On any screen (except SPLASH) you may press Long-Down to enter Debug mode.
You can (at any time) attach to the FlipperZero (via USB) with a serial console {`minicom`, `putty`, whatever} and start the `log` function to see the debug messages.
When you enter the DEBUG screen, the real-time scanner will be stopped. And the following keys made available:
* Up - Attempt to initialise the attached Controller
* OK - Take a reading from the attached Controller
* Long-Down - Restart the real-time scanner and return to the WAIT screen
You can limit the messages at compile-time [see `./info.sh`], or at runtime [FZ->Settings->System->LogLevel]<br/>
[This is probably irrelevant since the introduction of FAP support]<br/>
If you have memory issues, limiting the messages at compile-time will make the plugin smaller.<br/>
But (¿obviously?) the more you limit the messsages, the less debug information will be sent to the logger.
# TODO
* FZ Bug: At the time of writing this, there are problems with the i2c FZ functions [qv `i2c_workaround.c`]

View File

@@ -1,67 +0,0 @@
,-------.
---( Files )---
`-------'
README.md - User Manual : Body [github markdown]
_images/ - User Manual : Images
_images/GIMP/ - User Manual : GIMP image masters
LICENSE - Tech Docs : MIT Licence file
README.txt - Tech Docs : Dev notes
notes.txt - Tech Docs : Random dev notes
info.sh - Tech Docs : Retrieve info from source code
application.fam - FAP : Header file
WiiEC.png - FAP : Icon {10x10}
gfx/ - Analyser : Images [generated by bc_image_tool]
wii_anal.c|h - Analyser : Main application
wii_anal_ec.c|h - Analyser : Extension controller actions
wii_anal_keys.c|h - Analyser : Keyboard handling
wii_anal_lcd.c|h - Analyser : LCD handling
i2c_workaround.h - Temporary workaround for i2c bug in FZ code
err.h - Errors
bc_logging.h - Logging macros - especially LOG_LEVEL
wii_i2c.c|h - i2c functionality
wii_ec.c|h - Extension Controller basic functions
wii_ec_macros.h - Bespoke Extension Controller handy-dandy MACROs
wii_ec_classic.c|h - EC: Classic Controller Pro scene
wii_ec_nunchuck.c|h - EC: Nunchuck scene
wii_ec_udraw.c|h - EC: UDraw scene - not written
,----------------------------------.
---( Adding a new Extension Controller )---
`----------------------------------'
//! I'll finish this when I write the UDraw code
Create a new Extension Controller called "mydev"
Create wii_ec_mydev.c and wii_ec_mydev.h
In wii_ec_mydev.c|h
Create the functions [& prototypes]
bool mydev_init (wiiEC_t* const) ; // Additional initialisation code
void mydev_decode (wiiEC_t* const) ; // Decode controller input data
void mydev_msg (wiiEC_t* const, FuriMessageQueue* const) ; // Put event messages in the event queue
void mydev_calib (wiiEC_t* const, ecCalib_t) ; // Controller calibration function
void mydev_show (Canvas* const, state_t* const) ; // Scene LCD display
bool mydev_key (const eventMsg_t* const, state_t* const) ; // Scene key controls
In wii_ec.h
Include the new header
#include "wii_ec_mydev.h"
Add a perhipheral id to enum ecPid
PID_MYDEV
In wii_anal.h
As a scene name to enum scene
SCENE_MYDEV
In wii_ec.c
Add the device definition to the ecId[] array
[PID_MYDEV] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, "My Device", SCENE_MYDEV,
mydev_init, mydev_decode, mydev_msg, mydev_calib, mydev_show, mydev_key },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

View File

@@ -3,7 +3,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
int main(int argc, char* argv[]) { int main (int argc, char* argv[])
{
const unsigned char* pp = NULL; const unsigned char* pp = NULL;
uint32_t pix = 0; uint32_t pix = 0;
int bit = 0; int bit = 0;
@@ -35,30 +36,30 @@ int main(int argc, char* argv[]) {
int rv = 0; // assume success int rv = 0; // assume success
// allocate buffers // allocate buffers
blen = ((img.w * img.h) + 0x7) >> 3; blen = ((img.w * img.h) +0x7) >>3;
bp = (buf = calloc(blen + 1, 1)); bp = (buf = calloc(blen +1, 1));
cp = (cmp = calloc(blen + 4, 1)); cp = (cmp = calloc(blen +4, 1));
// sanity check // sanity check
if(!fh || !buf || !cmp) { if (!fh || !buf || !cmp) {
printf("! fopen() or malloc() fail.\n"); printf("! fopen() or malloc() fail.\n");
rv = 255; rv = 255;
goto bail; goto bail;
} }
// Find white value // Find white value
for(x = 1; x < img.bpp; x++) white = (white << 8) | 0xFF; for (x = 1; x < img.bpp; x++)
white = (white << 8) | 0xFF ;
// build bit pattern // build bit pattern
// create the comment as we go // create the comment as we go
for(pp = img.b, y = 0; y < img.h; y++) { for (pp = img.b, y = 0; y < img.h; y++) {
fprintf(fh, "// "); fprintf(fh, "// ");
for(x = 0; x < img.w; x++) { for (x = 0; x < img.w; x++) {
// read pixel // read pixel
for(pix = 0, z = 0; z < img.bpp; pix = (pix << 8) | *pp++, z++) for (pix = 0, z = 0; z < img.bpp; pix = (pix << 8) | *pp++, z++) ;
;
// get bit and draw // get bit and draw
if(pix < white) { if (pix < white) {
b = (b << 1) | 1; b = (b << 1) | 1;
fprintf(fh, "##"); fprintf(fh, "##");
} else { } else {
@@ -66,7 +67,7 @@ int main(int argc, char* argv[]) {
fprintf(fh, ".."); fprintf(fh, "..");
} }
// got byte // got byte
if((++bcnt) == 8) { if ((++bcnt) == 8) {
*bp++ = b; *bp++ = b;
tag[b]++; tag[b]++;
bcnt = (b = 0); bcnt = (b = 0);
@@ -76,7 +77,7 @@ int main(int argc, char* argv[]) {
} }
fprintf(fh, "\n"); fprintf(fh, "\n");
// padding // padding
if(bcnt) { if (bcnt) {
b <<= (bcnt = 8 - bcnt); b <<= (bcnt = 8 - bcnt);
*bp++ = b; *bp++ = b;
tag[b]++; tag[b]++;
@@ -86,25 +87,23 @@ int main(int argc, char* argv[]) {
// Byte run length compression // Byte run length compression
// Find a good tag // Find a good tag
for(x = 0; tmax && (x < 256); x++) { for (x = 0; tmax && (x < 256); x++) {
if(tag[x] < tmax) { if (tag[x] < tmax) {
tmax = tag[x]; tmax = tag[x];
ctag = x; ctag = x;
} }
} }
// compress the data // compress the data
for(bp = buf, x = 0; (clen < blen) && (x < blen); x++) { for (bp = buf, x = 0; (clen < blen) && (x < blen); x++) {
// need at least 4 the same to be worth it // need at least 4 the same to be worth it
// must compress tag (if it occurs) // must compress tag (if it occurs)
if((bp[x] == bp[x + 1]) && (bp[x] == bp[x + 2]) && (bp[x] == bp[x + 3]) || if ((bp[x] == bp[x+1]) && (bp[x] == bp[x+2]) && (bp[x] == bp[x+3]) || (bp[x] == ctag)) {
(bp[x] == ctag)) { for (y = 1; (y < 255) && (bp[x] == bp[x+y]); y++) ;
for(y = 1; (y < 255) && (bp[x] == bp[x + y]); y++)
;
*cp++ = ctag; // tag *cp++ = ctag; // tag
*cp++ = y; // length *cp++ = y; // length
*cp++ = bp[x]; // byte *cp++ = bp[x]; // byte
x += y - 1; x += y -1;
clen += 3; clen += 3;
} else { } else {
*cp++ = bp[x]; *cp++ = bp[x];
@@ -116,33 +115,24 @@ int main(int argc, char* argv[]) {
fprintf(fh, "#include \"images.h\"\n\n"); fprintf(fh, "#include \"images.h\"\n\n");
fprintf(fh, "const image_t img_%s = { %d, %d, ", name, img.w, img.h); fprintf(fh, "const image_t img_%s = { %d, %d, ", name, img.w, img.h);
if(clen < blen) { // dump compressed? if (clen < blen) { // dump compressed?
fprintf( fprintf(fh, "true, %d, 0x%02X, { // orig:%d, comp:%.2f%%\n\t",
fh, clen, ctag, blen, 100.0-((clen*100.0)/blen));
"true, %d, 0x%02X, { // orig:%d, comp:%.2f%%\n\t", for (x = 0; x < clen; x++)
clen, if (x == clen -1) fprintf(fh, "0x%02X\n}};\n", cmp[x]) ;
ctag, else fprintf(fh, "0x%02X%s", cmp[x], (!((x+1)%16)) ? ",\n\t" : ", ") ;
blen,
100.0 - ((clen * 100.0) / blen));
for(x = 0; x < clen; x++)
if(x == clen - 1)
fprintf(fh, "0x%02X\n}};\n", cmp[x]);
else
fprintf(fh, "0x%02X%s", cmp[x], (!((x + 1) % 16)) ? ",\n\t" : ", ");
} else { // dump UNcompressed } else { // dump UNcompressed
fprintf(fh, "false, %d, 0, {\n\t", blen); fprintf(fh, "false, %d, 0, {\n\t", blen);
for(x = 0; x < blen; x++) for (x = 0; x < blen; x++)
if(x == blen - 1) if (x == blen -1) fprintf(fh, "0x%02X\n}};\n", buf[x]) ;
fprintf(fh, "0x%02X\n}};\n", buf[x]); else fprintf(fh, "0x%02X%s", buf[x], (!((x+1)%16)) ? ",\n\t" : ", ") ;
else
fprintf(fh, "0x%02X%s", buf[x], (!((x + 1) % 16)) ? ",\n\t" : ", ");
} }
bail: bail:
if(fh) fclose(fh); if (fh) fclose(fh) ;
if(buf) free(buf); if (buf) free(buf) ;
if(cmp) free(cmp); if (cmp) free(cmp) ;
return rv; return rv;
} }

View File

@@ -17,32 +17,38 @@ static Color _set;
static Color _clr; static Color _clr;
//+============================================================================ //+============================================================================
static void _showByteSet(const uint8_t b) { static
for(uint8_t m = 0x80; m; m >>= 1) { void _showByteSet (const uint8_t b)
if(b & m) // plot only SET bits {
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y)); for (uint8_t m = 0x80; m; m >>= 1) {
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break; if (b & m) // plot only SET bits
canvas_draw_dot(_canvas, (_tlx +_x), (_tly +_y)) ;
if ( ((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h) ) break ;
} }
} }
//+============================================================================ //+============================================================================
static void _showByteClr(const uint8_t b) { static
for(uint8_t m = 0x80; m; m >>= 1) { void _showByteClr (const uint8_t b)
if(!(b & m)) // plot only CLR bits {
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y)); for (uint8_t m = 0x80; m; m >>= 1) {
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break; if (!(b & m)) // plot only CLR bits
canvas_draw_dot(_canvas, (_tlx +_x), (_tly +_y)) ;
if ( ((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h) ) break ;
} }
} }
//+============================================================================ //+============================================================================
static void _showByteAll(const uint8_t b) { static
for(uint8_t m = 0x80; m; m >>= 1) { void _showByteAll (const uint8_t b)
if((!!(b & m)) ^ _blk) { // Change colour only when required {
for (uint8_t m = 0x80; m; m >>= 1) {
if ((!!(b & m)) ^ _blk) { // Change colour only when required
canvas_set_color(_canvas, ((b & m) ? _set : _clr)); canvas_set_color(_canvas, ((b & m) ? _set : _clr));
_blk = !_blk; _blk = !_blk;
} }
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y)); canvas_draw_dot(_canvas, (_tlx +_x), (_tly +_y)) ;
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break; if ( ((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h) ) break ;
} }
} }
@@ -55,18 +61,15 @@ static void _showByteAll(const uint8_t b) {
// SHOW_ALL - plot all images pixels as they are // SHOW_ALL - plot all images pixels as they are
// SHOW_ALL_INV - plot all images pixels inverted // SHOW_ALL_INV - plot all images pixels inverted
// //
void show( void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
Canvas* const canvas, const image_t* img, const showMode_t mode)
const uint8_t tlx, {
const uint8_t tly, void(*fnShow)(const uint8_t) = NULL;
const image_t* img,
const showMode_t mode) {
void (*fnShow)(const uint8_t) = NULL;
const uint8_t* bp = img->data; const uint8_t* bp = img->data;
// code size optimisation // code size optimisation
switch(mode & SHOW_INV_) { switch (mode & SHOW_INV_) {
case SHOW_NRM_: case SHOW_NRM_:
_set = ColorBlack; _set = ColorBlack;
_clr = ColorWhite; _clr = ColorWhite;
@@ -84,8 +87,9 @@ void show(
case SHOW_WHT_: case SHOW_WHT_:
canvas_set_color(canvas, ColorWhite); canvas_set_color(canvas, ColorWhite);
break; break;
} }
switch(mode & SHOW_INV_) { switch (mode & SHOW_INV_) {
case SHOW_NRM_: case SHOW_NRM_:
case SHOW_INV_: case SHOW_INV_:
fnShow = _showByteAll; fnShow = _showByteAll;
@@ -95,7 +99,7 @@ void show(
case SHOW_BLK_: case SHOW_BLK_:
case SHOW_WHT_: case SHOW_WHT_:
switch(mode & SHOW_ALL_) { switch (mode & SHOW_ALL_) {
case SHOW_SET_: case SHOW_SET_:
fnShow = _showByteSet; fnShow = _showByteSet;
break; break;
@@ -116,13 +120,13 @@ void show(
_y = 0; _y = 0;
// Compressed // Compressed
if(img->c) { if (img->c) {
for(unsigned int i = 0; i < img->len; i++, bp++) { for (unsigned int i = 0; i < img->len; i++, bp++) {
// Compressed data? {tag, length, value} // Compressed data? {tag, length, value}
if(*bp == img->tag) { if (*bp == img->tag) {
for(uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]); for (uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]) ;
bp += 3 - 1; bp += 3 -1;
i += 3 - 1; i += 3 -1;
// Uncompressed byte // Uncompressed byte
} else { } else {
@@ -132,6 +136,6 @@ void show(
// Not compressed // Not compressed
} else { } else {
for(unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp); for (unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp) ;
} }
} }

View File

@@ -5,7 +5,8 @@
#include <stdbool.h> #include <stdbool.h>
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
typedef enum showMode { typedef
enum showMode {
// {INV:--:WHT:BLK::--:--:CLR:SET} // {INV:--:WHT:BLK::--:--:CLR:SET}
SHOW_SET_ = 0x01, SHOW_SET_ = 0x01,
SHOW_CLR_ = 0x02, SHOW_CLR_ = 0x02,
@@ -24,30 +25,29 @@ typedef enum showMode {
SHOW_ALL = SHOW_ALL_ | SHOW_NRM_, SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_, SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
} showMode_t; }
showMode_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
typedef struct image { typedef
struct image {
uint8_t w; // width uint8_t w; // width
uint8_t h; // height uint8_t h; // height
bool c; // compressed? bool c; // compressed?
uint16_t len; // image data length uint16_t len; // image data length
uint8_t tag; // rle tag uint8_t tag; // rle tag
uint8_t data[]; // image data uint8_t data[]; // image data
} image_t; }
image_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
//[TAG] //[TAG]
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
#ifndef IMGTEST #ifndef IMGTEST
#include <gui/gui.h> # include <gui/gui.h>
void show( void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
Canvas* const canvas, const image_t* img, const showMode_t mode) ;
const uint8_t tlx,
const uint8_t tly,
const image_t* img,
const showMode_t mode);
#endif #endif
#endif //IMAGES_H_ #endif //IMAGES_H_

View File

@@ -6,37 +6,36 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// This will be the plot function out of your graphics library // This will be the plot function out of your graphics library
// //
#define PLOT(x, y, c) \ #define PLOT(x,y,c) do { \
do { \
printf("%s", (c ? "#" : ".")); \ printf("%s", (c ? "#" : ".")); \
if(x == img->w - 1) printf("\n"); \ if (x == img->w -1) printf("\n") ; \
} while(0) }while(0)
//+============================================================================ //+============================================================================
// The pain we endure to avoid code duplication cleanly // The pain we endure to avoid code duplication cleanly
// //
#define PLOTBYTE(b) \ #define PLOTBYTE(b) do { \
do { \ for (uint8_t m = 0x80; m; m>>=1) { \
for(uint8_t m = 0x80; m; m >>= 1) { \ PLOT(x,y, (b & m)); \
PLOT(x, y, (b & m)); \ if ( ((++x) == img->w) && !(x = 0) && ((++y) == img->h) ) break ; \
if(((++x) == img->w) && !(x = 0) && ((++y) == img->h)) break; \
} \ } \
} while(0) }while(0)
void show(const image_t* img) { void show (const image_t* img)
{
// Some variables // Some variables
const uint8_t* bp = img->data; const uint8_t* bp = img->data;
unsigned int x = 0; unsigned int x = 0;
unsigned int y = 0; unsigned int y = 0;
// Compressed // Compressed
if(img->c) { if (img->c) {
for(unsigned int i = 0; i < img->len; i++, bp++) { for (unsigned int i = 0; i < img->len; i++, bp++) {
// Compressed data? {tag, length, value} // Compressed data? {tag, length, value}
if(*bp == img->tag) { if (*bp == img->tag) {
for(uint16_t c = 0; c < bp[1]; c++) PLOTBYTE(bp[2]); for (uint16_t c = 0; c < bp[1]; c++) PLOTBYTE(bp[2]) ;
bp += 3 - 1; bp += 3 -1;
i += 3 - 1; i += 3 -1;
// Uncompressed byte // Uncompressed byte
} else { } else {
@@ -46,14 +45,15 @@ void show(const image_t* img) {
// Not compressed // Not compressed
} else { } else {
for(unsigned int i = 0; i < img->len; i++, bp++) PLOTBYTE(*bp); for (unsigned int i = 0; i < img->len; i++, bp++) PLOTBYTE(*bp) ;
} }
} }
#undef PLOTBYTE #undef PLOTBYTE
//+============================================================================ //+============================================================================
int main(void) { int main (void)
{
show(&img_zzz); show(&img_zzz);
return 0; return 0;
} }

View File

@@ -2,7 +2,7 @@
App( App(
# --- App Info # --- App Info
appid="Wii_EC_Analyser", appid="wii_ec_anal",
name="Wii EC Analyser", name="Wii EC Analyser",
# --- Entry point # --- Entry point
@@ -32,5 +32,5 @@ App(
# fap_version=(1,0), # fap_version=(1,0),
fap_icon="WiiEC.png", fap_icon="WiiEC.png",
fap_category="Misc", fap_category="Cyborg Systems",
) )

View File

@@ -27,42 +27,42 @@
// The FlipperZero Settings->System menu allows you to set the logging level at RUN-time // The FlipperZero Settings->System menu allows you to set the logging level at RUN-time
// This lets you limit it at COMPILE-time // This lets you limit it at COMPILE-time
#ifndef LOG_LEVEL #ifndef LOG_LEVEL
#define LOG_LEVEL 6 // default = full logging # define LOG_LEVEL 6 // default = full logging
#endif #endif
#if(LOG_LEVEL < 2) #if (LOG_LEVEL < 2)
#undef FURI_LOG_E # undef FURI_LOG_E
#define FURI_LOG_E(tag, fmt, ...) # define FURI_LOG_E(tag, fmt, ...)
#endif #endif
#if(LOG_LEVEL < 3) #if (LOG_LEVEL < 3)
#undef FURI_LOG_W # undef FURI_LOG_W
#define FURI_LOG_W(tag, fmt, ...) # define FURI_LOG_W(tag, fmt, ...)
#endif #endif
#if(LOG_LEVEL < 4) #if (LOG_LEVEL < 4)
#undef FURI_LOG_I # undef FURI_LOG_I
#define FURI_LOG_I(tag, fmt, ...) # define FURI_LOG_I(tag, fmt, ...)
#endif #endif
#if(LOG_LEVEL < 5) #if (LOG_LEVEL < 5)
#undef FURI_LOG_D # undef FURI_LOG_D
#define FURI_LOG_D(tag, fmt, ...) # define FURI_LOG_D(tag, fmt, ...)
#endif #endif
#if(LOG_LEVEL < 6) #if (LOG_LEVEL < 6)
#undef FURI_LOG_T # undef FURI_LOG_T
#define FURI_LOG_T(tag, fmt, ...) # define FURI_LOG_T(tag, fmt, ...)
#endif #endif
//---------------------------------------------------------- //----------------------------------------------------------
// Logging helper macros // Logging helper macros
// //
#define ERROR(fmt, ...) FURI_LOG_E(appName, fmt __VA_OPT__(, ) __VA_ARGS__) #define ERROR(fmt, ...) FURI_LOG_E(appName, fmt __VA_OPT__(,) __VA_ARGS__)
#define WARN(fmt, ...) FURI_LOG_W(appName, fmt __VA_OPT__(, ) __VA_ARGS__) #define WARN(fmt, ...) FURI_LOG_W(appName, fmt __VA_OPT__(,) __VA_ARGS__)
#define INFO(fmt, ...) FURI_LOG_I(appName, fmt __VA_OPT__(, ) __VA_ARGS__) #define INFO(fmt, ...) FURI_LOG_I(appName, fmt __VA_OPT__(,) __VA_ARGS__)
#define DEBUG(fmt, ...) FURI_LOG_D(appName, fmt __VA_OPT__(, ) __VA_ARGS__) #define DEBUG(fmt, ...) FURI_LOG_D(appName, fmt __VA_OPT__(,) __VA_ARGS__)
#define TRACE(fmt, ...) FURI_LOG_T(appName, fmt __VA_OPT__(, ) __VA_ARGS__) #define TRACE(fmt, ...) FURI_LOG_T(appName, fmt __VA_OPT__(,) __VA_ARGS__)
#define ENTER TRACE("(+) %s", __func__) #define ENTER TRACE("(+) %s", __func__)
#define LEAVE TRACE("(-) %s", __func__) #define LEAVE TRACE("(-) %s", __func__)

View File

@@ -15,53 +15,50 @@ static const char* const appName = "Wii_i2c"; //$ Name used in log files
// ...Watch out for extraneous whitespace after the terminating backslashes // ...Watch out for extraneous whitespace after the terminating backslashes
#define FOREACH_ES(esPrial) \ #define FOREACH_ES(esPrial) \
/* The first line MUST define 'ERR_OK = 0' */ \ /* The first line MUST define 'ERR_OK = 0' */ \
esPrial(0, ERR_OK, "OK (no error)") \ esPrial( 0, ERR_OK , "OK (no error)") \
\ \
esPrial(1, ERR_MALLOC_QUEUE, "malloc() fail - queue") esPrial( \ esPrial( 1, ERR_MALLOC_QUEUE , "malloc() fail - queue") \
2, \ esPrial( 2, ERR_MALLOC_STATE , "malloc() fail - state") \
ERR_MALLOC_STATE, \ esPrial( 3, ERR_MALLOC_TEXT , "malloc() fail - text") \
"malloc() fail - state") esPrial(3, ERR_MALLOC_TEXT, "malloc() fail - text") \ esPrial( 4, ERR_MALLOC_VIEW , "malloc() fail - viewport") \
esPrial(4, ERR_MALLOC_VIEW, "malloc() fail - viewport") esPrial( \ esPrial( 5, ERR_NO_MUTEX , "Cannot create mutex") \
5, ERR_NO_MUTEX, "Cannot create mutex") esPrial(6, ERR_NO_GUI, "Cannot open GUI") \ esPrial( 6, ERR_NO_GUI , "Cannot open GUI") \
esPrial(7, ERR_NO_TIMER, "Cannot create timer") esPrial( \ esPrial( 7, ERR_NO_TIMER , "Cannot create timer") \
8, ERR_NO_NOTIFY, "Cannot acquire notifications handle") \ esPrial( 8, ERR_NO_NOTIFY , "Cannot acquire notifications handle") \
\ \
esPrial(10, ERR_MUTEX_BLOCK, "Mutex block failed") esPrial( \ esPrial(10, ERR_MUTEX_BLOCK , "Mutex block failed") \
11, ERR_MUTEX_RELEASE, "Mutex release failed") \ esPrial(11, ERR_MUTEX_RELEASE , "Mutex release failed") \
\ \
esPrial(20, ERR_QUEUE_RTOS, "queue - Undefined RTOS error") \ esPrial(20, ERR_QUEUE_RTOS , "queue - Undefined RTOS error") \
esPrial(21, DEBUG_QUEUE_TIMEOUT, "queue - Timeout") esPrial( \ esPrial(21, DEBUG_QUEUE_TIMEOUT, "queue - Timeout") \
22, ERR_QUEUE_RESOURCE, "queue - Resource not available") \ esPrial(22, ERR_QUEUE_RESOURCE , "queue - Resource not available") \
esPrial(23, ERR_QUEUE_BADPRM, "queue - Bad parameter") esPrial( \ esPrial(23, ERR_QUEUE_BADPRM , "queue - Bad parameter") \
24, ERR_QUEUE_NOMEM, "queue - Out of memory") \ esPrial(24, ERR_QUEUE_NOMEM , "queue - Out of memory") \
esPrial(25, ERR_QUEUE_ISR, "queue - Banned in ISR") esPrial( \ esPrial(25, ERR_QUEUE_ISR , "queue - Banned in ISR") \
26, ERR_QUEUE_UNK, "queue - Unknown") \ esPrial(26, ERR_QUEUE_UNK , "queue - Unknown") \
\ \
esPrial(30, WARN_SCAN_START, "Scan - Already started") \ esPrial(30, WARN_SCAN_START , "Scan - Already started") \
esPrial(31, WARN_SCAN_STOP, "Scan - Already stopped") \ esPrial(31, WARN_SCAN_STOP , "Scan - Already stopped") \
esPrial( \ esPrial(32, ERR_TIMER_START , "Scan - Cannot start timer") \
32, \ esPrial(33, ERR_TIMER_STOP , "Scan - Cannot stop timer") \
ERR_TIMER_START, \ //[EOT]
"Scan - Cannot start timer") \
esPrial( \
33, \
ERR_TIMER_STOP, \
"Scan - Cannot stop timer") //[EOT]
// Declare list extraction macros // Declare list extraction macros
#define ES_ENUM(num, ename, string) ename = num, #define ES_ENUM(num, ename, string) ename = num,
#define ES_STRING(num, ename, string) string "\r\n", #define ES_STRING(num, ename, string) string"\r\n",
// Build the enum // Build the enum
typedef enum err { FOREACH_ES(ES_ENUM) } err_t; typedef
enum err { FOREACH_ES(ES_ENUM) }
err_t ;
// You need to '#define ERR_C_' in precisely ONE source file // You need to '#define ERR_C_' in precisely ONE source file
#ifdef ERR_C_ #ifdef ERR_C_
// Build the string list // Build the string list
const char* const wii_errs[] = {FOREACH_ES(ES_STRING)}; const char* const wii_errs[] = { FOREACH_ES(ES_STRING) };
#else #else
// Give access to string list // Give access to string list
extern const char* const wii_errs[]; extern const char* const wii_errs[];
#endif #endif
// This is a header file, clean up // This is a header file, clean up

View File

@@ -17,32 +17,38 @@ static Color _set;
static Color _clr; static Color _clr;
//+============================================================================ //+============================================================================
static void _showByteSet(const uint8_t b) { static
for(uint8_t m = 0x80; m; m >>= 1) { void _showByteSet (const uint8_t b)
if(b & m) // plot only SET bits {
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y)); for (uint8_t m = 0x80; m; m >>= 1) {
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break; if (b & m) // plot only SET bits
canvas_draw_dot(_canvas, (_tlx +_x), (_tly +_y)) ;
if ( ((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h) ) break ;
} }
} }
//+============================================================================ //+============================================================================
static void _showByteClr(const uint8_t b) { static
for(uint8_t m = 0x80; m; m >>= 1) { void _showByteClr (const uint8_t b)
if(!(b & m)) // plot only CLR bits {
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y)); for (uint8_t m = 0x80; m; m >>= 1) {
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break; if (!(b & m)) // plot only CLR bits
canvas_draw_dot(_canvas, (_tlx +_x), (_tly +_y)) ;
if ( ((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h) ) break ;
} }
} }
//+============================================================================ //+============================================================================
static void _showByteAll(const uint8_t b) { static
for(uint8_t m = 0x80; m; m >>= 1) { void _showByteAll (const uint8_t b)
if((!!(b & m)) ^ _blk) { // Change colour only when required {
for (uint8_t m = 0x80; m; m >>= 1) {
if ((!!(b & m)) ^ _blk) { // Change colour only when required
canvas_set_color(_canvas, ((b & m) ? _set : _clr)); canvas_set_color(_canvas, ((b & m) ? _set : _clr));
_blk = !_blk; _blk = !_blk;
} }
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y)); canvas_draw_dot(_canvas, (_tlx +_x), (_tly +_y)) ;
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break; if ( ((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h) ) break ;
} }
} }
@@ -55,18 +61,15 @@ static void _showByteAll(const uint8_t b) {
// SHOW_ALL - plot all images pixels as they are // SHOW_ALL - plot all images pixels as they are
// SHOW_ALL_INV - plot all images pixels inverted // SHOW_ALL_INV - plot all images pixels inverted
// //
void show( void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
Canvas* const canvas, const image_t* img, const showMode_t mode)
const uint8_t tlx, {
const uint8_t tly, void(*fnShow)(const uint8_t) = NULL;
const image_t* img,
const showMode_t mode) {
void (*fnShow)(const uint8_t) = NULL;
const uint8_t* bp = img->data; const uint8_t* bp = img->data;
// code size optimisation // code size optimisation
switch(mode & SHOW_INV_) { switch (mode & SHOW_INV_) {
case SHOW_NRM_: case SHOW_NRM_:
_set = ColorBlack; _set = ColorBlack;
_clr = ColorWhite; _clr = ColorWhite;
@@ -84,8 +87,9 @@ void show(
case SHOW_WHT_: case SHOW_WHT_:
canvas_set_color(canvas, ColorWhite); canvas_set_color(canvas, ColorWhite);
break; break;
} }
switch(mode & SHOW_INV_) { switch (mode & SHOW_INV_) {
case SHOW_NRM_: case SHOW_NRM_:
case SHOW_INV_: case SHOW_INV_:
fnShow = _showByteAll; fnShow = _showByteAll;
@@ -95,7 +99,7 @@ void show(
case SHOW_BLK_: case SHOW_BLK_:
case SHOW_WHT_: case SHOW_WHT_:
switch(mode & SHOW_ALL_) { switch (mode & SHOW_ALL_) {
case SHOW_SET_: case SHOW_SET_:
fnShow = _showByteSet; fnShow = _showByteSet;
break; break;
@@ -116,13 +120,13 @@ void show(
_y = 0; _y = 0;
// Compressed // Compressed
if(img->c) { if (img->c) {
for(unsigned int i = 0; i < img->len; i++, bp++) { for (unsigned int i = 0; i < img->len; i++, bp++) {
// Compressed data? {tag, length, value} // Compressed data? {tag, length, value}
if(*bp == img->tag) { if (*bp == img->tag) {
for(uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]); for (uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]) ;
bp += 3 - 1; bp += 3 -1;
i += 3 - 1; i += 3 -1;
// Uncompressed byte // Uncompressed byte
} else { } else {
@@ -132,6 +136,6 @@ void show(
// Not compressed // Not compressed
} else { } else {
for(unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp); for (unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp) ;
} }
} }

View File

@@ -5,7 +5,8 @@
#include <stdbool.h> #include <stdbool.h>
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
typedef enum showMode { typedef
enum showMode {
// {INV:--:WHT:BLK::--:--:CLR:SET} // {INV:--:WHT:BLK::--:--:CLR:SET}
SHOW_SET_ = 0x01, SHOW_SET_ = 0x01,
SHOW_CLR_ = 0x02, SHOW_CLR_ = 0x02,
@@ -24,17 +25,20 @@ typedef enum showMode {
SHOW_ALL = SHOW_ALL_ | SHOW_NRM_, SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_, SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
} showMode_t; }
showMode_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
typedef struct image { typedef
struct image {
uint8_t w; // width uint8_t w; // width
uint8_t h; // height uint8_t h; // height
bool c; // compressed? bool c; // compressed?
uint16_t len; // image data length uint16_t len; // image data length
uint8_t tag; // rle tag uint8_t tag; // rle tag
uint8_t data[]; // image data uint8_t data[]; // image data
} image_t; }
image_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
//[TAG] //[TAG]
@@ -122,13 +126,9 @@ extern const image_t img_6x8_D;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
#ifndef IMGTEST #ifndef IMGTEST
#include <gui/gui.h> # include <gui/gui.h>
void show( void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
Canvas* const canvas, const image_t* img, const showMode_t mode) ;
const uint8_t tlx,
const uint8_t tly,
const image_t* img,
const showMode_t mode);
#endif #endif
#endif //IMAGES_H_ #endif //IMAGES_H_

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_0 = {3, 5, false, 2, 0, {0xF6, 0xDE}}; const image_t img_3x5_0 = { 3, 5, false, 2, 0, {
0xF6, 0xDE
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_1 = {3, 5, false, 2, 0, {0xC9, 0x2E}}; const image_t img_3x5_1 = { 3, 5, false, 2, 0, {
0xC9, 0x2E
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_2 = {3, 5, false, 2, 0, {0xE7, 0xCE}}; const image_t img_3x5_2 = { 3, 5, false, 2, 0, {
0xE7, 0xCE
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_3 = {3, 5, false, 2, 0, {0xE5, 0x9E}}; const image_t img_3x5_3 = { 3, 5, false, 2, 0, {
0xE5, 0x9E
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_4 = {3, 5, false, 2, 0, {0x97, 0x92}}; const image_t img_3x5_4 = { 3, 5, false, 2, 0, {
0x97, 0x92
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_5 = {3, 5, false, 2, 0, {0xF3, 0x9E}}; const image_t img_3x5_5 = { 3, 5, false, 2, 0, {
0xF3, 0x9E
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_6 = {3, 5, false, 2, 0, {0xD3, 0xDE}}; const image_t img_3x5_6 = { 3, 5, false, 2, 0, {
0xD3, 0xDE
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_7 = {3, 5, false, 2, 0, {0xE5, 0x24}}; const image_t img_3x5_7 = { 3, 5, false, 2, 0, {
0xE5, 0x24
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_8 = {3, 5, false, 2, 0, {0xF7, 0xDE}}; const image_t img_3x5_8 = { 3, 5, false, 2, 0, {
0xF7, 0xDE
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_9 = {3, 5, false, 2, 0, {0xF7, 0x96}}; const image_t img_3x5_9 = { 3, 5, false, 2, 0, {
0xF7, 0x96
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_3x5_v = {3, 5, false, 2, 0, {0x02, 0xD4}}; const image_t img_3x5_v = { 3, 5, false, 2, 0, {
0x02, 0xD4
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_0 = {5, 7, false, 5, 0, {0x74, 0x67, 0x5C, 0xC5, 0xC0}}; const image_t img_5x7_0 = { 5, 7, false, 5, 0, {
0x74, 0x67, 0x5C, 0xC5, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_1 = {5, 7, false, 5, 0, {0x65, 0x08, 0x42, 0x13, 0xE0}}; const image_t img_5x7_1 = { 5, 7, false, 5, 0, {
0x65, 0x08, 0x42, 0x13, 0xE0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_2 = {5, 7, false, 5, 0, {0x74, 0x42, 0x22, 0x23, 0xE0}}; const image_t img_5x7_2 = { 5, 7, false, 5, 0, {
0x74, 0x42, 0x22, 0x23, 0xE0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_3 = {5, 7, false, 5, 0, {0x74, 0x42, 0x60, 0xC5, 0xC0}}; const image_t img_5x7_3 = { 5, 7, false, 5, 0, {
0x74, 0x42, 0x60, 0xC5, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_4 = {5, 7, false, 5, 0, {0x84, 0x25, 0x2F, 0x88, 0x40}}; const image_t img_5x7_4 = { 5, 7, false, 5, 0, {
0x84, 0x25, 0x2F, 0x88, 0x40
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_5 = {5, 7, false, 5, 0, {0xFC, 0x21, 0xE0, 0x87, 0xC0}}; const image_t img_5x7_5 = { 5, 7, false, 5, 0, {
0xFC, 0x21, 0xE0, 0x87, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_6 = {5, 7, false, 5, 0, {0x74, 0x21, 0xE8, 0xC5, 0xC0}}; const image_t img_5x7_6 = { 5, 7, false, 5, 0, {
0x74, 0x21, 0xE8, 0xC5, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_7 = {5, 7, false, 5, 0, {0xF8, 0x44, 0x22, 0x10, 0x80}}; const image_t img_5x7_7 = { 5, 7, false, 5, 0, {
0xF8, 0x44, 0x22, 0x10, 0x80
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_8 = {5, 7, false, 5, 0, {0x74, 0x62, 0xE8, 0xC5, 0xC0}}; const image_t img_5x7_8 = { 5, 7, false, 5, 0, {
0x74, 0x62, 0xE8, 0xC5, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_9 = {5, 7, false, 5, 0, {0x74, 0x62, 0xF0, 0x85, 0xC0}}; const image_t img_5x7_9 = { 5, 7, false, 5, 0, {
0x74, 0x62, 0xF0, 0x85, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_A = {5, 7, false, 5, 0, {0x74, 0x63, 0xF8, 0xC6, 0x20}}; const image_t img_5x7_A = { 5, 7, false, 5, 0, {
0x74, 0x63, 0xF8, 0xC6, 0x20
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_B = {5, 7, false, 5, 0, {0xF4, 0x63, 0x68, 0xC7, 0xC0}}; const image_t img_5x7_B = { 5, 7, false, 5, 0, {
0xF4, 0x63, 0x68, 0xC7, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_C = {5, 7, false, 5, 0, {0x74, 0x61, 0x08, 0x45, 0xC0}}; const image_t img_5x7_C = { 5, 7, false, 5, 0, {
0x74, 0x61, 0x08, 0x45, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_D = {5, 7, false, 5, 0, {0x75, 0x4A, 0x52, 0xD5, 0xC0}}; const image_t img_5x7_D = { 5, 7, false, 5, 0, {
0x75, 0x4A, 0x52, 0xD5, 0xC0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_E = {5, 7, false, 5, 0, {0xFC, 0x21, 0xC8, 0x43, 0xE0}}; const image_t img_5x7_E = { 5, 7, false, 5, 0, {
0xFC, 0x21, 0xC8, 0x43, 0xE0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_5x7_F = {5, 7, false, 5, 0, {0xFC, 0x21, 0xC8, 0x42, 0x00}}; const image_t img_5x7_F = { 5, 7, false, 5, 0, {
0xFC, 0x21, 0xC8, 0x42, 0x00
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_0 = {6, 8, false, 6, 0, {0x7B, 0xFC, 0xF3, 0xCF, 0x3F, 0xDE}}; const image_t img_6x8_0 = { 6, 8, false, 6, 0, {
0x7B, 0xFC, 0xF3, 0xCF, 0x3F, 0xDE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_1 = {6, 8, false, 6, 0, {0x73, 0xC3, 0x0C, 0x30, 0xCF, 0xFF}}; const image_t img_6x8_1 = { 6, 8, false, 6, 0, {
0x73, 0xC3, 0x0C, 0x30, 0xCF, 0xFF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_2 = {6, 8, false, 6, 0, {0x7B, 0xF0, 0xC7, 0x31, 0x8F, 0xFF}}; const image_t img_6x8_2 = { 6, 8, false, 6, 0, {
0x7B, 0xF0, 0xC7, 0x31, 0x8F, 0xFF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_3 = {6, 8, false, 6, 0, {0x7B, 0xF0, 0xCF, 0x3C, 0x3F, 0xDE}}; const image_t img_6x8_3 = { 6, 8, false, 6, 0, {
0x7B, 0xF0, 0xCF, 0x3C, 0x3F, 0xDE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_4 = {6, 8, false, 6, 0, {0xC3, 0x0D, 0xB6, 0xFF, 0xF1, 0x86}}; const image_t img_6x8_4 = { 6, 8, false, 6, 0, {
0xC3, 0x0D, 0xB6, 0xFF, 0xF1, 0x86
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_5 = {6, 8, false, 6, 0, {0xFF, 0xFC, 0x3E, 0xFC, 0x3F, 0xFE}}; const image_t img_6x8_5 = { 6, 8, false, 6, 0, {
0xFF, 0xFC, 0x3E, 0xFC, 0x3F, 0xFE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_6 = {6, 8, false, 6, 0, {0x7B, 0xEC, 0x3E, 0xFF, 0x3F, 0xDE}}; const image_t img_6x8_6 = { 6, 8, false, 6, 0, {
0x7B, 0xEC, 0x3E, 0xFF, 0x3F, 0xDE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_7 = {6, 8, false, 6, 0, {0xFF, 0xF0, 0xC6, 0x18, 0xC3, 0x0C}}; const image_t img_6x8_7 = { 6, 8, false, 6, 0, {
0xFF, 0xF0, 0xC6, 0x18, 0xC3, 0x0C
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_8 = {6, 8, false, 6, 0, {0x7B, 0xFC, 0xDE, 0xFF, 0x3F, 0xDE}}; const image_t img_6x8_8 = { 6, 8, false, 6, 0, {
0x7B, 0xFC, 0xDE, 0xFF, 0x3F, 0xDE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_9 = {6, 8, false, 6, 0, {0x7B, 0xFC, 0xFF, 0x7C, 0x37, 0xDE}}; const image_t img_6x8_9 = { 6, 8, false, 6, 0, {
0x7B, 0xFC, 0xFF, 0x7C, 0x37, 0xDE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_A = {6, 8, false, 6, 0, {0x7B, 0xFC, 0xF3, 0xFF, 0xFC, 0xF3}}; const image_t img_6x8_A = { 6, 8, false, 6, 0, {
0x7B, 0xFC, 0xF3, 0xFF, 0xFC, 0xF3
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_B = {6, 8, false, 6, 0, {0xFB, 0xFC, 0xFE, 0xFB, 0x3F, 0xFE}}; const image_t img_6x8_B = { 6, 8, false, 6, 0, {
0xFB, 0xFC, 0xFE, 0xFB, 0x3F, 0xFE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_C = {6, 8, false, 6, 0, {0x7F, 0xFC, 0x30, 0xC3, 0x0F, 0xDF}}; const image_t img_6x8_C = { 6, 8, false, 6, 0, {
0x7F, 0xFC, 0x30, 0xC3, 0x0F, 0xDF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_D = {6, 8, false, 6, 0, {0xFB, 0xF6, 0xDB, 0x6D, 0xBF, 0xFE}}; const image_t img_6x8_D = { 6, 8, false, 6, 0, {
0xFB, 0xF6, 0xDB, 0x6D, 0xBF, 0xFE
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_E = {6, 8, false, 6, 0, {0xFF, 0xFC, 0x3C, 0xF3, 0x0F, 0xFF}}; const image_t img_6x8_E = { 6, 8, false, 6, 0, {
0xFF, 0xFC, 0x3C, 0xF3, 0x0F, 0xFF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_F = {6, 8, false, 6, 0, {0xFF, 0xFC, 0x3C, 0xF3, 0x0C, 0x30}}; const image_t img_6x8_F = { 6, 8, false, 6, 0, {
0xFF, 0xFC, 0x3C, 0xF3, 0x0C, 0x30
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_G = {6, 8, false, 6, 0, {0x7F, 0xFC, 0x30, 0xDF, 0x3F, 0xDF}}; const image_t img_6x8_G = { 6, 8, false, 6, 0, {
0x7F, 0xFC, 0x30, 0xDF, 0x3F, 0xDF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_X = {6, 8, false, 6, 0, {0xCF, 0x36, 0x8E, 0x71, 0x6C, 0xF3}}; const image_t img_6x8_X = { 6, 8, false, 6, 0, {
0xCF, 0x36, 0x8E, 0x71, 0x6C, 0xF3
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_Y = {6, 8, false, 6, 0, {0xCF, 0x3C, 0xF3, 0x78, 0xC3, 0x0C}}; const image_t img_6x8_Y = { 6, 8, false, 6, 0, {
0xCF, 0x3C, 0xF3, 0x78, 0xC3, 0x0C
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_Z = {6, 8, false, 6, 0, {0xFF, 0xF0, 0xC6, 0x31, 0x8F, 0xFF}}; const image_t img_6x8_Z = { 6, 8, false, 6, 0, {
0xFF, 0xF0, 0xC6, 0x31, 0x8F, 0xFF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_d = {6, 8, false, 6, 0, {0x0C, 0x30, 0xDF, 0xFF, 0x3F, 0xDF}}; const image_t img_6x8_d = { 6, 8, false, 6, 0, {
0x0C, 0x30, 0xDF, 0xFF, 0x3F, 0xDF
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_n = {6, 8, false, 6, 0, {0x00, 0x07, 0xBF, 0xCF, 0x3C, 0xF3}}; const image_t img_6x8_n = { 6, 8, false, 6, 0, {
0x00, 0x07, 0xBF, 0xCF, 0x3C, 0xF3
}};

View File

@@ -9,4 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_6x8_v = {6, 8, false, 6, 0, {0x00, 0x08, 0x73, 0xCF, 0xF7, 0x8C}}; const image_t img_6x8_v = { 6, 8, false, 6, 0, {
0x00, 0x08, 0x73, 0xCF, 0xF7, 0x8C
}};

View File

@@ -65,66 +65,58 @@
#include "images.h" #include "images.h"
const image_t img_RIP = { const image_t img_RIP = { 128, 64, true, 837, 0x06, { // orig:1024, comp:18.26%
128, 0x06, 0x20, 0xFF, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xD4, 0x06, 0x0E, 0x00, 0x2B, 0xC8, 0x01, 0xFC,
64, 0x1E, 0x1F, 0xF0, 0x00, 0xFE, 0x20, 0x8F, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x13, 0xD4, 0x01, 0xFC,
true, 0x0E, 0x0F, 0xF0, 0x00, 0xFE, 0x71, 0xCF, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x2B, 0xC0, 0x00, 0x0E,
837, 0x0A, 0x00, 0x38, 0x01, 0x87, 0x71, 0xD8, 0x77, 0x1C, 0x07, 0x71, 0xC0, 0x03, 0xC0, 0x03, 0x8E,
0x06, 0x0A, 0x0E, 0x28, 0x01, 0xC5, 0x51, 0x5C, 0x77, 0x1D, 0xC7, 0x71, 0x40, 0x03, 0xC0, 0x03, 0x8A,
{// orig:1024, comp:18.26% 0x0A, 0x0E, 0x28, 0x01, 0x47, 0x51, 0x5C, 0x55, 0x15, 0xC5, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A,
0x06, 0x20, 0xFF, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xD4, 0x06, 0x0E, 0x00, 0x2B, 0xC8, 0x01, 0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x15, 0x45, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A,
0xFC, 0x1E, 0x1F, 0xF0, 0x00, 0xFE, 0x20, 0x8F, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x13, 0xD4, 0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x15, 0x45, 0x51, 0xC0, 0x03, 0xC0, 0x02, 0x8E,
0x01, 0xFC, 0x0E, 0x0F, 0xF0, 0x00, 0xFE, 0x71, 0xCF, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x2B, 0x0A, 0x0A, 0x38, 0x01, 0x40, 0x51, 0x54, 0x75, 0x55, 0x47, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8,
0xC0, 0x00, 0x0E, 0x0A, 0x00, 0x38, 0x01, 0x87, 0x71, 0xD8, 0x77, 0x1C, 0x07, 0x71, 0xC0, 0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x71, 0xD7, 0xC5, 0x15, 0x7C, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8,
0x03, 0xC0, 0x03, 0x8E, 0x0A, 0x0E, 0x28, 0x01, 0xC5, 0x51, 0x5C, 0x77, 0x1D, 0xC7, 0x71, 0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x3F, 0x97, 0xC5, 0x15, 0x7C, 0x57, 0x80, 0x03, 0xC0, 0x02, 0x9C,
0x40, 0x03, 0xC0, 0x03, 0x8A, 0x0A, 0x0E, 0x28, 0x01, 0x47, 0x51, 0x5C, 0x55, 0x15, 0xC5, 0x0A, 0x0A, 0x00, 0x01, 0x40, 0x1B, 0x14, 0x75, 0x55, 0x4E, 0x57, 0xC0, 0x03, 0xC0, 0x02, 0x94,
0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A, 0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x15, 0x0A, 0x0A, 0x00, 0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94,
0x45, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A, 0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x0A, 0x0A, 0x00, 0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94,
0x15, 0x45, 0x51, 0xC0, 0x03, 0xC0, 0x02, 0x8E, 0x0A, 0x0A, 0x38, 0x01, 0x40, 0x51, 0x54, 0x0A, 0x0A, 0x00, 0x01, 0xC7, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x94,
0x75, 0x55, 0x47, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8, 0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x71, 0x0A, 0x0A, 0x00, 0x01, 0xC5, 0x0A, 0x1C, 0x77, 0x1D, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x94,
0xD7, 0xC5, 0x15, 0x7C, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8, 0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x0A, 0x0A, 0x00, 0x01, 0x87, 0x0E, 0x1C, 0x77, 0x1D, 0x4A, 0x61, 0xC0, 0x03, 0xC0, 0x03, 0x9C,
0x3F, 0x97, 0xC5, 0x15, 0x7C, 0x57, 0x80, 0x03, 0xC0, 0x02, 0x9C, 0x0A, 0x0A, 0x00, 0x01, 0xCE, 0xCE, 0xC0, 0x00, 0xFE, 0x0E, 0x0F, 0xE3, 0xF9, 0xCE, 0x3F, 0x80, 0x03, 0xC0, 0x03, 0x8E,
0x40, 0x1B, 0x14, 0x75, 0x55, 0x4E, 0x57, 0xC0, 0x03, 0xC0, 0x02, 0x94, 0x0A, 0x0A, 0x00, 0xDE, 0xDE, 0xC0, 0x00, 0xFE, 0x1F, 0x0F, 0xE3, 0xF9, 0xC7, 0x3F, 0x80, 0x03, 0xC0, 0x06, 0x0E,
0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94, 0x0A, 0x0A, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x01, 0x8C, 0x07, 0xF0, 0x03,
0x00, 0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94, 0x0A, 0xC0, 0x06, 0x07, 0x00, 0x04, 0x00, 0x00, 0x02, 0x52, 0x18, 0x0C, 0x03, 0xC1, 0xD5, 0xC7, 0x57,
0x0A, 0x00, 0x01, 0xC7, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x94, 0x77, 0x6D, 0xC4, 0x5D, 0x2B, 0x8E, 0xE0, 0x03, 0x5A, 0x20, 0x02, 0x03, 0xC0, 0x95, 0x04, 0x54,
0x0A, 0x0A, 0x00, 0x01, 0xC5, 0x0A, 0x1C, 0x77, 0x1D, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x24, 0x55, 0x04, 0x55, 0xA1, 0x0A, 0x80, 0x01, 0x8C, 0x47, 0xC1, 0x03, 0xC0, 0x9D, 0x87, 0x27,
0x94, 0x0A, 0x0A, 0x00, 0x01, 0x87, 0x0E, 0x1C, 0x77, 0x1D, 0x4A, 0x61, 0xC0, 0x03, 0xC0, 0x26, 0x55, 0xC5, 0x55, 0x61, 0x0C, 0xC0, 0x00, 0x50, 0x88, 0x21, 0x03, 0xC0, 0x95, 0x01, 0x21,
0x03, 0x9C, 0xCE, 0xCE, 0xC0, 0x00, 0xFE, 0x0E, 0x0F, 0xE3, 0xF9, 0xCE, 0x3F, 0x80, 0x03, 0x24, 0x44, 0x45, 0x55, 0x21, 0x0A, 0x80, 0x00, 0x20, 0x90, 0x11, 0x03, 0xC0, 0x95, 0xC7, 0x27,
0xC0, 0x03, 0x8E, 0xDE, 0xDE, 0xC0, 0x00, 0xFE, 0x1F, 0x0F, 0xE3, 0xF9, 0xC7, 0x3F, 0x80, 0x27, 0x45, 0xC6, 0xDD, 0x21, 0x0E, 0xE0, 0x00, 0x70, 0x91, 0x91, 0x03, 0xC0, 0x06, 0x0B, 0x00,
0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x88, 0x92, 0x51, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x01, 0x08, 0x92, 0x91, 0x03, 0xC0, 0x06, 0x0A,
0x01, 0x8C, 0x07, 0xF0, 0x03, 0xC0, 0x06, 0x07, 0x00, 0x04, 0x00, 0x00, 0x02, 0x52, 0x18, 0x00, 0x01, 0x08, 0x92, 0x11, 0x03, 0xC1, 0xD5, 0xC7, 0x76, 0xDC, 0x45, 0xDD, 0x5D, 0x5C, 0x57,
0x0C, 0x03, 0xC1, 0xD5, 0xC7, 0x57, 0x77, 0x6D, 0xC4, 0x5D, 0x2B, 0x8E, 0xE0, 0x03, 0x5A, 0x50, 0x00, 0x87, 0x11, 0xE2, 0x03, 0xC0, 0x95, 0x04, 0x55, 0x50, 0x44, 0x89, 0x55, 0x48, 0x55,
0x20, 0x02, 0x03, 0xC0, 0x95, 0x04, 0x54, 0x24, 0x55, 0x04, 0x55, 0xA1, 0x0A, 0x80, 0x01, 0x50, 0x00, 0x80, 0x88, 0x03, 0x03, 0xC0, 0x9D, 0x87, 0x75, 0x58, 0x54, 0x89, 0xD5, 0x48, 0x25,
0x8C, 0x47, 0xC1, 0x03, 0xC0, 0x9D, 0x87, 0x27, 0x26, 0x55, 0xC5, 0x55, 0x61, 0x0C, 0xC0, 0x50, 0x00, 0x40, 0x7C, 0x04, 0x83, 0xC0, 0x95, 0x01, 0x54, 0x50, 0x54, 0x89, 0x55, 0x48, 0x25,
0x00, 0x50, 0x88, 0x21, 0x03, 0xC0, 0x95, 0x01, 0x21, 0x24, 0x44, 0x45, 0x55, 0x21, 0x0A, 0x50, 0x00, 0x40, 0x07, 0xF8, 0x43, 0xC0, 0x95, 0xC7, 0x54, 0x5C, 0x6D, 0xC9, 0x5D, 0xC8, 0x27,
0x80, 0x00, 0x20, 0x90, 0x11, 0x03, 0xC0, 0x95, 0xC7, 0x27, 0x27, 0x45, 0xC6, 0xDD, 0x21, 0x70, 0x00, 0x30, 0x00, 0x00, 0x43, 0xC0, 0x06, 0x0B, 0x00, 0x0F, 0xFF, 0xFF, 0x83, 0xC0, 0x06,
0x0E, 0xE0, 0x00, 0x70, 0x91, 0x91, 0x03, 0xC0, 0x06, 0x0B, 0x00, 0x88, 0x92, 0x51, 0x03, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xC7, 0xF1, 0xFC, 0x7F, 0x00,
0xC0, 0x06, 0x0A, 0x00, 0x01, 0x08, 0x92, 0x91, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x01, 0x08, 0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xC7, 0xF1, 0xFC, 0x7F, 0x00,
0x92, 0x11, 0x03, 0xC1, 0xD5, 0xC7, 0x76, 0xDC, 0x45, 0xDD, 0x5D, 0x5C, 0x57, 0x50, 0x00, 0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x05, 0x4E, 0x3B, 0x8E, 0xE3, 0x80,
0x87, 0x11, 0xE2, 0x03, 0xC0, 0x95, 0x04, 0x55, 0x50, 0x44, 0x89, 0x55, 0x48, 0x55, 0x50, 0x07, 0x1D, 0xC7, 0x71, 0xDC, 0x70, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4E, 0x3A, 0x8E, 0xE3, 0x80,
0x00, 0x80, 0x88, 0x03, 0x03, 0xC0, 0x9D, 0x87, 0x75, 0x58, 0x54, 0x89, 0xD5, 0x48, 0x25, 0x05, 0x15, 0xC7, 0x51, 0x54, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x2B, 0x8A, 0xA2, 0x80,
0x50, 0x00, 0x40, 0x7C, 0x04, 0x83, 0xC0, 0x95, 0x01, 0x54, 0x50, 0x54, 0x89, 0x55, 0x48, 0x07, 0x15, 0x45, 0x71, 0x5C, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA2, 0x80,
0x25, 0x50, 0x00, 0x40, 0x07, 0xF8, 0x43, 0xC0, 0x95, 0xC7, 0x54, 0x5C, 0x6D, 0xC9, 0x5D, 0x00, 0x15, 0x45, 0x01, 0x40, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA6, 0x80,
0xC8, 0x27, 0x70, 0x00, 0x30, 0x00, 0x00, 0x43, 0xC0, 0x06, 0x0B, 0x00, 0x0F, 0xFF, 0xFF, 0x00, 0x15, 0x4D, 0x01, 0x40, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4E, 0x28, 0x0E, 0xA6, 0x80,
0x83, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xC7, 0x00, 0x1D, 0x4D, 0x01, 0xC0, 0x70, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x0E, 0xAA, 0x9F,
0xF1, 0xFC, 0x7F, 0x00, 0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xE1, 0xF9, 0x55, 0x1F, 0x87, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x38, 0xAA, 0x90,
0xC7, 0xF1, 0xFC, 0x7F, 0x00, 0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x23, 0xF1, 0x55, 0x3F, 0x0F, 0xC0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x38, 0xB2, 0x9F,
0x05, 0x4E, 0x3B, 0x8E, 0xE3, 0x80, 0x07, 0x1D, 0xC7, 0x71, 0xDC, 0x70, 0x00, 0x03, 0xC0, 0xE7, 0x01, 0x65, 0x70, 0x1C, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x28, 0xB2, 0x80,
0x00, 0x01, 0x4E, 0x3A, 0x8E, 0xE3, 0x80, 0x05, 0x15, 0xC7, 0x51, 0x54, 0x50, 0x00, 0x03, 0x05, 0x01, 0x65, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x28, 0xA2, 0x80,
0xC0, 0x00, 0x01, 0x4A, 0x2B, 0x8A, 0xA2, 0x80, 0x07, 0x15, 0x45, 0x71, 0x5C, 0x50, 0x00, 0x05, 0x01, 0x45, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x28, 0xA2, 0x80,
0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA2, 0x80, 0x00, 0x15, 0x45, 0x01, 0x40, 0x50, 0x05, 0x01, 0x45, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x38, 0x28, 0xE3, 0x80,
0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA6, 0x80, 0x00, 0x15, 0x4D, 0x01, 0x40, 0x05, 0x01, 0xC7, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x38, 0x28, 0xE3, 0x80,
0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4E, 0x28, 0x0E, 0xA6, 0x80, 0x00, 0x1D, 0x4D, 0x01, 0x05, 0x0D, 0xC7, 0x50, 0xD4, 0x30, 0x00, 0x03, 0xD4, 0x00, 0x07, 0xF3, 0xF0, 0x38, 0x7F, 0x00,
0xC0, 0x70, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x0E, 0xAA, 0x9F, 0xE1, 0xF9, 0x55, 0x07, 0xFC, 0xFE, 0x7F, 0xDF, 0xF0, 0x00, 0x2B, 0xC8, 0x00, 0x0F, 0xFB, 0xF0, 0x38, 0x7F, 0x00,
0x1F, 0x87, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x38, 0xAA, 0x90, 0x23, 0xF1, 0x07, 0xFC, 0xFE, 0x7F, 0xDF, 0xF0, 0x00, 0x13, 0xD4, 0x06, 0x0E, 0x00, 0x2B, 0xC0, 0x06, 0x0E,
0x55, 0x3F, 0x0F, 0xC0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x38, 0xB2, 0x9F, 0xE7, 0x00, 0x03, 0x06, 0x20, 0xFF
0x01, 0x65, 0x70, 0x1C, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x28, 0xB2, 0x80, }};
0x05, 0x01, 0x65, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x28, 0xA2,
0x80, 0x05, 0x01, 0x45, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x28,
0xA2, 0x80, 0x05, 0x01, 0x45, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x38,
0x28, 0xE3, 0x80, 0x05, 0x01, 0xC7, 0x50, 0x14, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40,
0x38, 0x28, 0xE3, 0x80, 0x05, 0x0D, 0xC7, 0x50, 0xD4, 0x30, 0x00, 0x03, 0xD4, 0x00, 0x07,
0xF3, 0xF0, 0x38, 0x7F, 0x00, 0x07, 0xFC, 0xFE, 0x7F, 0xDF, 0xF0, 0x00, 0x2B, 0xC8, 0x00,
0x0F, 0xFB, 0xF0, 0x38, 0x7F, 0x00, 0x07, 0xFC, 0xFE, 0x7F, 0xDF, 0xF0, 0x00, 0x13, 0xD4,
0x06, 0x0E, 0x00, 0x2B, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0x06, 0x20, 0xFF}};

View File

@@ -12,14 +12,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_Cable = { const image_t img_cc_Cable = { 4, 11, true, 4, 0x00, { // orig:6, comp:33.33%
4, 0x00, 0x05, 0xDB, 0xD0
11, }};
true,
4,
0x00,
{// orig:6, comp:33.33%
0x00,
0x05,
0xDB,
0xD0}};

View File

@@ -18,8 +18,8 @@
#include "images.h" #include "images.h"
const image_t img_cc_Joy = {17, 17, false, 37, 0, {0x00, 0x80, 0x01, 0xF0, 0x0F, 0xDF, 0x87, 0x01, const image_t img_cc_Joy = { 17, 17, false, 37, 0, {
0xC3, 0x00, 0x61, 0x00, 0x11, 0x80, 0x0C, 0xC0, 0x00, 0x80, 0x01, 0xF0, 0x0F, 0xDF, 0x87, 0x01, 0xC3, 0x00, 0x61, 0x00, 0x11, 0x80, 0x0C, 0xC0,
0x06, 0xC0, 0x01, 0xB0, 0x01, 0x98, 0x00, 0xC4, 0x06, 0xC0, 0x01, 0xB0, 0x01, 0x98, 0x00, 0xC4, 0x00, 0x43, 0x00, 0x61, 0xC0, 0x70, 0xFD, 0xF8,
0x00, 0x43, 0x00, 0x61, 0xC0, 0x70, 0xFD, 0xF8, 0x07, 0xC0, 0x00, 0x80, 0x00
0x07, 0xC0, 0x00, 0x80, 0x00}}; }};

View File

@@ -54,47 +54,39 @@
#include "images.h" #include "images.h"
const image_t img_cc_Main = { const image_t img_cc_Main = { 116, 53, true, 542, 0x05, { // orig:769, comp:29.52%
116, 0x00, 0x00, 0x00, 0x7F, 0xC0, 0x05, 0x05, 0x00, 0x3F, 0xE0, 0x05, 0x04, 0x00, 0x01, 0xF8, 0x04,
53, 0x0F, 0x80, 0x00, 0x00, 0x1F, 0x02, 0x01, 0xF8, 0x05, 0x04, 0x00, 0x60, 0x00, 0x41, 0x04, 0x00,
true, 0x60, 0x02, 0x08, 0x20, 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xF0, 0x7F, 0xFF, 0xFF,
542, 0xE0, 0xFE, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x41, 0x04, 0x00, 0x60, 0x02, 0x08,
0x05, 0x20, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x50, 0x03, 0xFC, 0x10, 0x40, 0x06, 0x00, 0x20, 0x83, 0xFC,
{// orig:769, comp:29.52% 0x00, 0xA0, 0x00, 0x00, 0x09, 0x0F, 0xC0, 0x00, 0xF8, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x3F, 0x09,
0x00, 0x00, 0x00, 0x7F, 0xC0, 0x05, 0x05, 0x00, 0x3F, 0xE0, 0x05, 0x04, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x01, 0x1F, 0x05, 0x09, 0x00, 0x0F, 0x88, 0x00, 0x00, 0x20, 0x05, 0x0A, 0xFF, 0xF0,
0x04, 0x0F, 0x80, 0x00, 0x00, 0x1F, 0x02, 0x01, 0xF8, 0x05, 0x04, 0x00, 0x60, 0x00, 0x41, 0x40, 0x00, 0x04, 0x78, 0x05, 0x09, 0x00, 0x01, 0xE2, 0x00, 0x00, 0x9C, 0x05, 0x0A, 0x00, 0x03,
0x04, 0x00, 0x60, 0x02, 0x08, 0x20, 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xF0, 0x90, 0x00, 0x13, 0x05, 0x0B, 0x00, 0x0C, 0x80, 0x03, 0xE0, 0x05, 0x0B, 0x00, 0x7C, 0x00, 0x38,
0x7F, 0xFF, 0xFF, 0xE0, 0xFE, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x41, 0x04, 0x05, 0x05, 0x00, 0xC6, 0xD8, 0x05, 0x04, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x1F, 0xF0, 0x00, 0x00,
0x00, 0x60, 0x02, 0x08, 0x20, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x50, 0x03, 0xFC, 0x10, 0x40, 0x0D, 0x60, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x60, 0x01, 0xFF, 0x00, 0x00, 0x00, 0xD6,
0x06, 0x00, 0x20, 0x83, 0xFC, 0x00, 0xA0, 0x00, 0x00, 0x09, 0x0F, 0xC0, 0x00, 0xF8, 0x00, 0xD8, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x60, 0x0C, 0x00, 0x18, 0x30, 0x00, 0x00, 0x0D, 0x6D, 0x80,
0x00, 0x01, 0xF0, 0x00, 0x3F, 0x09, 0x00, 0x00, 0x01, 0x1F, 0x05, 0x09, 0x00, 0x0F, 0x88, 0x00, 0x00, 0x31, 0x80, 0x03, 0x01, 0xC0, 0x01, 0x83, 0x00, 0x00, 0x00, 0x6C, 0xD8, 0x00, 0x00,
0x00, 0x00, 0x20, 0x05, 0x0A, 0xFF, 0xF0, 0x40, 0x00, 0x04, 0x78, 0x05, 0x09, 0x00, 0x01, 0x06, 0x0C, 0x00, 0x38, 0x18, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xCA, 0x60, 0x01, 0x81, 0x00,
0xE2, 0x00, 0x00, 0x9C, 0x05, 0x0A, 0x00, 0x03, 0x90, 0x00, 0x13, 0x05, 0x0B, 0x00, 0x0C, 0x01, 0x93, 0x05, 0x07, 0x00, 0x0C, 0x46, 0x00, 0x0C, 0x30, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00,
0x80, 0x03, 0xE0, 0x05, 0x0B, 0x00, 0x7C, 0x00, 0x38, 0x05, 0x05, 0x00, 0xC6, 0xD8, 0x05, 0xCA, 0x60, 0x00, 0xC2, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x05, 0x00, 0x07, 0x06, 0x0C, 0x1C, 0x04,
0x04, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x0D, 0x60, 0x00, 0x00, 0x00, 0x60, 0x0F, 0xF8, 0x3F, 0xE0, 0x05, 0x05, 0x00, 0xF8, 0x31, 0x83, 0xE0, 0x64, 0x00, 0xC0, 0x00,
0x0E, 0x00, 0x0E, 0x00, 0x60, 0x01, 0xFF, 0x00, 0x00, 0x00, 0xD6, 0xD8, 0x00, 0x00, 0x01, 0x06, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x02, 0x40, 0x0C, 0x00, 0x00, 0x60,
0xF0, 0x00, 0x60, 0x0C, 0x00, 0x18, 0x30, 0x00, 0x00, 0x0D, 0x6D, 0x80, 0x00, 0x00, 0x31, 0x01, 0x99, 0x99, 0x98, 0x03, 0x06, 0x0E, 0x0C, 0x98, 0x2C, 0x00, 0xCE, 0x00, 0xE6, 0x00, 0x10,
0x80, 0x03, 0x01, 0xC0, 0x01, 0x83, 0x00, 0x00, 0x00, 0x6C, 0xD8, 0x00, 0x00, 0x06, 0x0C, 0x90, 0x90, 0x80, 0x65, 0x30, 0x01, 0x94, 0xC3, 0x80, 0x0C, 0x00, 0x00, 0x60, 0x01, 0x09, 0x09,
0x00, 0x38, 0x18, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xCA, 0x60, 0x01, 0x81, 0x00, 0x01, 0x08, 0x06, 0x73, 0x00, 0x19, 0xCC, 0x18, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x19, 0x99, 0x99, 0x80,
0x93, 0x05, 0x07, 0x00, 0x0C, 0x46, 0x00, 0x0C, 0x30, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0x61, 0x30, 0x01, 0x94, 0xC1, 0x80, 0x0F, 0xF8, 0x3F, 0xE0, 0x00, 0xF0, 0xF0, 0xF0, 0x03, 0x26,
0xCA, 0x60, 0x00, 0xC2, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x05, 0x00, 0x07, 0x06, 0x0C, 0x1C, 0x0E, 0x0C, 0x18, 0x18, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x05, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x01,
0x04, 0x60, 0x0F, 0xF8, 0x3F, 0xE0, 0x05, 0x05, 0x00, 0xF8, 0x31, 0x83, 0xE0, 0x64, 0x00, 0x80, 0x00, 0x19, 0x30, 0x05, 0x06, 0x00, 0xF8, 0x31, 0x83, 0xE0, 0x18, 0x00, 0x01, 0x93, 0x05,
0xC0, 0x00, 0x06, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x02, 0x40, 0x0C, 0x06, 0x00, 0x07, 0x06, 0x8C, 0x1C, 0x01, 0x80, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xC8, 0x60,
0x00, 0x00, 0x60, 0x01, 0x99, 0x99, 0x98, 0x03, 0x06, 0x0E, 0x0C, 0x98, 0x2C, 0x00, 0xCE, 0x00, 0x18, 0x00, 0x01, 0x83, 0x05, 0x07, 0x00, 0x0C, 0xC6, 0x00, 0x01, 0x80, 0x00, 0x18, 0x30,
0x00, 0xE6, 0x00, 0x10, 0x90, 0x90, 0x80, 0x65, 0x30, 0x01, 0x94, 0xC3, 0x80, 0x0C, 0x00, 0x05, 0x07, 0x00, 0xCA, 0x60, 0x00, 0x1C, 0x00, 0x01, 0xFF, 0x05, 0x07, 0x00, 0x06, 0x6C, 0x00,
0x00, 0x60, 0x01, 0x09, 0x09, 0x08, 0x06, 0x73, 0x00, 0x19, 0xCC, 0x18, 0x00, 0xC0, 0x00, 0x03, 0x40, 0x00, 0x1F, 0xF0, 0x05, 0x07, 0x00, 0x31, 0x80, 0x00, 0x24, 0x05, 0x0A, 0x00, 0x01,
0x06, 0x00, 0x19, 0x99, 0x99, 0x80, 0x61, 0x30, 0x01, 0x94, 0xC1, 0x80, 0x0F, 0xF8, 0x3F, 0xF0, 0x00, 0x02, 0x60, 0x05, 0x0A, 0x00, 0x0E, 0x00, 0x00, 0x62, 0x05, 0x0D, 0x00, 0x04, 0x20,
0xE0, 0x00, 0xF0, 0xF0, 0xF0, 0x03, 0x26, 0x0E, 0x0C, 0x18, 0x18, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x0D, 0x00, 0x43, 0x05, 0x0D, 0x00, 0x0C, 0x10, 0x05, 0x0D, 0x00, 0x81, 0x80, 0x05, 0x0C,
0x05, 0x05, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x01, 0x80, 0x00, 0x19, 0x30, 0x05, 0x06, 0x00, 0x00, 0x18, 0x0C, 0x05, 0x0C, 0x00, 0x03, 0x00, 0x60, 0x05, 0x0C, 0x00, 0x60, 0x03, 0x05, 0x0C,
0xF8, 0x31, 0x83, 0xE0, 0x18, 0x00, 0x01, 0x93, 0x05, 0x06, 0x00, 0x07, 0x06, 0x8C, 0x1C, 0x00, 0x0C, 0x00, 0x18, 0x05, 0x0B, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x05, 0x0B, 0x00, 0x70, 0x00,
0x01, 0x80, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xC8, 0x60, 0x00, 0x18, 0x00, 0x01, 0x83, 0x03, 0x05, 0x0B, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x05, 0x0A, 0x00, 0x03, 0x80, 0x00, 0x00, 0x78,
0x05, 0x07, 0x00, 0x0C, 0xC6, 0x00, 0x01, 0x80, 0x00, 0x18, 0x30, 0x05, 0x07, 0x00, 0xCA, 0x05, 0x09, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x05, 0x0A, 0xFF, 0xF0, 0x00, 0x00
0x60, 0x00, 0x1C, 0x00, 0x01, 0xFF, 0x05, 0x07, 0x00, 0x06, 0x6C, 0x00, 0x03, 0x40, 0x00, }};
0x1F, 0xF0, 0x05, 0x07, 0x00, 0x31, 0x80, 0x00, 0x24, 0x05, 0x0A, 0x00, 0x01, 0xF0, 0x00,
0x02, 0x60, 0x05, 0x0A, 0x00, 0x0E, 0x00, 0x00, 0x62, 0x05, 0x0D, 0x00, 0x04, 0x20, 0x05,
0x0D, 0x00, 0x43, 0x05, 0x0D, 0x00, 0x0C, 0x10, 0x05, 0x0D, 0x00, 0x81, 0x80, 0x05, 0x0C,
0x00, 0x18, 0x0C, 0x05, 0x0C, 0x00, 0x03, 0x00, 0x60, 0x05, 0x0C, 0x00, 0x60, 0x03, 0x05,
0x0C, 0x00, 0x0C, 0x00, 0x18, 0x05, 0x0B, 0x00, 0x01, 0x80, 0x00, 0xE0, 0x05, 0x0B, 0x00,
0x70, 0x00, 0x03, 0x05, 0x0B, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x05, 0x0A, 0x00, 0x03, 0x80,
0x00, 0x00, 0x78, 0x05, 0x09, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x05, 0x0A, 0xFF, 0xF0,
0x00, 0x00}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_btn_A1 = {7, 7, false, 7, 0, {0xFF, 0xDF, 0x5E, 0x3D, 0x7F, 0xFF, 0x80}}; const image_t img_cc_btn_A1 = { 7, 7, false, 7, 0, {
0xFF, 0xDF, 0x5E, 0x3D, 0x7F, 0xFF, 0x80
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_btn_B1 = {7, 7, false, 7, 0, {0xFF, 0xBF, 0x7E, 0x7D, 0x7C, 0xFF, 0x80}}; const image_t img_cc_btn_B1 = { 7, 7, false, 7, 0, {
0xFF, 0xBF, 0x7E, 0x7D, 0x7C, 0xFF, 0x80
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_btn_X1 = {7, 7, false, 7, 0, {0xFF, 0xFF, 0x5F, 0x7D, 0x7F, 0xFF, 0x80}}; const image_t img_cc_btn_X1 = { 7, 7, false, 7, 0, {
0xFF, 0xFF, 0x5F, 0x7D, 0x7F, 0xFF, 0x80
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_btn_Y1 = {7, 7, false, 7, 0, {0xFF, 0xFF, 0x5E, 0x3F, 0x7D, 0xFF, 0x80}}; const image_t img_cc_btn_Y1 = { 7, 7, false, 7, 0, {
0xFF, 0xFF, 0x5E, 0x3F, 0x7D, 0xFF, 0x80
}};

View File

@@ -6,4 +6,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_pad_LR1 = {7, 5, false, 5, 0, {0xFF, 0xFF, 0x1F, 0xFF, 0xE0}}; const image_t img_cc_pad_LR1 = { 7, 5, false, 5, 0, {
0xFF, 0xFF, 0x1F, 0xFF, 0xE0
}};

View File

@@ -8,4 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_pad_UD1 = {5, 7, false, 5, 0, {0xFF, 0xF7, 0xBD, 0xFF, 0xE0}}; const image_t img_cc_pad_UD1 = { 5, 7, false, 5, 0, {
0xFF, 0xF7, 0xBD, 0xFF, 0xE0
}};

View File

@@ -7,10 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_L1 = { const image_t img_cc_trg_L1 = { 17, 6, false, 13, 0, {
17, 0x1F, 0xC9, 0x34, 0x92, 0x64, 0x92, 0x54, 0x92, 0x44, 0x93, 0xFC, 0xFE, 0x00
6, }};
false,
13,
0,
{0x1F, 0xC9, 0x34, 0x92, 0x64, 0x92, 0x54, 0x92, 0x44, 0x93, 0xFC, 0xFE, 0x00}};

View File

@@ -7,22 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_L2 = { const image_t img_cc_trg_L2 = { 17, 6, true, 12, 0x01, { // orig:13, comp:7.69%
17, 0x1F, 0xD5, 0x35, 0x55, 0x75, 0x01, 0x04, 0x55, 0x57, 0xFD, 0x7E, 0x00
6, }};
true,
12,
0x01,
{// orig:13, comp:7.69%
0x1F,
0xD5,
0x35,
0x55,
0x75,
0x01,
0x04,
0x55,
0x57,
0xFD,
0x7E,
0x00}};

View File

@@ -7,10 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_L3 = { const image_t img_cc_trg_L3 = { 17, 6, false, 13, 0, {
17, 0x1F, 0xB6, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6F, 0xFB, 0x7E, 0x00
6, }};
false,
13,
0,
{0x1F, 0xB6, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6F, 0xFB, 0x7E, 0x00}};

View File

@@ -7,18 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_L4 = { const image_t img_cc_trg_L4 = { 17, 6, true, 8, 0x01, { // orig:13, comp:38.46%
17, 0x1F, 0xFF, 0xBF, 0x01, 0x08, 0xFF, 0xFE, 0x00
6, }};
true,
8,
0x01,
{// orig:13, comp:38.46%
0x1F,
0xFF,
0xBF,
0x01,
0x08,
0xFF,
0xFE,
0x00}};

View File

@@ -7,10 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_R1 = { const image_t img_cc_trg_R1 = { 17, 6, false, 13, 0, {
17, 0x49, 0xFC, 0x49, 0x25, 0x92, 0x49, 0x24, 0x92, 0x5F, 0xE4, 0x90, 0x0F, 0xE4
6, }};
false,
13,
0,
{0x49, 0xFC, 0x49, 0x25, 0x92, 0x49, 0x24, 0x92, 0x5F, 0xE4, 0x90, 0x0F, 0xE4}};

View File

@@ -7,10 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_R2 = { const image_t img_cc_trg_R2 = { 17, 6, false, 13, 0, {
17, 0x55, 0xFC, 0x55, 0x55, 0x95, 0x55, 0x75, 0x55, 0x5F, 0xF5, 0x50, 0x0F, 0xD4
6, }};
false,
13,
0,
{0x55, 0xFC, 0x55, 0x55, 0x95, 0x55, 0x75, 0x55, 0x5F, 0xF5, 0x50, 0x0F, 0xD4}};

View File

@@ -7,10 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_R3 = { const image_t img_cc_trg_R3 = { 17, 6, false, 13, 0, {
17, 0xB6, 0xFC, 0x36, 0xDB, 0xAD, 0xB6, 0xFB, 0x6D, 0xBF, 0xFB, 0x68, 0x0F, 0xD8
6, }};
false,
13,
0,
{0xB6, 0xFC, 0x36, 0xDB, 0xAD, 0xB6, 0xFB, 0x6D, 0xBF, 0xFB, 0x68, 0x0F, 0xD8}};

View File

@@ -7,21 +7,6 @@
#include "images.h" #include "images.h"
const image_t img_cc_trg_R4 = { const image_t img_cc_trg_R4 = { 17, 6, true, 11, 0x00, { // orig:13, comp:15.38%
17, 0xFF, 0xFC, 0x7F, 0xFF, 0xBF, 0x00, 0x05, 0xFF, 0xF8, 0x0F, 0xFC
6, }};
true,
11,
0x00,
{// orig:13, comp:15.38%
0xFF,
0xFC,
0x7F,
0xFF,
0xBF,
0x00,
0x05,
0xFF,
0xF8,
0x0F,
0xFC}};

View File

@@ -41,49 +41,41 @@
#include "images.h" #include "images.h"
const image_t img_csLogo_FULL = { const image_t img_csLogo_FULL = { 124, 40, true, 571, 0x0B, { // orig:620, comp:7.90%
124, 0x3F, 0xFF, 0xFE, 0x10, 0x43, 0xF8, 0x7F, 0x0F, 0xE1, 0xFC, 0x0B, 0x05, 0x00, 0x03, 0xFF, 0xFF,
40, 0xE3, 0x8E, 0x3F, 0x87, 0xF0, 0xFE, 0x1F, 0xC0, 0x0B, 0x05, 0x00, 0xFC, 0x00, 0x07, 0x38, 0xE6,
true, 0x1C, 0xE3, 0x80, 0x73, 0x8E, 0x03, 0xBB, 0x80, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x52, 0x8A, 0x71,
571, 0xCE, 0x39, 0xC7, 0x38, 0xA0, 0x22, 0x10, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x05, 0x28, 0xA7, 0x14,
0x0B, 0xA2, 0x9C, 0x52, 0x8A, 0x03, 0x39, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x52, 0x8A, 0x51, 0x4A,
{// orig:620, comp:7.90% 0x29, 0x45, 0x28, 0xA0, 0x20, 0x90, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x07, 0x28, 0xA5, 0x14, 0xA2,
0x3F, 0xFF, 0xFE, 0x10, 0x43, 0xF8, 0x7F, 0x0F, 0xE1, 0xFC, 0x0B, 0x05, 0x00, 0x03, 0xFF, 0x94, 0x52, 0x8E, 0x03, 0xB9, 0x40, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x02, 0x8A, 0x51, 0xCA, 0xA9,
0xFF, 0xE3, 0x8E, 0x3F, 0x87, 0xF0, 0xFE, 0x1F, 0xC0, 0x0B, 0x05, 0x00, 0xFC, 0x00, 0x07, 0x47, 0x28, 0x0B, 0x06, 0x00, 0xCC, 0x00, 0x00, 0x38, 0xE5, 0xF0, 0xA2, 0x97, 0xC2, 0x80, 0x06,
0x38, 0xE6, 0x1C, 0xE3, 0x80, 0x73, 0x8E, 0x03, 0xBB, 0x80, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0xEE, 0x80, 0x00, 0x00, 0x0E, 0xC3, 0x00, 0x01, 0xFC, 0x5F, 0x0A, 0x29, 0x7C, 0x2B, 0xC0, 0x2A,
0x52, 0x8A, 0x71, 0xCE, 0x39, 0xC7, 0x38, 0xA0, 0x22, 0x10, 0x00, 0x00, 0x00, 0xFC, 0x00, 0xAA, 0x00, 0x00, 0x00, 0xDC, 0x30, 0x00, 0x0D, 0x85, 0x1C, 0xAA, 0x94, 0xE2, 0xBE, 0x02, 0xEE,
0x05, 0x28, 0xA7, 0x14, 0xA2, 0x9C, 0x52, 0x8A, 0x03, 0x39, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0xE0, 0x00, 0x00, 0x0E, 0xC0, 0x30, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x28, 0xA0, 0x22, 0xA2,
0x00, 0x52, 0x8A, 0x51, 0x4A, 0x29, 0x45, 0x28, 0xA0, 0x20, 0x90, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xDC, 0x04, 0x80, 0x05, 0x05, 0x14, 0xA2, 0x94, 0xA2, 0x8A, 0x07, 0x2E, 0x20,
0x00, 0x07, 0x28, 0xA5, 0x14, 0xA2, 0x94, 0x52, 0x8E, 0x03, 0xB9, 0x40, 0x00, 0x00, 0x0F, 0x00, 0x08, 0x0E, 0xC0, 0x48, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x38, 0xA0, 0x00, 0x00, 0x00,
0xC0, 0x00, 0x02, 0x8A, 0x51, 0xCA, 0xA9, 0x47, 0x28, 0x0B, 0x06, 0x00, 0xCC, 0x00, 0x00, 0x01, 0x40, 0xDC, 0x03, 0x00, 0x05, 0x07, 0x1C, 0xE3, 0x94, 0xA3, 0x8A, 0x0B, 0x04, 0x00, 0xE2,
0x38, 0xE5, 0xF0, 0xA2, 0x97, 0xC2, 0x80, 0x06, 0xEE, 0x80, 0x00, 0x00, 0x0E, 0xC3, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x70, 0x71, 0xCE, 0x39, 0x4A, 0x30, 0xE0, 0x00, 0x00, 0x00, 0x0C, 0x90,
0x01, 0xFC, 0x5F, 0x0A, 0x29, 0x7C, 0x2B, 0xC0, 0x2A, 0xAA, 0x00, 0x00, 0x00, 0xDC, 0x30, 0xCC, 0x00, 0x00, 0x07, 0x03, 0xF8, 0x7F, 0x1C, 0xE1, 0xFC, 0x0B, 0x04, 0x00, 0x94, 0x8C, 0xC0,
0x00, 0x0D, 0x85, 0x1C, 0xAA, 0x94, 0xE2, 0xBE, 0x02, 0xEE, 0xE0, 0x00, 0x00, 0x0E, 0xC0, 0x00, 0x00, 0xF8, 0x3F, 0x87, 0xF1, 0xC7, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x72, 0x24, 0xCC, 0x0B,
0x30, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x28, 0xA0, 0x22, 0xA2, 0x00, 0x00, 0x00, 0xDC, 0x0C, 0x00, 0x06, 0x15, 0x2C, 0xC0, 0x0B, 0x0C, 0x00, 0x48, 0x89, 0xCC, 0x00, 0xFE, 0x10, 0x43,
0x04, 0x80, 0x05, 0x05, 0x14, 0xA2, 0x94, 0xA2, 0x8A, 0x07, 0x2E, 0x20, 0x00, 0x08, 0x0E, 0xF8, 0xFF, 0x8F, 0xE1, 0xFC, 0x3F, 0x80, 0x00, 0x39, 0x05, 0x3C, 0xC0, 0x0F, 0xE3, 0x8E, 0x3F,
0xC0, 0x48, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x38, 0xA0, 0x00, 0x00, 0x00, 0x01, 0x40, 0x8F, 0xF8, 0xFE, 0x1F, 0xC3, 0xF8, 0x00, 0x03, 0x22, 0x27, 0xDC, 0x01, 0x87, 0x38, 0xE6, 0x1C,
0xDC, 0x03, 0x00, 0x05, 0x07, 0x1C, 0xE3, 0x94, 0xA3, 0x8A, 0x0B, 0x04, 0x00, 0xE2, 0x0C, 0xDD, 0x99, 0xF3, 0xFE, 0x61, 0xC0, 0x00, 0x21, 0x50, 0xFE, 0xC0, 0x1C, 0x52, 0x8A, 0x71, 0x41,
0xC0, 0x00, 0x00, 0x70, 0x71, 0xCE, 0x39, 0x4A, 0x30, 0xE0, 0x00, 0x00, 0x00, 0x0C, 0x90, 0x41, 0xC0, 0x3A, 0xE7, 0x14, 0x00, 0x1C, 0x88, 0x9E, 0xDC, 0x01, 0x45, 0x28, 0xA5, 0x14, 0x14,
0xCC, 0x00, 0x00, 0x07, 0x03, 0xF8, 0x7F, 0x1C, 0xE1, 0xFC, 0x0B, 0x04, 0x00, 0x94, 0x8C, 0x14, 0x02, 0xAA, 0x51, 0x40, 0x01, 0x94, 0x13, 0xEE, 0xC0, 0x14, 0x52, 0x8A, 0x51, 0x41, 0x41,
0xC0, 0x00, 0x00, 0xF8, 0x3F, 0x87, 0xF1, 0xC7, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x72, 0x24, 0x40, 0x2A, 0xA5, 0x14, 0x00, 0x12, 0x22, 0x7F, 0xDC, 0x01, 0x47, 0x28, 0xA5, 0x1C, 0x14, 0x14,
0xCC, 0x0B, 0x0C, 0x00, 0x06, 0x15, 0x2C, 0xC0, 0x0B, 0x0C, 0x00, 0x48, 0x89, 0xCC, 0x00, 0x02, 0xAA, 0x51, 0xC0, 0x0E, 0x05, 0x0F, 0x3E, 0xC0, 0x1C, 0x02, 0x8A, 0x70, 0x01, 0x41, 0x4E,
0xFE, 0x10, 0x43, 0xF8, 0xFF, 0x8F, 0xE1, 0xFC, 0x3F, 0x80, 0x00, 0x39, 0x05, 0x3C, 0xC0, 0x2A, 0xA7, 0x00, 0x00, 0xC0, 0x09, 0xF0, 0xCC, 0x00, 0xFC, 0x38, 0xE3, 0xF0, 0x14, 0x17, 0x82,
0x0F, 0xE3, 0x8E, 0x3F, 0x8F, 0xF8, 0xFE, 0x1F, 0xC3, 0xF8, 0x00, 0x03, 0x22, 0x27, 0xDC, 0xAA, 0x3F, 0x00, 0x09, 0x01, 0x3F, 0x8F, 0xC0, 0x03, 0xE1, 0xFC, 0x0F, 0x81, 0x41, 0x78, 0x2A,
0x01, 0x87, 0x38, 0xE6, 0x1C, 0xDD, 0x99, 0xF3, 0xFE, 0x61, 0xC0, 0x00, 0x21, 0x50, 0xFE, 0xA0, 0xF8, 0x01, 0x28, 0x27, 0x98, 0xFC, 0x00, 0x07, 0x0D, 0x80, 0x1C, 0x14, 0x14, 0xE2, 0xAA,
0xC0, 0x1C, 0x52, 0x8A, 0x71, 0x41, 0x41, 0xC0, 0x3A, 0xE7, 0x14, 0x00, 0x1C, 0x88, 0x9E, 0x01, 0xC0, 0x28, 0x40, 0xF8, 0x0C, 0xC0, 0x1C, 0x50, 0x50, 0x71, 0x41, 0x41, 0x40, 0x28, 0xA7,
0xDC, 0x01, 0x45, 0x28, 0xA5, 0x14, 0x14, 0x14, 0x02, 0xAA, 0x51, 0x40, 0x01, 0x94, 0x13, 0x14, 0x03, 0x02, 0x9F, 0xC0, 0xFC, 0x01, 0x45, 0x05, 0x05, 0x14, 0x14, 0x14, 0x02, 0xAA, 0x51,
0xEE, 0xC0, 0x14, 0x52, 0x8A, 0x51, 0x41, 0x41, 0x40, 0x2A, 0xA5, 0x14, 0x00, 0x12, 0x22, 0x40, 0x32, 0x13, 0xCC, 0x0F, 0xC1, 0x94, 0x50, 0x50, 0x51, 0x41, 0x41, 0x40, 0x28, 0xA5, 0x14,
0x7F, 0xDC, 0x01, 0x47, 0x28, 0xA5, 0x1C, 0x14, 0x14, 0x02, 0xAA, 0x51, 0xC0, 0x0E, 0x05, 0x01, 0xF2, 0x7C, 0x00, 0xFC, 0x19, 0x47, 0x05, 0x05, 0x1C, 0x14, 0x1C, 0x02, 0x8A, 0x51, 0xC0,
0x0F, 0x3E, 0xC0, 0x1C, 0x02, 0x8A, 0x70, 0x01, 0x41, 0x4E, 0x2A, 0xA7, 0x00, 0x00, 0xC0, 0x0E, 0x0F, 0xE0, 0x0F, 0xC1, 0x9C, 0x30, 0x70, 0x70, 0xC1, 0x41, 0x9F, 0x28, 0xA7, 0x0C, 0x00,
0x09, 0xF0, 0xCC, 0x00, 0xFC, 0x38, 0xE3, 0xF0, 0x14, 0x17, 0x82, 0xAA, 0x3F, 0x00, 0x09, 0x61, 0xE6, 0x00, 0x3F, 0xF8, 0xFE, 0x07, 0x03, 0xF8, 0x1C, 0x0F, 0xE3, 0x8E, 0x3F, 0x80, 0x03,
0x01, 0x3F, 0x8F, 0xC0, 0x03, 0xE1, 0xFC, 0x0F, 0x81, 0x41, 0x78, 0x2A, 0xA0, 0xF8, 0x01, 0xBE, 0x00, 0x03, 0xFF, 0x8F, 0xE0, 0xF8, 0x3F, 0x81, 0xC0, 0xFE, 0x38, 0xE3, 0xF8, 0x00, 0x1F,
0x28, 0x27, 0x98, 0xFC, 0x00, 0x07, 0x0D, 0x80, 0x1C, 0x14, 0x14, 0xE2, 0xAA, 0x01, 0xC0, 0xF0, 0x0B, 0x0E, 0x00, 0xF3, 0x0B, 0x0E, 0x00, 0x06, 0x00, 0x00
0x28, 0x40, 0xF8, 0x0C, 0xC0, 0x1C, 0x50, 0x50, 0x71, 0x41, 0x41, 0x40, 0x28, 0xA7, 0x14, }};
0x03, 0x02, 0x9F, 0xC0, 0xFC, 0x01, 0x45, 0x05, 0x05, 0x14, 0x14, 0x14, 0x02, 0xAA, 0x51,
0x40, 0x32, 0x13, 0xCC, 0x0F, 0xC1, 0x94, 0x50, 0x50, 0x51, 0x41, 0x41, 0x40, 0x28, 0xA5,
0x14, 0x01, 0xF2, 0x7C, 0x00, 0xFC, 0x19, 0x47, 0x05, 0x05, 0x1C, 0x14, 0x1C, 0x02, 0x8A,
0x51, 0xC0, 0x0E, 0x0F, 0xE0, 0x0F, 0xC1, 0x9C, 0x30, 0x70, 0x70, 0xC1, 0x41, 0x9F, 0x28,
0xA7, 0x0C, 0x00, 0x61, 0xE6, 0x00, 0x3F, 0xF8, 0xFE, 0x07, 0x03, 0xF8, 0x1C, 0x0F, 0xE3,
0x8E, 0x3F, 0x80, 0x03, 0xBE, 0x00, 0x03, 0xFF, 0x8F, 0xE0, 0xF8, 0x3F, 0x81, 0xC0, 0xFE,
0x38, 0xE3, 0xF8, 0x00, 0x1F, 0xF0, 0x0B, 0x0E, 0x00, 0xF3, 0x0B, 0x0E, 0x00, 0x06, 0x00,
0x00}};

View File

@@ -13,10 +13,6 @@
#include "images.h" #include "images.h"
const image_t img_csLogo_Small = { const image_t img_csLogo_Small = { 9, 12, false, 14, 0, {
9, 0xFF, 0xFF, 0xF0, 0x78, 0x3D, 0x06, 0x3F, 0x13, 0x88, 0xC7, 0xE0, 0x7D, 0x3E, 0xF0
12, }};
false,
14,
0,
{0xFF, 0xFF, 0xF0, 0x78, 0x3D, 0x06, 0x3F, 0x13, 0x88, 0xC7, 0xE0, 0x7D, 0x3E, 0xF0}};

View File

@@ -8,10 +8,6 @@
#include "images.h" #include "images.h"
const image_t img_ecp_SCL = { const image_t img_ecp_SCL = { 16, 7, false, 14, 0, {
16, 0x3F, 0x8F, 0x3F, 0x8F, 0x31, 0x8C, 0x31, 0x8C, 0x31, 0x8C, 0xF1, 0xFC, 0xF1, 0xFC
7, }};
false,
14,
0,
{0x3F, 0x8F, 0x3F, 0x8F, 0x31, 0x8C, 0x31, 0x8C, 0x31, 0x8C, 0xF1, 0xFC, 0xF1, 0xFC}};

View File

@@ -13,7 +13,7 @@
#include "images.h" #include "images.h"
const image_t img_ecp_SDA = {17, 12, false, 26, 0, {0x10, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1F, const image_t img_ecp_SDA = { 17, 12, false, 26, 0, {
0xFC, 0x0F, 0xFE, 0x43, 0x00, 0x30, 0xC0, 0x10, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1F, 0xFC, 0x0F, 0xFE, 0x43, 0x00, 0x30, 0xC0, 0x0C, 0x27,
0x0C, 0x27, 0xFF, 0x03, 0xFF, 0x80, 0x01, 0xFF, 0x03, 0xFF, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x80
0x80, 0x01, 0x80, 0x00, 0x80}}; }};

View File

@@ -43,30 +43,24 @@
#include "images.h" #include "images.h"
const image_t img_ecp_port = { const image_t img_ecp_port = { 69, 42, true, 290, 0x04, { // orig:363, comp:20.11%
69, 0x00, 0x2A, 0x04, 0x06, 0xAA, 0xA8, 0x02, 0x04, 0x07, 0xAA, 0x80, 0x2A, 0x04, 0x07, 0xAA, 0x02,
42, 0x04, 0x07, 0xAA, 0xA0, 0x2A, 0x04, 0x07, 0xAA, 0x82, 0x04, 0x07, 0xAA, 0xA8, 0x2A, 0x04, 0x07,
true, 0xAA, 0xA3, 0x04, 0x07, 0xFF, 0xAA, 0x1F, 0x04, 0x06, 0xFF, 0xFE, 0xA8, 0xC0, 0x04, 0x06, 0x00,
290, 0x6A, 0x86, 0x04, 0x06, 0x00, 0x03, 0xAA, 0x30, 0x04, 0x06, 0x00, 0x1A, 0xA1, 0x80, 0x04, 0x06,
0x04, 0x00, 0xEA, 0x8C, 0x04, 0x06, 0x00, 0x06, 0xA8, 0x61, 0x04, 0x05, 0xFF, 0xFC, 0x3A, 0xA3, 0x0F,
{// orig:363, comp:20.11% 0x04, 0x05, 0xFF, 0xE1, 0xAA, 0x18, 0x61, 0x83, 0x0C, 0x18, 0x60, 0xC3, 0x0E, 0xA8, 0xC3, 0x0C,
0x00, 0x2A, 0x04, 0x06, 0xAA, 0xA8, 0x02, 0x04, 0x07, 0xAA, 0x80, 0x2A, 0x04, 0x07, 0xAA, 0x18, 0x60, 0xC3, 0x06, 0x18, 0x6A, 0x86, 0x18, 0x7F, 0xC3, 0xFE, 0x1F, 0xF0, 0xC3, 0xAA, 0x30,
0x02, 0x04, 0x07, 0xAA, 0xA0, 0x2A, 0x04, 0x07, 0xAA, 0x82, 0x04, 0x07, 0xAA, 0xA8, 0x2A, 0xC3, 0xFE, 0x1F, 0xF0, 0xFF, 0x86, 0x1A, 0xA1, 0x86, 0x04, 0x05, 0x00, 0x30, 0xEA, 0xBC, 0x30,
0x04, 0x07, 0xAA, 0xA3, 0x04, 0x07, 0xFF, 0xAA, 0x1F, 0x04, 0x06, 0xFF, 0xFE, 0xA8, 0xC0, 0x04, 0x04, 0x00, 0x01, 0x86, 0xFB, 0xE1, 0x80, 0x04, 0x04, 0x00, 0x0C, 0x3F, 0xFF, 0x0C, 0x04,
0x04, 0x06, 0x00, 0x6A, 0x86, 0x04, 0x06, 0x00, 0x03, 0xAA, 0x30, 0x04, 0x06, 0x00, 0x1A, 0x05, 0x00, 0x61, 0xBE, 0x78, 0x60, 0x04, 0x04, 0x00, 0x03, 0x0F, 0xF8, 0xC3, 0x0F, 0xF8, 0x00,
0xA1, 0x80, 0x04, 0x06, 0x00, 0xEA, 0x8C, 0x04, 0x06, 0x00, 0x06, 0xA8, 0x61, 0x04, 0x05, 0x03, 0xFE, 0x18, 0x6A, 0x86, 0x18, 0x7F, 0xC0, 0x00, 0x1F, 0xF0, 0xC3, 0xAA, 0x30, 0xC3, 0x06,
0xFF, 0xFC, 0x3A, 0xA3, 0x0F, 0x04, 0x05, 0xFF, 0xE1, 0xAA, 0x18, 0x61, 0x83, 0x0C, 0x18, 0x1F, 0xF0, 0xC1, 0x86, 0x1A, 0xA1, 0x86, 0x18, 0x30, 0x80, 0x86, 0x0C, 0x30, 0xEA, 0x8C, 0x3F,
0x60, 0xC3, 0x0E, 0xA8, 0xC3, 0x0C, 0x18, 0x60, 0xC3, 0x06, 0x18, 0x6A, 0x86, 0x18, 0x7F, 0x04, 0x05, 0xFF, 0x86, 0xA8, 0x61, 0x04, 0x05, 0xFF, 0xFC, 0x3A, 0xA3, 0x04, 0x06, 0x00, 0x01,
0xC3, 0xFE, 0x1F, 0xF0, 0xC3, 0xAA, 0x30, 0xC3, 0xFE, 0x1F, 0xF0, 0xFF, 0x86, 0x1A, 0xA1, 0xAA, 0x18, 0x04, 0x06, 0x00, 0x0E, 0xA8, 0xC0, 0x04, 0x06, 0x00, 0x6A, 0x86, 0x00, 0x00, 0x7F,
0x86, 0x04, 0x05, 0x00, 0x30, 0xEA, 0xBC, 0x30, 0x04, 0x04, 0x00, 0x01, 0x86, 0xFB, 0xE1, 0xFF, 0xF0, 0x00, 0x03, 0xAA, 0x30, 0x00, 0x03, 0xFF, 0xFF, 0x80, 0x00, 0x1A, 0xA1, 0x80, 0x00,
0x80, 0x04, 0x04, 0x00, 0x0C, 0x3F, 0xFF, 0x0C, 0x04, 0x05, 0x00, 0x61, 0xBE, 0x78, 0x60, 0x1A, 0xA0, 0x0C, 0x00, 0x00, 0xEA, 0x0C, 0x00, 0x00, 0xEA, 0x00, 0x60, 0x00, 0x06, 0xA0, 0x60,
0x04, 0x04, 0x00, 0x03, 0x0F, 0xF8, 0xC3, 0x0F, 0xF8, 0x00, 0x03, 0xFE, 0x18, 0x6A, 0x86, 0x00, 0x06, 0xA0, 0x03, 0x00, 0x00, 0x3A, 0x03, 0x00, 0x00, 0x3A, 0x00, 0x18, 0x00, 0x01, 0xA0,
0x18, 0x7F, 0xC0, 0x00, 0x1F, 0xF0, 0xC3, 0xAA, 0x30, 0xC3, 0x06, 0x1F, 0xF0, 0xC1, 0x86, 0x1F, 0xFF, 0xFF, 0xA0, 0x00, 0xFF, 0xFF, 0xFE, 0x00, 0xFF, 0xFF, 0xFE, 0x00, 0x07, 0xFF, 0xFF,
0x1A, 0xA1, 0x86, 0x18, 0x30, 0x80, 0x86, 0x0C, 0x30, 0xEA, 0x8C, 0x3F, 0x04, 0x05, 0xFF, 0xE0, 0x00
0x86, 0xA8, 0x61, 0x04, 0x05, 0xFF, 0xFC, 0x3A, 0xA3, 0x04, 0x06, 0x00, 0x01, 0xAA, 0x18, }};
0x04, 0x06, 0x00, 0x0E, 0xA8, 0xC0, 0x04, 0x06, 0x00, 0x6A, 0x86, 0x00, 0x00, 0x7F, 0xFF,
0xF0, 0x00, 0x03, 0xAA, 0x30, 0x00, 0x03, 0xFF, 0xFF, 0x80, 0x00, 0x1A, 0xA1, 0x80, 0x00,
0x1A, 0xA0, 0x0C, 0x00, 0x00, 0xEA, 0x0C, 0x00, 0x00, 0xEA, 0x00, 0x60, 0x00, 0x06, 0xA0,
0x60, 0x00, 0x06, 0xA0, 0x03, 0x00, 0x00, 0x3A, 0x03, 0x00, 0x00, 0x3A, 0x00, 0x18, 0x00,
0x01, 0xA0, 0x1F, 0xFF, 0xFF, 0xA0, 0x00, 0xFF, 0xFF, 0xFE, 0x00, 0xFF, 0xFF, 0xFE, 0x00,
0x07, 0xFF, 0xFF, 0xE0, 0x00}};

View File

@@ -10,5 +10,6 @@
#include "images.h" #include "images.h"
const image_t img_key_Back = const image_t img_key_Back = { 9, 9, false, 11, 0, {
{9, 9, false, 11, 0, {0x7F, 0x7F, 0xFB, 0xF8, 0x7E, 0xDF, 0xEF, 0xCF, 0xFF, 0x3F, 0x00}}; 0x7F, 0x7F, 0xFB, 0xF8, 0x7E, 0xDF, 0xEF, 0xCF, 0xFF, 0x3F, 0x00
}};

View File

@@ -9,5 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_key_D = const image_t img_key_D = { 9, 8, false, 9, 0, {
{9, 8, false, 9, 0, {0x7F, 0x7F, 0xFF, 0xF8, 0x3E, 0x3F, 0xBF, 0xFE, 0xFE}}; 0x7F, 0x7F, 0xFF, 0xF8, 0x3E, 0x3F, 0xBF, 0xFE, 0xFE
}};

View File

@@ -10,5 +10,6 @@
#include "images.h" #include "images.h"
const image_t img_key_L = const image_t img_key_L = { 8, 9, false, 9, 0, {
{8, 9, false, 9, 0, {0x7E, 0xFF, 0xF7, 0xE7, 0xC7, 0xE7, 0xF7, 0xFF, 0x7E}}; 0x7E, 0xFF, 0xF7, 0xE7, 0xC7, 0xE7, 0xF7, 0xFF, 0x7E
}};

View File

@@ -10,5 +10,6 @@
#include "images.h" #include "images.h"
const image_t img_key_OK = const image_t img_key_OK = { 9, 9, false, 11, 0, {
{9, 9, false, 11, 0, {0x7F, 0x7F, 0xF8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8F, 0xFF, 0x3F, 0x00}}; 0x7F, 0x7F, 0xF8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8F, 0xFF, 0x3F, 0x00
}};

View File

@@ -10,5 +10,6 @@
#include "images.h" #include "images.h"
const image_t img_key_OKi = const image_t img_key_OKi = { 9, 9, false, 11, 0, {
{9, 9, false, 11, 0, {0x7F, 0x60, 0xE7, 0x37, 0xDB, 0xED, 0xF6, 0x73, 0x83, 0x7F, 0x00}}; 0x7F, 0x60, 0xE7, 0x37, 0xDB, 0xED, 0xF6, 0x73, 0x83, 0x7F, 0x00
}};

View File

@@ -10,5 +10,6 @@
#include "images.h" #include "images.h"
const image_t img_key_R = const image_t img_key_R = { 8, 9, false, 9, 0, {
{8, 9, false, 9, 0, {0x7E, 0xFF, 0xEF, 0xE7, 0xE3, 0xE7, 0xEF, 0xFF, 0x7E}}; 0x7E, 0xFF, 0xEF, 0xE7, 0xE3, 0xE7, 0xEF, 0xFF, 0x7E
}};

View File

@@ -9,5 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_key_U = const image_t img_key_U = { 9, 8, false, 9, 0, {
{9, 8, false, 9, 0, {0x7F, 0x7F, 0xFD, 0xFC, 0x7C, 0x1F, 0xFF, 0xFE, 0xFE}}; 0x7F, 0x7F, 0xFD, 0xFC, 0x7C, 0x1F, 0xFF, 0xFE, 0xFE
}};

View File

@@ -9,5 +9,6 @@
#include "images.h" #include "images.h"
const image_t img_key_Ui = const image_t img_key_Ui = { 9, 8, false, 9, 0, {
{9, 8, false, 9, 0, {0x7F, 0x60, 0xE2, 0x33, 0x9B, 0xEC, 0x07, 0x06, 0xFE}}; 0x7F, 0x60, 0xE2, 0x33, 0x9B, 0xEC, 0x07, 0x06, 0xFE
}};

View File

@@ -48,62 +48,54 @@ void furi_hal_i2c_release (FuriHalI2cBusHandle* handle)
#define ENABLE_WORKAROUND 1 #define ENABLE_WORKAROUND 1
#if ENABLE_WORKAROUND == 1 #if ENABLE_WORKAROUND == 1
//+============================================================================ ======================================== //+============================================================================ ========================================
static inline bool furi_hal_Wi2c_is_device_ready( static inline
FuriHalI2cBusHandle* const bus, bool furi_hal_Wi2c_is_device_ready (FuriHalI2cBusHandle* const bus, const uint8_t addr, const uint32_t tmo)
const uint8_t addr, {
const uint32_t tmo) {
furi_hal_i2c_acquire(bus); furi_hal_i2c_acquire(bus);
bool rv = furi_hal_i2c_is_device_ready(bus, addr, tmo); bool rv = furi_hal_i2c_is_device_ready(bus, addr, tmo);
furi_hal_i2c_release(bus); furi_hal_i2c_release(bus);
return rv; return rv;
} }
//+============================================================================ //+============================================================================
static inline bool furi_hal_Wi2c_tx( static inline
FuriHalI2cBusHandle* const bus, bool furi_hal_Wi2c_tx ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
const uint8_t addr, const void* buf, const size_t len, const uint32_t tmo )
const void* buf, {
const size_t len,
const uint32_t tmo) {
furi_hal_i2c_acquire(bus); furi_hal_i2c_acquire(bus);
bool rv = furi_hal_i2c_tx(bus, addr, buf, len, tmo); bool rv = furi_hal_i2c_tx(bus, addr, buf, len, tmo);
furi_hal_i2c_release(bus); furi_hal_i2c_release(bus);
return rv; return rv;
} }
//+============================================================================ //+============================================================================
static inline bool furi_hal_Wi2c_rx( static inline
FuriHalI2cBusHandle* const bus, bool furi_hal_Wi2c_rx ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
const uint8_t addr, void* buf, const size_t len, const uint32_t tmo )
void* buf, {
const size_t len,
const uint32_t tmo) {
furi_hal_i2c_acquire(bus); furi_hal_i2c_acquire(bus);
bool rv = furi_hal_i2c_rx(bus, addr, buf, len, tmo); bool rv = furi_hal_i2c_rx(bus, addr, buf, len, tmo);
furi_hal_i2c_release(bus); furi_hal_i2c_release(bus);
return rv; return rv;
} }
//+============================================================================ //+============================================================================
static inline bool furi_hal_Wi2c_trx( static inline
FuriHalI2cBusHandle* const bus, bool furi_hal_Wi2c_trx ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
const uint8_t addr, const void* tx, const size_t txlen,
const void* tx, void* rx, const size_t rxlen, const uint32_t tmo )
const size_t txlen, {
void* rx,
const size_t rxlen,
const uint32_t tmo) {
bool rv = furi_hal_Wi2c_tx(bus, addr, tx, txlen, tmo); bool rv = furi_hal_Wi2c_tx(bus, addr, tx, txlen, tmo);
if(rv) rv = furi_hal_Wi2c_rx(bus, addr, rx, rxlen, tmo); if (rv) rv = furi_hal_Wi2c_rx(bus, addr, rx, rxlen, tmo);
return rv; return rv;
} }
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
#define furi_hal_i2c_is_device_ready(...) furi_hal_Wi2c_is_device_ready(__VA_ARGS__) # define furi_hal_i2c_is_device_ready(...) furi_hal_Wi2c_is_device_ready(__VA_ARGS__)
#define furi_hal_i2c_tx(...) furi_hal_Wi2c_tx(__VA_ARGS__) # define furi_hal_i2c_tx(...) furi_hal_Wi2c_tx(__VA_ARGS__)
#define furi_hal_i2c_rx(...) furi_hal_Wi2c_rx(__VA_ARGS__) # define furi_hal_i2c_rx(...) furi_hal_Wi2c_rx(__VA_ARGS__)
#define furi_hal_i2c_trx(...) furi_hal_Wi2c_trx(__VA_ARGS__) # define furi_hal_i2c_trx(...) furi_hal_Wi2c_trx(__VA_ARGS__)
#endif //ENABLE_WORKAROUND #endif //ENABLE_WORKAROUND
@@ -111,17 +103,13 @@ static inline bool furi_hal_Wi2c_trx(
// Some devices take a moment to respond to read requests // Some devices take a moment to respond to read requests
// The puts a delay between the address being set and the data being read // The puts a delay between the address being set and the data being read
// //
static inline bool furi_hal_i2c_trxd( static inline
FuriHalI2cBusHandle* const bus, bool furi_hal_i2c_trxd ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
const uint8_t addr, const void* tx, const size_t txlen,
const void* tx, void* rx, const size_t rxlen, const uint32_t tmo, const uint32_t us )
const size_t txlen, {
void* rx,
const size_t rxlen,
const uint32_t tmo,
const uint32_t us) {
bool rv = furi_hal_i2c_tx(bus, addr, tx, txlen, tmo); bool rv = furi_hal_i2c_tx(bus, addr, tx, txlen, tmo);
if(rv) { if (rv) {
furi_delay_us(us); furi_delay_us(us);
rv = furi_hal_i2c_rx(bus, addr, rx, rxlen, tmo); rv = furi_hal_i2c_rx(bus, addr, rx, rxlen, tmo);
} }

View File

@@ -1,87 +0,0 @@
//+============================================================================ ========================================
// Select font
// A full list of u8g2 fonts can be found here:
// https://github.com/olikraus/u8g2/wiki/fntlistall
// ...and here are the ones available in FZ (currently: all of them):
// grep -P '.*u8g2.*\[[0-9]*\]' lib/u8g2/u8g2_fonts.c | sed 's/.*\(u8g2_.*\)\[.*/\1/'
//
#if 0 //! Extra fonts is just too memory hungry
#include <u8g2.h>
void setFont (Canvas* const canvas, const uint8_t* font)
{
u8g2_SetFontMode(&canvas->fb, 1); // no idea - but canvas.c does it <shrug>
u8g2_SetFont(&canvas->fb, font);
}
#endif
litui : @BlueChip for posterity, the function to break at is flipper_application_spawn. At that point, you can set new breakpoints in your fap code and continue.
/*
This is wrong on quite a few levels!
https://training.ti.com/introduction-i2c-reserved-addresses
void doit (void)
{
furi_hal_i2c_acquire(&furi_hal_i2c_handle_external);
printf("Scanning external i2c on PC0(SCL)/PC1(SDA)\r\n"
"Clock: 100khz, 7bit address\r\n"
"\r\n");
printf(" | 0 1 2 3 4 5 6 7 8 9 A B C D E F\r\n");
printf("--+--------------------------------\r\n");
for(uint8_t row = 0; row < 0x8; row++) {
printf("%x | ", row);
for(uint8_t column = 0; column <= 0xF; column++) {
bool ret = furi_hal_i2c_is_device_ready(
&furi_hal_i2c_handle_external, ((row << 4) + column) << 1, 2);
printf("%c ", ret ? '#' : '-');
}
printf("\r\n");
}
furi_hal_i2c_release(&furi_hal_i2c_handle_external);
}
*/
region locking : firmware/targets/f7/furi_hal/furi_hal_region.c
# if 0 //! scrolling works beautifully, but the LCD refresh can't keep up :(
// Waveform
if (cnt) { // start
for (int a = ACC_1; a < ACC_N; a++) {
canvas_draw_dot(canvas, x,y[a]+v[a][idx]);
for (int i = 1; i < aw -cnt; i++) {
canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
}
}
} else { // scroll
for (int a = ACC_1; a < ACC_N; a++) {
for (int i = 0; i < aw; i++) {
int off = (idx +i) %aw;
int prev = off ? off-1 : aw-1;
canvas_draw_line(canvas, x+i,y[a]+v[a][prev] , x+i,y[a]+v[a][off]);
}
}
}
# else
int end = idx ? idx : aw;
for (int a = ACC_1; a < ACC_N; a++) {
canvas_draw_dot(canvas, x,y[a]+v[a][idx]);
if (state->apause) {
for (int i = 1; i < end; i++)
canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
} else {
for (int i = 1; i < end; i++)
canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
for (int i = end+10; i < aw -cnt; i++)
canvas_draw_line(canvas, x+i,y[a]+v[a][i-1] , x+i,y[a]+v[a][i]);
}
}
// Wipe bar
if (end < aw) canvas_draw_line(canvas, x+end,y[0], x+end,y[2]+ah-1);
if (++end < aw) canvas_draw_line(canvas, x+end,y[0], x+end,y[2]+ah-1);
if (++end < aw) canvas_draw_line(canvas, x+end,y[0], x+end,y[2]+ah-1);
# endif

View File

@@ -44,7 +44,9 @@
// OS Callback : Timer tick // OS Callback : Timer tick
// We register this function to be called when the OS signals a timer 'tick' event // We register this function to be called when the OS signals a timer 'tick' event
// //
static void cbTimer(FuriMessageQueue* queue) { static
void cbTimer (FuriMessageQueue* queue)
{
ENTER; ENTER;
furi_assert(queue); furi_assert(queue);
@@ -59,7 +61,9 @@ static void cbTimer(FuriMessageQueue* queue) {
// OS Callback : Keypress // OS Callback : Keypress
// We register this function to be called when the OS detects a keypress // We register this function to be called when the OS detects a keypress
// //
static void cbInput(InputEvent* event, FuriMessageQueue* queue) { static
void cbInput (InputEvent* event, FuriMessageQueue* queue)
{
ENTER; ENTER;
furi_assert(queue); furi_assert(queue);
furi_assert(event); furi_assert(event);
@@ -75,11 +79,13 @@ static void cbInput(InputEvent* event, FuriMessageQueue* queue) {
//+============================================================================ //+============================================================================
// Show version number // Show version number
// //
static void showVer(Canvas* const canvas) { static
show(canvas, 0, 59, &img_3x5_v, SHOW_SET_BLK); void showVer (Canvas* const canvas)
show(canvas, 4, 59, VER_MAJ, SHOW_SET_BLK); {
canvas_draw_frame(canvas, 8, 62, 2, 2); show(canvas, 0,59, &img_3x5_v, SHOW_SET_BLK);
show(canvas, 11, 59, VER_MIN, SHOW_SET_BLK); show(canvas, 4,59, VER_MAJ, SHOW_SET_BLK);
canvas_draw_frame(canvas, 8,62, 2,2);
show(canvas, 11,59, VER_MIN, SHOW_SET_BLK);
} }
//+============================================================================ //+============================================================================
@@ -89,7 +95,9 @@ static void showVer(Canvas* const canvas) {
// We actually instruct the OS to perform this request, after we update the interface // We actually instruct the OS to perform this request, after we update the interface
// I guess it's possible that this instruction may able be issued by other threads !? // I guess it's possible that this instruction may able be issued by other threads !?
// //
static void cbDraw(Canvas* const canvas, void* ctx) { static
void cbDraw (Canvas* const canvas, void* ctx)
{
ENTER; ENTER;
furi_assert(canvas); furi_assert(canvas);
furi_assert(ctx); furi_assert(ctx);
@@ -97,16 +105,16 @@ static void cbDraw(Canvas* const canvas, void* ctx) {
state_t* state = NULL; state_t* state = NULL;
// Try to acquire the mutex for the plugin state variables, timeout = 25mS // Try to acquire the mutex for the plugin state variables, timeout = 25mS
if(!(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25))) return; if ( !(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25)) ) return ;
switch(state->scene) { switch (state->scene) {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
case SCENE_SPLASH: case SCENE_SPLASH:
show(canvas, 2, 0, &img_csLogo_FULL, SHOW_SET_BLK); show(canvas, 2,0, &img_csLogo_FULL, SHOW_SET_BLK);
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned(canvas, 64, 43, AlignCenter, AlignTop, "Wii Extension Controller"); canvas_draw_str_aligned(canvas, 64,43, AlignCenter, AlignTop, "Wii Extension Controller");
canvas_draw_str_aligned(canvas, 64, 55, AlignCenter, AlignTop, "Protocol Analyser"); canvas_draw_str_aligned(canvas, 64,55, AlignCenter, AlignTop, "Protocol Analyser");
showVer(canvas); showVer(canvas);
@@ -114,66 +122,66 @@ static void cbDraw(Canvas* const canvas, void* ctx) {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
case SCENE_RIP: case SCENE_RIP:
show(canvas, 0, 0, &img_RIP, SHOW_SET_BLK); show(canvas, 0,0, &img_RIP, SHOW_SET_BLK);
break; break;
//--------------------------------------------------------------------- //---------------------------------------------------------------------
case SCENE_WAIT: case SCENE_WAIT:
#define xo 2 # define xo 2
show(canvas, 3 + xo, 10, &img_ecp_port, SHOW_SET_BLK); show(canvas, 3+xo,10, &img_ecp_port, SHOW_SET_BLK);
BOX_TL(22 + xo, 6, 82 + xo, 23); // 3v3 BOX_TL(22+xo, 6, 82+xo,23); // 3v3
BOX_TL(48 + xo, 21, 82 + xo, 23); // C1 BOX_TL(48+xo,21, 82+xo,23); // C1
BOX_BL(22 + xo, 41, 82 + xo, 58); // C0 BOX_BL(22+xo,41, 82+xo,58); // C0
BOX_BL(48 + xo, 41, 82 + xo, 44); // Gnd BOX_BL(48+xo,41, 82+xo,44); // Gnd
show(canvas, 90 + xo, 3, &img_6x8_3, SHOW_SET_BLK); // 3v3 show(canvas, 90+xo, 3, &img_6x8_3, SHOW_SET_BLK); // 3v3
show(canvas, 97 + xo, 3, &img_6x8_v, SHOW_SET_BLK); show(canvas, 97+xo, 3, &img_6x8_v, SHOW_SET_BLK);
show(canvas, 104 + xo, 3, &img_6x8_3, SHOW_SET_BLK); show(canvas, 104+xo, 3, &img_6x8_3, SHOW_SET_BLK);
show(canvas, 90 + xo, 18, &img_6x8_C, SHOW_SET_BLK); // C1 <-> show(canvas, 90+xo,18, &img_6x8_C, SHOW_SET_BLK); // C1 <->
show(canvas, 98 + xo, 18, &img_6x8_1, SHOW_SET_BLK); show(canvas, 98+xo,18, &img_6x8_1, SHOW_SET_BLK);
show(canvas, 107 + xo, 16, &img_ecp_SDA, SHOW_SET_BLK); show(canvas, 107+xo,16, &img_ecp_SDA, SHOW_SET_BLK);
show(canvas, 90 + xo, 40, &img_6x8_G, SHOW_SET_BLK); // Gnd show(canvas, 90+xo,40, &img_6x8_G, SHOW_SET_BLK); // Gnd
show(canvas, 97 + xo, 40, &img_6x8_n, SHOW_SET_BLK); show(canvas, 97+xo,40, &img_6x8_n, SHOW_SET_BLK);
show(canvas, 104 + xo, 40, &img_6x8_d, SHOW_SET_BLK); show(canvas, 104+xo,40, &img_6x8_d, SHOW_SET_BLK);
show(canvas, 90 + xo, 54, &img_6x8_C, SHOW_SET_BLK); // C0 _-_- show(canvas, 90+xo,54, &img_6x8_C, SHOW_SET_BLK); // C0 _-_-
show(canvas, 98 + xo, 54, &img_6x8_0, SHOW_SET_BLK); show(canvas, 98+xo,54, &img_6x8_0, SHOW_SET_BLK);
show(canvas, 108 + xo, 54, &img_ecp_SCL, SHOW_SET_BLK); show(canvas, 108+xo,54, &img_ecp_SCL, SHOW_SET_BLK);
show(canvas, 0, 0, &img_csLogo_Small, SHOW_SET_BLK); show(canvas, 0,0, &img_csLogo_Small, SHOW_SET_BLK);
showVer(canvas); showVer(canvas);
#undef xo # undef xo
break; break;
//--------------------------------------------------------------------- //---------------------------------------------------------------------
case SCENE_DEBUG: case SCENE_DEBUG:
canvas_set_font(canvas, FontSecondary); canvas_set_font(canvas, FontSecondary);
show(canvas, 0, 0, &img_key_U, SHOW_SET_BLK); show(canvas, 0,0, &img_key_U, SHOW_SET_BLK);
canvas_draw_str_aligned(canvas, 11, 0, AlignLeft, AlignTop, "Initialise Perhipheral"); canvas_draw_str_aligned(canvas, 11, 0, AlignLeft, AlignTop, "Initialise Perhipheral");
show(canvas, 0, 11, &img_key_OK, SHOW_SET_BLK); show(canvas, 0,11, &img_key_OK, SHOW_SET_BLK);
canvas_draw_str_aligned(canvas, 11, 11, AlignLeft, AlignTop, "Read values [see log]"); canvas_draw_str_aligned(canvas, 11,11, AlignLeft, AlignTop, "Read values [see log]");
show(canvas, 0, 23, &img_key_D, SHOW_SET_BLK); show(canvas, 0,23, &img_key_D, SHOW_SET_BLK);
canvas_draw_str_aligned(canvas, 11, 22, AlignLeft, AlignTop, "Restart Scanner"); canvas_draw_str_aligned(canvas, 11,22, AlignLeft, AlignTop, "Restart Scanner");
show(canvas, 0, 33, &img_key_Back, SHOW_SET_BLK); show(canvas, 0,33, &img_key_Back, SHOW_SET_BLK);
canvas_draw_str_aligned(canvas, 11, 33, AlignLeft, AlignTop, "Exit"); canvas_draw_str_aligned(canvas, 11,33, AlignLeft, AlignTop, "Exit");
break; break ;
//--------------------------------------------------------------------- //---------------------------------------------------------------------
default: default:
if(state->ec.pidx >= PID_ERROR) { if (state->ec.pidx >= PID_ERROR) {
ERROR("%s : bad PID = %d", __func__, state->ec.pidx); ERROR("%s : bad PID = %d", __func__, state->ec.pidx);
} else { } else {
if((state->scene == SCENE_DUMP) || !ecId[state->ec.pidx].show) if ((state->scene == SCENE_DUMP) || !ecId[state->ec.pidx].show)
ecId[PID_UNKNOWN].show(canvas, state); ecId[PID_UNKNOWN].show(canvas, state);
else else
ecId[state->ec.pidx].show(canvas, state); ecId[state->ec.pidx].show(canvas, state);
@@ -199,7 +207,9 @@ static void cbDraw(Canvas* const canvas, void* ctx) {
//+============================================================================ ======================================== //+============================================================================ ========================================
// Initialise plugin state variables // Initialise plugin state variables
// //
static inline bool stateInit(state_t* const state) { static inline
bool stateInit (state_t* const state)
{
ENTER; ENTER;
furi_assert(state); furi_assert(state);
@@ -243,7 +253,7 @@ static inline bool stateInit(state_t* const state) {
// Seed the PRNG // Seed the PRNG
// CYCCNT --> lib/STM32CubeWB/Drivers/CMSIS/Include/core_cm7.h // CYCCNT --> lib/STM32CubeWB/Drivers/CMSIS/Include/core_cm7.h
// srand(DWT->CYCCNT); // srand(DWT->CYCCNT);
LEAVE; LEAVE;
return rv; return rv;
@@ -260,17 +270,18 @@ static inline bool stateInit(state_t* const state) {
//+============================================================================ ======================================== //+============================================================================ ========================================
// Enable/Disable scanning // Enable/Disable scanning
// //
void timerEn(state_t* state, bool on) { void timerEn (state_t* state, bool on)
{
ENTER; ENTER;
furi_assert(state); furi_assert(state);
// ENable scanning // ENable scanning
if(on) { if (on) {
if(state->timerEn) { if (state->timerEn) {
WARN(wii_errs[WARN_SCAN_START]); WARN(wii_errs[WARN_SCAN_START]);
} else { } else {
// Set the timer to fire at 'fps' times/second // Set the timer to fire at 'fps' times/second
if(furi_timer_start(state->timer, state->timerHz / state->fps) == FuriStatusOk) { if (furi_timer_start(state->timer, state->timerHz/state->fps) == FuriStatusOk) {
state->timerEn = true; state->timerEn = true;
INFO("%s : monitor started", __func__); INFO("%s : monitor started", __func__);
} else { } else {
@@ -280,11 +291,11 @@ void timerEn(state_t* state, bool on) {
// DISable scanning // DISable scanning
} else { } else {
if(!state->timerEn) { if (!state->timerEn) {
WARN(wii_errs[WARN_SCAN_STOP]); WARN(wii_errs[WARN_SCAN_STOP]);
} else { } else {
// Stop the timer // Stop the timer
if(furi_timer_stop(state->timer) == FuriStatusOk) { if (furi_timer_stop(state->timer) == FuriStatusOk) {
state->timerEn = false; state->timerEn = false;
INFO("%s : monitor stopped", __func__); INFO("%s : monitor stopped", __func__);
} else { } else {
@@ -300,7 +311,8 @@ void timerEn(state_t* state, bool on) {
//+============================================================================ ======================================== //+============================================================================ ========================================
// Plugin entry point // Plugin entry point
// //
int32_t wii_ec_anal(void) { int32_t wii_ec_anal (void)
{
ENTER; ENTER;
// ===== Variables ===== // ===== Variables =====
@@ -311,7 +323,7 @@ int32_t wii_ec_anal(void) {
ValueMutex mutex = {0}; ValueMutex mutex = {0};
FuriMessageQueue* queue = NULL; FuriMessageQueue* queue = NULL;
const uint32_t queueSz = 20; // maximum messages in queue const uint32_t queueSz = 20; // maximum messages in queue
uint32_t tmo = (3.5f * 1000); // timeout splash screen after N seconds uint32_t tmo = (3.5f *1000); // timeout splash screen after N seconds
// The queue will contain plugin event-messages // The queue will contain plugin event-messages
// --> local // --> local
@@ -321,39 +333,39 @@ int32_t wii_ec_anal(void) {
// ===== Message queue ===== // ===== Message queue =====
// 1. Create a message queue (for up to 8 (keyboard) event messages) // 1. Create a message queue (for up to 8 (keyboard) event messages)
if(!(queue = furi_message_queue_alloc(queueSz, sizeof(msg)))) { if ( !(queue = furi_message_queue_alloc(queueSz, sizeof(msg))) ) {
ERROR(wii_errs[(error = ERR_MALLOC_QUEUE)]); ERROR(wii_errs[(error = ERR_MALLOC_QUEUE)]);
goto bail; goto bail;
} }
// ===== Create GUI Interface ===== // ===== Create GUI Interface =====
// 2. Create a GUI interface // 2. Create a GUI interface
if(!(gui = furi_record_open("gui"))) { if ( !(gui = furi_record_open("gui")) ) {
ERROR(wii_errs[(error = ERR_NO_GUI)]); ERROR(wii_errs[(error = ERR_NO_GUI)]);
goto bail; goto bail;
} }
// ===== Plugin state variables ===== // ===== Plugin state variables =====
// 3. Allocate space on the heap for the plugin state variables // 3. Allocate space on the heap for the plugin state variables
if(!(state = malloc(sizeof(state_t)))) { if ( !(state = malloc(sizeof(state_t))) ) {
ERROR(wii_errs[(error = ERR_MALLOC_STATE)]); ERROR(wii_errs[(error = ERR_MALLOC_STATE)]);
goto bail; goto bail;
} }
// 4. Initialise the plugin state variables // 4. Initialise the plugin state variables
if(!stateInit(state)) { if (!stateInit(state)) {
// error message(s) is/are output by stateInit() // error message(s) is/are output by stateInit()
error = 15; error = 15;
goto bail; goto bail;
} }
// 5. Create a mutex for (reading/writing) the plugin state variables // 5. Create a mutex for (reading/writing) the plugin state variables
if(!init_mutex(&mutex, state, sizeof(state))) { if (!init_mutex(&mutex, state, sizeof(state))) {
ERROR(wii_errs[(error = ERR_NO_MUTEX)]); ERROR(wii_errs[(error = ERR_NO_MUTEX)]);
goto bail; goto bail;
} }
// ===== Viewport ===== // ===== Viewport =====
// 6. Allocate space on the heap for the viewport // 6. Allocate space on the heap for the viewport
if(!(vpp = view_port_alloc())) { if ( !(vpp = view_port_alloc()) ) {
ERROR(wii_errs[(error = ERR_MALLOC_VIEW)]); ERROR(wii_errs[(error = ERR_MALLOC_VIEW)]);
goto bail; goto bail;
} }
@@ -368,14 +380,14 @@ int32_t wii_ec_anal(void) {
// ===== Timer ===== // ===== Timer =====
// 9. Allocate a timer // 9. Allocate a timer
if(!(state->timer = furi_timer_alloc(cbTimer, FuriTimerTypePeriodic, queue))) { if ( !(state->timer = furi_timer_alloc(cbTimer, FuriTimerTypePeriodic, queue)) ) {
ERROR(wii_errs[(error = ERR_NO_TIMER)]); ERROR(wii_errs[(error = ERR_NO_TIMER)]);
goto bail; goto bail;
} }
// === System Notifications === // === System Notifications ===
// 10. Acquire a handle for the system notification queue // 10. Acquire a handle for the system notification queue
if(!(state->notify = furi_record_open(RECORD_NOTIFICATION))) { if ( !(state->notify = furi_record_open(RECORD_NOTIFICATION)) ) {
ERROR(wii_errs[(error = ERR_NO_NOTIFY)]); ERROR(wii_errs[(error = ERR_NO_NOTIFY)]);
goto bail; goto bail;
} }
@@ -385,21 +397,20 @@ int32_t wii_ec_anal(void) {
// ==================== Main event loop ==================== // ==================== Main event loop ====================
if(state->run) do { if (state->run) do {
bool redraw = false; bool redraw = false;
FuriStatus status = FuriStatusErrorTimeout; FuriStatus status = FuriStatusErrorTimeout;
// Wait for a message // Wait for a message
// while ((status = furi_message_queue_get(queue, &msg, tmo)) == FuriStatusErrorTimeout) ; // while ((status = furi_message_queue_get(queue, &msg, tmo)) == FuriStatusErrorTimeout) ;
status = furi_message_queue_get(queue, &msg, tmo); status = furi_message_queue_get(queue, &msg, tmo);
// Clear splash screen // Clear splash screen
if((state->scene == SCENE_SPLASH) && if ( (state->scene == SCENE_SPLASH) && (state->scenePrev == SCENE_NONE) && // Initial splash
(state->scenePrev == SCENE_NONE) && // Initial splash ( (status == FuriStatusErrorTimeout) || // timeout
((status == FuriStatusErrorTimeout) || // timeout ((msg.id == EVID_KEY) && (msg.input.type == InputTypeShort)) ) // or <any> key-short
((msg.id == EVID_KEY) && (msg.input.type == InputTypeShort))) // or <any> key-short
) { ) {
tmo = 60 * 1000; // increase message-wait timeout to 60secs tmo = 60 *1000; // increase message-wait timeout to 60secs
timerEn(state, true); // start scanning the i2c bus timerEn(state, true); // start scanning the i2c bus
status = FuriStatusOk; // pass status check status = FuriStatusOk; // pass status check
msg.id = EVID_NONE; // valid msg ID msg.id = EVID_NONE; // valid msg ID
@@ -407,41 +418,27 @@ int32_t wii_ec_anal(void) {
} }
// Check for queue errors // Check for queue errors
if(status != FuriStatusOk) { if (status != FuriStatusOk) {
switch(status) { switch (status) {
case FuriStatusErrorTimeout: case FuriStatusErrorTimeout: DEBUG(wii_errs[DEBUG_QUEUE_TIMEOUT]); continue ;
DEBUG(wii_errs[DEBUG_QUEUE_TIMEOUT]); case FuriStatusError: ERROR(wii_errs[(error = ERR_QUEUE_RTOS)]); goto bail ;
continue; case FuriStatusErrorResource: ERROR(wii_errs[(error = ERR_QUEUE_RESOURCE)]); goto bail ;
case FuriStatusError: case FuriStatusErrorParameter: ERROR(wii_errs[(error = ERR_QUEUE_BADPRM)]); goto bail ;
ERROR(wii_errs[(error = ERR_QUEUE_RTOS)]); case FuriStatusErrorNoMemory: ERROR(wii_errs[(error = ERR_QUEUE_NOMEM)]); goto bail ;
goto bail; case FuriStatusErrorISR: ERROR(wii_errs[(error = ERR_QUEUE_ISR)]); goto bail ;
case FuriStatusErrorResource: default: ERROR(wii_errs[(error = ERR_QUEUE_UNK)]); goto bail ;
ERROR(wii_errs[(error = ERR_QUEUE_RESOURCE)]);
goto bail;
case FuriStatusErrorParameter:
ERROR(wii_errs[(error = ERR_QUEUE_BADPRM)]);
goto bail;
case FuriStatusErrorNoMemory:
ERROR(wii_errs[(error = ERR_QUEUE_NOMEM)]);
goto bail;
case FuriStatusErrorISR:
ERROR(wii_errs[(error = ERR_QUEUE_ISR)]);
goto bail;
default:
ERROR(wii_errs[(error = ERR_QUEUE_UNK)]);
goto bail;
} }
} }
// Read successful // Read successful
// *** Try to lock the plugin state variables *** // *** Try to lock the plugin state variables ***
if(!(state = (state_t*)acquire_mutex_block(&mutex))) { if ( !(state = (state_t*)acquire_mutex_block(&mutex)) ) {
ERROR(wii_errs[(error = ERR_MUTEX_BLOCK)]); ERROR(wii_errs[(error = ERR_MUTEX_BLOCK)]);
goto bail; goto bail;
} }
// *** Handle events *** // *** Handle events ***
switch(msg.id) { switch (msg.id) {
//--------------------------------------------- //---------------------------------------------
case EVID_TICK: // Timer events case EVID_TICK: // Timer events
//! I would prefer to have ecPoll() called by cbTimer() //! I would prefer to have ecPoll() called by cbTimer()
@@ -453,13 +450,13 @@ int32_t wii_ec_anal(void) {
//--------------------------------------------- //---------------------------------------------
case EVID_WIIEC: // WiiMote Perhipheral case EVID_WIIEC: // WiiMote Perhipheral
if(evWiiEC(&msg, state)) redraw = true; if (evWiiEC(&msg, state)) redraw = true ;
break; break;
//--------------------------------------------- //---------------------------------------------
case EVID_KEY: // Key events case EVID_KEY: // Key events
patBacklight(state); patBacklight(state);
if(evKey(&msg, state)) redraw = true; if (evKey(&msg, state)) redraw = true;
break; break;
//--------------------------------------------- //---------------------------------------------
@@ -473,27 +470,27 @@ int32_t wii_ec_anal(void) {
} }
// *** Update the GUI screen via the viewport *** // *** Update the GUI screen via the viewport ***
if(redraw) view_port_update(vpp); if (redraw) view_port_update(vpp) ;
// *** Try to release the plugin state variables *** // *** Try to release the plugin state variables ***
if(!release_mutex(&mutex, state)) { if ( !release_mutex(&mutex, state) ) {
ERROR(wii_errs[(error = ERR_MUTEX_RELEASE)]); ERROR(wii_errs[(error = ERR_MUTEX_RELEASE)]);
goto bail; goto bail;
} }
} while(state->run); } while (state->run);
// ===== Game Over ===== // ===== Game Over =====
INFO("USER EXIT"); INFO("USER EXIT");
bail: bail:
// 10. Release system notification queue // 10. Release system notification queue
if(state->notify) { if (state->notify) {
furi_record_close(RECORD_NOTIFICATION); furi_record_close(RECORD_NOTIFICATION);
state->notify = NULL; state->notify = NULL;
} }
// 9. Stop the timer // 9. Stop the timer
if(state->timer) { if (state->timer) {
(void)furi_timer_stop(state->timer); (void)furi_timer_stop(state->timer);
furi_timer_free(state->timer); furi_timer_free(state->timer);
state->timer = NULL; state->timer = NULL;
@@ -507,14 +504,14 @@ bail:
// ...they will go when the viewport is destroyed // ...they will go when the viewport is destroyed
// 6. Destroy the viewport // 6. Destroy the viewport
if(vpp) { if (vpp) {
view_port_enabled_set(vpp, false); view_port_enabled_set(vpp, false);
view_port_free(vpp); view_port_free(vpp);
vpp = NULL; vpp = NULL;
} }
// 5. Free the mutex // 5. Free the mutex
if(mutex.mutex) { if (mutex.mutex) {
delete_mutex(&mutex); delete_mutex(&mutex);
mutex.mutex = NULL; mutex.mutex = NULL;
} }
@@ -523,7 +520,7 @@ bail:
// none // none
// 3. Free the plugin state variables // 3. Free the plugin state variables
if(state) { if (state) {
free(state); free(state);
state = NULL; state = NULL;
} }
@@ -532,7 +529,7 @@ bail:
furi_record_close("gui"); furi_record_close("gui");
// 1. Destroy the message queue // 1. Destroy the message queue
if(queue) { if (queue) {
furi_message_queue_free(queue); furi_message_queue_free(queue);
queue = NULL; queue = NULL;
} }

View File

@@ -8,7 +8,8 @@
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
// GUI scenes // GUI scenes
// //
typedef enum scene { typedef
enum scene {
SCENE_NONE = 0, SCENE_NONE = 0,
SCENE_SPLASH = 1, SCENE_SPLASH = 1,
SCENE_RIP = 2, SCENE_RIP = 2,
@@ -19,7 +20,8 @@ typedef enum scene {
SCENE_CLASSIC_N = 7, SCENE_CLASSIC_N = 7,
SCENE_NUNCHUCK = 8, SCENE_NUNCHUCK = 8,
SCENE_NUNCHUCK_ACC = 9, SCENE_NUNCHUCK_ACC = 9,
} scene_t; }
scene_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
#include "wii_i2c.h" #include "wii_i2c.h"
@@ -28,7 +30,8 @@ typedef enum scene {
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
// A list of event IDs handled by this plugin // A list of event IDs handled by this plugin
// //
typedef enum eventID { typedef
enum eventID {
EVID_NONE, EVID_NONE,
EVID_UNKNOWN, EVID_UNKNOWN,
@@ -37,25 +40,29 @@ typedef enum eventID {
EVID_KEY, // keypad EVID_KEY, // keypad
EVID_TICK, // tick EVID_TICK, // tick
EVID_WIIEC, // wii extension controller EVID_WIIEC, // wii extension controller
} eventID_t; }
eventID_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
// An item in the event message-queue // An item in the event message-queue
// //
typedef struct eventMsg { typedef
struct eventMsg {
eventID_t id; eventID_t id;
union { union {
InputEvent input; // --> applications/input/input.h InputEvent input; // --> applications/input/input.h
wiiEcEvent_t wiiEc; // --> local wiiEcEvent_t wiiEc; // --> local
}; };
} eventMsg_t; }
eventMsg_t;
//----------------------------------------------------------------------------- ---------------------------------------- //----------------------------------------------------------------------------- ----------------------------------------
// State variables for this plugin // State variables for this plugin
// An instance of this is allocated on the heap, and the pointer is passed back to the OS // An instance of this is allocated on the heap, and the pointer is passed back to the OS
// Access to this memory is controlled by mutex // Access to this memory is controlled by mutex
// //
typedef struct state { typedef
struct state {
bool run; // true : plugin is running bool run; // true : plugin is running
bool timerEn; // controller scanning enabled bool timerEn; // controller scanning enabled
@@ -79,11 +86,12 @@ typedef struct state {
NotificationApp* notify; // OS nitifcation queue (for patting the backlight watchdog timer) NotificationApp* notify; // OS nitifcation queue (for patting the backlight watchdog timer)
wiiEC_t ec; // Extension Controller details wiiEC_t ec; // Extension Controller details
} state_t; }
state_t;
//============================================================================= ======================================== //============================================================================= ========================================
// Function prototypes // Function prototypes
// //
void timerEn(state_t* state, bool on); void timerEn (state_t* state, bool on) ;
#endif //WII_ANAL_H_ #endif //WII_ANAL_H_

View File

@@ -8,62 +8,45 @@
//+============================================================================ ======================================== //+============================================================================ ========================================
// Handle Wii Extension Controller events // Handle Wii Extension Controller events
// //
bool evWiiEC(const eventMsg_t* const msg, state_t* const state) { bool evWiiEC (const eventMsg_t* const msg, state_t* const state)
{
bool redraw = false; bool redraw = false;
#if LOG_LEVEL >= 4 # if LOG_LEVEL >= 4
{ {
const char* s = NULL; const char* s = NULL;
switch(msg->wiiEc.type) { switch (msg->wiiEc.type) {
case WIIEC_NONE: case WIIEC_NONE: s = "Error"; break ;
s = "Error"; case WIIEC_CONN: s = "Connect"; break ;
break; case WIIEC_DISCONN: s = "Disconnect"; break ;
case WIIEC_CONN: case WIIEC_PRESS: s = "Press"; break ;
s = "Connect"; case WIIEC_RELEASE: s = "Release"; break ;
break; case WIIEC_ANALOG: s = "Analog"; break ;
case WIIEC_DISCONN: case WIIEC_ACCEL: s = "Accel"; break ;
s = "Disconnect"; default: s = "Bug"; break ;
break;
case WIIEC_PRESS:
s = "Press";
break;
case WIIEC_RELEASE:
s = "Release";
break;
case WIIEC_ANALOG:
s = "Analog";
break;
case WIIEC_ACCEL:
s = "Accel";
break;
default:
s = "Bug";
break;
} }
INFO( INFO("WIIP : %s '%c' = %d", s, (isprint((int)msg->wiiEc.in) ? msg->wiiEc.in : '_'), msg->wiiEc.val);
"WIIP : %s '%c' = %d", if ((msg->wiiEc.type == WIIEC_CONN) || (msg->wiiEc.type == WIIEC_DISCONN))
s,
(isprint((int)msg->wiiEc.in) ? msg->wiiEc.in : '_'),
msg->wiiEc.val);
if((msg->wiiEc.type == WIIEC_CONN) || (msg->wiiEc.type == WIIEC_DISCONN))
INFO("...%d=\"%s\"", msg->wiiEc.val, ecId[msg->wiiEc.val].name); INFO("...%d=\"%s\"", msg->wiiEc.val, ecId[msg->wiiEc.val].name);
} }
#endif # endif
switch(msg->wiiEc.type) { switch (msg->wiiEc.type) {
case WIIEC_CONN: case WIIEC_CONN:
patBacklight(state); patBacklight(state);
state->hold = 0; state->hold = 0;
state->calib = CAL_TRACK; state->calib = CAL_TRACK;
sceneSet(state, ecId[msg->wiiEc.val].scene); sceneSet(state, ecId[msg->wiiEc.val].scene);
redraw = true; redraw = true ;
#if 1 // Workaround for Classic Controller Pro, which shows 00's for Factory Calibration Data!? #if 1 // Workaround for Classic Controller Pro, which shows 00's for Factory Calibration Data!?
if(state->ec.pidx == PID_CLASSIC_PRO) { if (state->ec.pidx == PID_CLASSIC_PRO) {
// Simulate a Long-OK keypress, to start Software Calibration mode // Simulate a Long-OK keypress, to start Software Calibration mode
eventMsg_t msg = {// .id = EVID_KEY, eventMsg_t msg = {
// .id = EVID_KEY,
.input.type = InputTypeLong, .input.type = InputTypeLong,
.input.key = InputKeyOk}; .input.key = InputKeyOk
};
key_calib(&msg, state); key_calib(&msg, state);
} }
#endif #endif
@@ -76,7 +59,7 @@ bool evWiiEC(const eventMsg_t* const msg, state_t* const state) {
break; break;
case WIIEC_PRESS: case WIIEC_PRESS:
if(state->scene == SCENE_NUNCHUCK_ACC) switch(msg->wiiEc.in) { if (state->scene == SCENE_NUNCHUCK_ACC) switch (msg->wiiEc.in) {
case 'z': // un-pause case 'z': // un-pause
state->pause = !state->pause; state->pause = !state->pause;
break; break;
@@ -84,17 +67,16 @@ bool evWiiEC(const eventMsg_t* const msg, state_t* const state) {
state->pause = false; state->pause = false;
state->apause = !state->apause; state->apause = !state->apause;
break; break;
default: default: break ;
break;
} }
#if 1 //! factory calibration method not known for classic triggers - this will set the digital switch point #if 1 //! factory calibration method not known for classic triggers - this will set the digital switch point
if((state->ec.pidx == PID_CLASSIC) || (state->ec.pidx == PID_CLASSIC_PRO)) { if ((state->ec.pidx == PID_CLASSIC) || (state->ec.pidx == PID_CLASSIC_PRO)) {
if(msg->wiiEc.in == 'l') state->ec.calS.classic[2].trgZL = msg->wiiEc.val; if (msg->wiiEc.in == 'l') state->ec.calS.classic[2].trgZL = msg->wiiEc.val ;
if(msg->wiiEc.in == 'r') state->ec.calS.classic[2].trgZR = msg->wiiEc.val; if (msg->wiiEc.in == 'r') state->ec.calS.classic[2].trgZR = msg->wiiEc.val ;
} }
#endif #endif
__attribute__((fallthrough)); __attribute__ ((fallthrough));
case WIIEC_RELEASE: case WIIEC_RELEASE:
patBacklight(state); patBacklight(state);

View File

@@ -6,9 +6,9 @@
//============================================================================= ======================================== //============================================================================= ========================================
// Function prototypes // Function prototypes
// //
typedef struct eventMsg eventMsg_t; typedef struct eventMsg eventMsg_t ;
typedef struct state state_t; typedef struct state state_t ;
bool evWiiEC(const eventMsg_t* const msg, state_t* const state); bool evWiiEC (const eventMsg_t* const msg, state_t* const state) ;
#endif //WII_ANAL_EC_H_ #endif //WII_ANAL_EC_H_

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