mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 01:58:36 -07:00
fmt
This commit is contained in:
@@ -20,10 +20,7 @@ typedef enum {
|
||||
EventTypeKey,
|
||||
} EventType;
|
||||
|
||||
typedef enum {
|
||||
BadgerGetAddress,
|
||||
BadgerSend
|
||||
} STATE;
|
||||
typedef enum { BadgerGetAddress, BadgerSend } STATE;
|
||||
|
||||
typedef struct {
|
||||
EventType type;
|
||||
@@ -56,22 +53,22 @@ static void render_callback(Canvas* const canvas, void* ctx) {
|
||||
|
||||
char str[32];
|
||||
|
||||
if (plugin_state->state == BadgerGetAddress) {
|
||||
if(plugin_state->state == BadgerGetAddress) {
|
||||
sprintf(str, "Selected Address: %d", plugin_state->address);
|
||||
canvas_draw_str(canvas, ADDRESS_QUESTION_X, ADDRESS_QUESTION_Y, str);
|
||||
|
||||
if (plugin_state->get_failed) {
|
||||
if(plugin_state->get_failed) {
|
||||
strcpy(str, "Error! Device not found!");
|
||||
canvas_draw_str(canvas, ERROR_X, ERROR_Y, str);
|
||||
}
|
||||
} else if (plugin_state->state == BadgerSend) {
|
||||
} else if(plugin_state->state == BadgerSend) {
|
||||
sprintf(str, "Sending to Address: %d", plugin_state->address);
|
||||
canvas_draw_str(canvas, ADDRESS_QUESTION_X, ADDRESS_QUESTION_Y, str);
|
||||
|
||||
sprintf(str, "Data: %d", plugin_state->data);
|
||||
canvas_draw_str(canvas, DATA_X, DATA_Y, str);
|
||||
|
||||
if (plugin_state->send_failed) {
|
||||
if(plugin_state->send_failed) {
|
||||
strcpy(str, "Error! Unable to send data!");
|
||||
canvas_draw_str(canvas, ERROR_X, ERROR_Y, str);
|
||||
}
|
||||
@@ -88,22 +85,21 @@ static void input_callback(InputEvent* input_event, FuriMessageQueue* event_queu
|
||||
}
|
||||
|
||||
bool device_exists(int address) {
|
||||
if (DEBUG) return true;
|
||||
if(DEBUG) return true;
|
||||
|
||||
uint32_t response_timeout_ticks = furi_ms_to_ticks(5.f);
|
||||
|
||||
return furi_hal_i2c_is_device_ready(
|
||||
&furi_hal_i2c_handle_external,
|
||||
address << 1,
|
||||
response_timeout_ticks);
|
||||
&furi_hal_i2c_handle_external, address << 1, response_timeout_ticks);
|
||||
}
|
||||
|
||||
bool sendData(uint8_t address, uint8_t data) {
|
||||
if (DEBUG) return true;
|
||||
if(DEBUG) return true;
|
||||
|
||||
uint32_t response_timeout_ticks = furi_ms_to_ticks(5.f);
|
||||
|
||||
return furi_hal_i2c_tx(&furi_hal_i2c_handle_external, address, &data, 1, response_timeout_ticks);
|
||||
return furi_hal_i2c_tx(
|
||||
&furi_hal_i2c_handle_external, address, &data, 1, response_timeout_ticks);
|
||||
}
|
||||
|
||||
int32_t badger2040_app(void* p) {
|
||||
@@ -141,28 +137,27 @@ int32_t badger2040_app(void* p) {
|
||||
// press events
|
||||
if(event.type == EventTypeKey) {
|
||||
if((event.input.type == InputTypePress) || (event.input.type == InputTypeRepeat)) {
|
||||
|
||||
// Reset failed status to clear display after key press
|
||||
if (plugin_state->state == BadgerGetAddress) {
|
||||
if(plugin_state->state == BadgerGetAddress) {
|
||||
plugin_state->get_failed = false;
|
||||
} else if (plugin_state->state == BadgerSend) {
|
||||
} else if(plugin_state->state == BadgerSend) {
|
||||
plugin_state->send_failed = false;
|
||||
}
|
||||
|
||||
switch(event.input.key) {
|
||||
case InputKeyUp:
|
||||
if (plugin_state->state == BadgerGetAddress) {
|
||||
if(plugin_state->state == BadgerGetAddress) {
|
||||
uint8_t prevAddr = plugin_state->address;
|
||||
|
||||
if (prevAddr == HIGHEST_I2C_ADDRESS) {
|
||||
if(prevAddr == HIGHEST_I2C_ADDRESS) {
|
||||
plugin_state->address = FIRST_NON_RESERVED_I2C_ADDRESS;
|
||||
} else {
|
||||
plugin_state->address = prevAddr + 1;
|
||||
}
|
||||
} else if (plugin_state->state == BadgerSend) {
|
||||
} else if(plugin_state->state == BadgerSend) {
|
||||
uint8_t prevData = plugin_state->data;
|
||||
|
||||
if (prevData == MAX_DATA) {
|
||||
if(prevData == MAX_DATA) {
|
||||
plugin_state->data = MIN_DATA;
|
||||
} else {
|
||||
plugin_state->data = prevData + 1;
|
||||
@@ -170,18 +165,18 @@ int32_t badger2040_app(void* p) {
|
||||
}
|
||||
break;
|
||||
case InputKeyDown:
|
||||
if (plugin_state->state == BadgerGetAddress) {
|
||||
if(plugin_state->state == BadgerGetAddress) {
|
||||
uint8_t prevAddr = plugin_state->address;
|
||||
|
||||
if (prevAddr == FIRST_NON_RESERVED_I2C_ADDRESS) {
|
||||
if(prevAddr == FIRST_NON_RESERVED_I2C_ADDRESS) {
|
||||
plugin_state->address = HIGHEST_I2C_ADDRESS;
|
||||
} else {
|
||||
plugin_state->address = prevAddr - 1;
|
||||
}
|
||||
} else if (plugin_state->state == BadgerSend) {
|
||||
} else if(plugin_state->state == BadgerSend) {
|
||||
uint8_t prevData = plugin_state->data;
|
||||
|
||||
if (prevData == MIN_DATA) {
|
||||
if(prevData == MIN_DATA) {
|
||||
plugin_state->data = MAX_DATA;
|
||||
} else {
|
||||
plugin_state->data = prevData - 1;
|
||||
@@ -193,16 +188,16 @@ int32_t badger2040_app(void* p) {
|
||||
case InputKeyLeft:
|
||||
break;
|
||||
case InputKeyOk:
|
||||
if (plugin_state->state == BadgerGetAddress) {
|
||||
if (device_exists(plugin_state->address)) {
|
||||
if (plugin_state->state == BadgerGetAddress) {
|
||||
if(plugin_state->state == BadgerGetAddress) {
|
||||
if(device_exists(plugin_state->address)) {
|
||||
if(plugin_state->state == BadgerGetAddress) {
|
||||
plugin_state->state = BadgerSend;
|
||||
}
|
||||
} else {
|
||||
plugin_state->get_failed = true;
|
||||
}
|
||||
} else if (plugin_state->state == BadgerSend) {
|
||||
if (!sendData) {
|
||||
} else if(plugin_state->state == BadgerSend) {
|
||||
if(!sendData) {
|
||||
plugin_state->send_failed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2357,7 +2357,7 @@ Node iterativeDeepeningAlphaBeta(Position* position, char depth, int alpha, int
|
||||
int score = iterativeDeepeningAlphaBeta(&newPosition, depth - 1, alpha, beta, FALSE).score;
|
||||
|
||||
if(verbose) {
|
||||
printf("%.2f\n", (double) score / (double) 100.00);
|
||||
printf("%.2f\n", (double)score / (double)100.00);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
@@ -2850,8 +2850,8 @@ Move getAIMove(Game* game, int depth) {
|
||||
printf(
|
||||
" in %d seconds [%+.2f, %+.2f]\n",
|
||||
(int)(endTime - startTime),
|
||||
(double) staticEvaluation(&game->position) / (double) 100.0,
|
||||
(double) node.score / (double) 100.0);
|
||||
(double)staticEvaluation(&game->position) / (double)100.0,
|
||||
(double)node.score / (double)100.0);
|
||||
fflush(stdout);
|
||||
|
||||
return node.move;
|
||||
|
||||
@@ -18,47 +18,47 @@ bool namechanger_back_event_callback(void* context) {
|
||||
|
||||
bool namechanger_make_app_folder(NameChanger* namechanger) {
|
||||
bool created = false;
|
||||
FURI_LOG_I(TAG, "folder1");
|
||||
FURI_LOG_I(TAG, "folder1");
|
||||
|
||||
FuriString* folderpath = furi_string_alloc();
|
||||
furi_string_set(folderpath, "/ext/dolphin");
|
||||
FURI_LOG_I(TAG, "folder2");
|
||||
FURI_LOG_I(TAG, "folder2");
|
||||
|
||||
//Make dir if doesn't exist
|
||||
if(!storage_simply_mkdir(namechanger->storage, furi_string_get_cstr(folderpath))) {
|
||||
FURI_LOG_I(TAG, "folder3");
|
||||
FURI_LOG_I(TAG, "folder3");
|
||||
furi_string_set_str(namechanger->error, "Cannot create\napp folder.");
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "folder4");
|
||||
FURI_LOG_I(TAG, "folder4");
|
||||
created = true;
|
||||
}
|
||||
FURI_LOG_I(TAG, "folder5");
|
||||
FURI_LOG_I(TAG, "folder5");
|
||||
furi_string_free(folderpath);
|
||||
FURI_LOG_I(TAG, "folder6");
|
||||
FURI_LOG_I(TAG, "folder6");
|
||||
return created;
|
||||
}
|
||||
|
||||
bool namechanger_name_read_write(NameChanger* namechanger, char* name, uint8_t mode) {
|
||||
FuriString* file_path = furi_string_alloc();
|
||||
furi_string_set(file_path, "/ext/dolphin/name.txt");
|
||||
FURI_LOG_I(TAG, "name1");
|
||||
FURI_LOG_I(TAG, "name1");
|
||||
|
||||
bool result = false;
|
||||
|
||||
if(mode == 2) {
|
||||
FURI_LOG_I(TAG, "name2");
|
||||
FURI_LOG_I(TAG, "name2");
|
||||
UNUSED(name);
|
||||
FlipperFormat* file = flipper_format_file_alloc(namechanger->storage);
|
||||
//read
|
||||
FuriString* data = furi_string_alloc();
|
||||
FURI_LOG_I(TAG, "name3");
|
||||
FURI_LOG_I(TAG, "name3");
|
||||
|
||||
do {
|
||||
FURI_LOG_I(TAG, "name4");
|
||||
FURI_LOG_I(TAG, "name4");
|
||||
if(!flipper_format_file_open_existing(file, furi_string_get_cstr(file_path))) {
|
||||
break;
|
||||
}
|
||||
FURI_LOG_I(TAG, "name4a");
|
||||
FURI_LOG_I(TAG, "name4a");
|
||||
|
||||
// header
|
||||
uint32_t version;
|
||||
@@ -66,59 +66,59 @@ bool namechanger_name_read_write(NameChanger* namechanger, char* name, uint8_t m
|
||||
if(!flipper_format_read_header(file, data, &version)) {
|
||||
break;
|
||||
}
|
||||
FURI_LOG_I(TAG, "name4b");
|
||||
FURI_LOG_I(TAG, "name4b");
|
||||
|
||||
if(furi_string_cmp_str(data, NAMECHANGER_HEADER) != 0) {
|
||||
break;
|
||||
}
|
||||
FURI_LOG_I(TAG, "name4c");
|
||||
FURI_LOG_I(TAG, "name4c");
|
||||
|
||||
if(version != 1) {
|
||||
break;
|
||||
}
|
||||
FURI_LOG_I(TAG, "name4d");
|
||||
FURI_LOG_I(TAG, "name4d");
|
||||
|
||||
// get Name
|
||||
if(!flipper_format_read_string(file, "Name", data)) {
|
||||
break;
|
||||
}
|
||||
FURI_LOG_I(TAG, "name4e");
|
||||
FURI_LOG_I(TAG, "name4e");
|
||||
|
||||
result = true;
|
||||
FURI_LOG_I(TAG, "name5");
|
||||
FURI_LOG_I(TAG, "name5");
|
||||
} while(false);
|
||||
|
||||
flipper_format_free(file);
|
||||
FURI_LOG_I(TAG, "name6");
|
||||
FURI_LOG_I(TAG, "name6");
|
||||
|
||||
if(!result) {
|
||||
FURI_LOG_I(TAG, "name7");
|
||||
FURI_LOG_I(TAG, "name7");
|
||||
FURI_LOG_E(TAG, "Cannot load data from file.");
|
||||
namechanger_text_store_set(namechanger, "%s", furi_hal_version_get_name_ptr());
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "name8");
|
||||
FURI_LOG_I(TAG, "name8");
|
||||
furi_string_trim(data);
|
||||
|
||||
if(!furi_string_size(data)) {
|
||||
FURI_LOG_I(TAG, "name9");
|
||||
FURI_LOG_I(TAG, "name9");
|
||||
namechanger_text_store_set(namechanger, "%s", furi_hal_version_get_name_ptr());
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "name10");
|
||||
FURI_LOG_I(TAG, "name10");
|
||||
char newname[8];
|
||||
snprintf(newname, 8, "%s", furi_string_get_cstr(data));
|
||||
namechanger_text_store_set(namechanger, "%s", newname);
|
||||
}
|
||||
}
|
||||
FURI_LOG_I(TAG, "name11");
|
||||
FURI_LOG_I(TAG, "name11");
|
||||
|
||||
furi_string_free(data);
|
||||
} else if(mode == 3) {
|
||||
FURI_LOG_I(TAG, "name12");
|
||||
FURI_LOG_I(TAG, "name12");
|
||||
//save
|
||||
FlipperFormat* file = flipper_format_file_alloc(namechanger->storage);
|
||||
|
||||
do {
|
||||
FURI_LOG_I(TAG, "name13");
|
||||
FURI_LOG_I(TAG, "name13");
|
||||
// Open file for write
|
||||
if(!flipper_format_file_open_always(file, furi_string_get_cstr(file_path))) {
|
||||
break;
|
||||
@@ -146,39 +146,36 @@ bool namechanger_name_read_write(NameChanger* namechanger, char* name, uint8_t m
|
||||
break;
|
||||
}
|
||||
|
||||
//If name is eraseerase (set by Revert) - then don't write any name
|
||||
//otherwise, write name as set in the variable
|
||||
if(strcmp(name, "eraseerase") == 0)
|
||||
{
|
||||
if(!flipper_format_write_string_cstr(file, "Name", "")) {
|
||||
break;
|
||||
}
|
||||
//If name is eraseerase (set by Revert) - then don't write any name
|
||||
//otherwise, write name as set in the variable
|
||||
if(strcmp(name, "eraseerase") == 0) {
|
||||
if(!flipper_format_write_string_cstr(file, "Name", "")) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if(!flipper_format_write_string_cstr(file, "Name", name)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!flipper_format_write_string_cstr(file, "Name", name)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FURI_LOG_I(TAG, "name14");
|
||||
FURI_LOG_I(TAG, "name14");
|
||||
result = true;
|
||||
} while(false);
|
||||
|
||||
flipper_format_free(file);
|
||||
FURI_LOG_I(TAG, "name15");
|
||||
FURI_LOG_I(TAG, "name15");
|
||||
|
||||
if(!result) {
|
||||
FURI_LOG_I(TAG, "name16");
|
||||
FURI_LOG_I(TAG, "name16");
|
||||
FURI_LOG_E(TAG, "Cannot save name file.");
|
||||
furi_string_set_str(namechanger->error, "Cannot save\nname file.");
|
||||
}
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "name17");
|
||||
FURI_LOG_I(TAG, "name17");
|
||||
FURI_LOG_E(TAG, "Something broke.");
|
||||
furi_string_set_str(namechanger->error, "Something broke.");
|
||||
}
|
||||
FURI_LOG_I(TAG, "name18");
|
||||
FURI_LOG_I(TAG, "name18");
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -264,8 +261,8 @@ void namechanger_text_store_clear(NameChanger* namechanger) {
|
||||
int32_t namechanger_app() {
|
||||
NameChanger* namechanger = namechanger_alloc();
|
||||
|
||||
namechanger->error = furi_string_alloc();
|
||||
furi_string_set(namechanger->error, "Default");
|
||||
namechanger->error = furi_string_alloc();
|
||||
furi_string_set(namechanger->error, "Default");
|
||||
|
||||
view_dispatcher_attach_to_gui(
|
||||
namechanger->view_dispatcher, namechanger->gui, ViewDispatcherTypeFullscreen);
|
||||
|
||||
@@ -38,7 +38,8 @@ bool namechanger_scene_change_on_event(void* context, SceneManagerEvent event) {
|
||||
if(event.event == NameChangerCustomEventTextEditResult) {
|
||||
if(namechanger_make_app_folder(namechanger)) {
|
||||
if(namechanger_name_read_write(namechanger, namechanger->text_store, 3)) {
|
||||
scene_manager_next_scene(namechanger->scene_manager, NameChangerSceneChangeSuccess);
|
||||
scene_manager_next_scene(
|
||||
namechanger->scene_manager, NameChangerSceneChangeSuccess);
|
||||
} else {
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
namechanger->scene_manager, NameChangerSceneError);
|
||||
|
||||
@@ -9,14 +9,14 @@ void namechanger_scene_change_success_on_enter(void* context) {
|
||||
NameChanger* namechanger = context;
|
||||
Popup* popup = namechanger->popup;
|
||||
|
||||
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
|
||||
popup_set_header(popup, "Saved!", 5, 5, AlignLeft, AlignTop);
|
||||
popup_set_text(popup, "Rebooting...", 5, 17, AlignLeft, AlignTop);
|
||||
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
|
||||
popup_set_header(popup, "Saved!", 5, 5, AlignLeft, AlignTop);
|
||||
popup_set_text(popup, "Rebooting...", 5, 17, AlignLeft, AlignTop);
|
||||
|
||||
popup_set_callback(popup, namechanger_scene_change_success_popup_callback);
|
||||
popup_set_context(popup, namechanger);
|
||||
popup_set_timeout(popup, 5000);
|
||||
popup_enable_timeout(popup);
|
||||
popup_set_callback(popup, namechanger_scene_change_success_popup_callback);
|
||||
popup_set_context(popup, namechanger);
|
||||
popup_set_timeout(popup, 5000);
|
||||
popup_enable_timeout(popup);
|
||||
|
||||
view_dispatcher_switch_to_view(namechanger->view_dispatcher, NameChangerViewPopup);
|
||||
}
|
||||
@@ -47,5 +47,5 @@ void namechanger_scene_change_success_on_exit(void* context) {
|
||||
popup_set_context(popup, NULL);
|
||||
popup_set_callback(popup, NULL);
|
||||
|
||||
furi_hal_power_reset();
|
||||
furi_hal_power_reset();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ void namechanger_scene_revert_on_enter(void* context) {
|
||||
FURI_LOG_I(TAG, "revert3");
|
||||
widget_add_text_box_element(
|
||||
widget, 0, 0, 128, 25, AlignCenter, AlignCenter, "\e#Revert Name?\e#", false);
|
||||
widget_add_icon_element(widget, 48, 20, &I_MarioBlock);
|
||||
widget_add_icon_element(widget, 48, 20, &I_MarioBlock);
|
||||
widget_add_button_element(
|
||||
widget, GuiButtonTypeLeft, "Cancel", namechanger_scene_revert_widget_callback, namechanger);
|
||||
FURI_LOG_I(TAG, "revert4");
|
||||
@@ -44,7 +44,8 @@ bool namechanger_scene_revert_on_event(void* context, SceneManagerEvent event) {
|
||||
FURI_LOG_I(TAG, "revert9");
|
||||
if(namechanger_name_read_write(namechanger, "eraseerase", 3)) {
|
||||
FURI_LOG_I(TAG, "revert10");
|
||||
scene_manager_next_scene(namechanger->scene_manager, NameChangerSceneRevertSuccess);
|
||||
scene_manager_next_scene(
|
||||
namechanger->scene_manager, NameChangerSceneRevertSuccess);
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "revert11");
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
|
||||
@@ -27,7 +27,8 @@ bool namechanger_scene_revert_success_on_event(void* context, SceneManagerEvent
|
||||
|
||||
if(event.type == SceneManagerEventTypeBack) {
|
||||
consumed = true;
|
||||
scene_manager_search_and_switch_to_previous_scene(namechanger->scene_manager, NameChangerSceneStart);
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
namechanger->scene_manager, NameChangerSceneStart);
|
||||
} else if(event.type == SceneManagerEventTypeCustom) {
|
||||
consumed = true;
|
||||
if(event.event == NameChangerCustomEventBack) {
|
||||
@@ -50,5 +51,5 @@ void namechanger_scene_revert_success_on_exit(void* context) {
|
||||
popup_set_context(popup, NULL);
|
||||
popup_set_callback(popup, NULL);
|
||||
|
||||
furi_hal_power_reset();
|
||||
furi_hal_power_reset();
|
||||
}
|
||||
@@ -3,136 +3,146 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
const unsigned char* pp = NULL;
|
||||
uint32_t pix = 0;
|
||||
int bit = 0;
|
||||
int main(int argc, char* argv[]) {
|
||||
const unsigned char* pp = NULL;
|
||||
uint32_t pix = 0;
|
||||
int bit = 0;
|
||||
|
||||
uint8_t b = 0;
|
||||
uint8_t bcnt = 0;
|
||||
uint8_t b = 0;
|
||||
uint8_t bcnt = 0;
|
||||
|
||||
unsigned int lcnt = 0;
|
||||
static const int lmax = 16; // max hex values per line
|
||||
unsigned int lcnt = 0;
|
||||
static const int lmax = 16; // max hex values per line
|
||||
|
||||
uint8_t* buf = NULL;
|
||||
uint8_t* bp = NULL;
|
||||
unsigned int blen = 0;
|
||||
uint8_t* buf = NULL;
|
||||
uint8_t* bp = NULL;
|
||||
unsigned int blen = 0;
|
||||
|
||||
uint8_t* cmp = NULL;
|
||||
uint8_t* cp = NULL;
|
||||
unsigned int clen = 0;
|
||||
uint8_t ctag = 0xFF;
|
||||
uint32_t tag[256] = {0};
|
||||
uint32_t tmax = UINT32_MAX;
|
||||
uint8_t* cmp = NULL;
|
||||
uint8_t* cp = NULL;
|
||||
unsigned int clen = 0;
|
||||
uint8_t ctag = 0xFF;
|
||||
uint32_t tag[256] = {0};
|
||||
uint32_t tmax = UINT32_MAX;
|
||||
|
||||
unsigned int x, y, z;
|
||||
unsigned int x, y, z;
|
||||
|
||||
const char* name = argv[1];
|
||||
FILE* fh = fopen(argv[2], "wb");
|
||||
const char* name = argv[1];
|
||||
FILE* fh = fopen(argv[2], "wb");
|
||||
|
||||
uint32_t white = 0xFF;
|
||||
uint32_t white = 0xFF;
|
||||
|
||||
int rv = 0; // assume success
|
||||
int rv = 0; // assume success
|
||||
|
||||
// allocate buffers
|
||||
blen = ((img.w * img.h) +0x7) >>3;
|
||||
bp = (buf = calloc(blen +1, 1));
|
||||
cp = (cmp = calloc(blen +4, 1));
|
||||
// allocate buffers
|
||||
blen = ((img.w * img.h) + 0x7) >> 3;
|
||||
bp = (buf = calloc(blen + 1, 1));
|
||||
cp = (cmp = calloc(blen + 4, 1));
|
||||
|
||||
// sanity check
|
||||
if (!fh || !buf || !cmp) {
|
||||
printf("! fopen() or malloc() fail.\n");
|
||||
rv = 255;
|
||||
goto bail;
|
||||
}
|
||||
// sanity check
|
||||
if(!fh || !buf || !cmp) {
|
||||
printf("! fopen() or malloc() fail.\n");
|
||||
rv = 255;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// Find white value
|
||||
for (x = 1; x < img.bpp; x++)
|
||||
white = (white << 8) | 0xFF ;
|
||||
// Find white value
|
||||
for(x = 1; x < img.bpp; x++) white = (white << 8) | 0xFF;
|
||||
|
||||
// build bit pattern
|
||||
// create the comment as we go
|
||||
for (pp = img.b, y = 0; y < img.h; y++) {
|
||||
fprintf(fh, "// ");
|
||||
for (x = 0; x < img.w; x++) {
|
||||
// read pixel
|
||||
for (pix = 0, z = 0; z < img.bpp; pix = (pix << 8) | *pp++, z++) ;
|
||||
// get bit and draw
|
||||
if (pix < white) {
|
||||
b = (b << 1) | 1;
|
||||
fprintf(fh, "##");
|
||||
} else {
|
||||
b <<= 1;
|
||||
fprintf(fh, "..");
|
||||
}
|
||||
// got byte
|
||||
if ((++bcnt) == 8) {
|
||||
*bp++ = b;
|
||||
tag[b]++;
|
||||
bcnt = (b = 0);
|
||||
}
|
||||
}
|
||||
fprintf(fh, "\n");
|
||||
}
|
||||
fprintf(fh, "\n");
|
||||
// padding
|
||||
if (bcnt) {
|
||||
b <<= (bcnt = 8 - bcnt);
|
||||
*bp++ = b;
|
||||
tag[b]++;
|
||||
}
|
||||
// Kill the compression
|
||||
*bp = ~bp[-1]; // https://youtube.com/clip/Ugkx-JZIr16hETy7hz_H6yIdKPtxVe8C5w_V
|
||||
// build bit pattern
|
||||
// create the comment as we go
|
||||
for(pp = img.b, y = 0; y < img.h; y++) {
|
||||
fprintf(fh, "// ");
|
||||
for(x = 0; x < img.w; x++) {
|
||||
// read pixel
|
||||
for(pix = 0, z = 0; z < img.bpp; pix = (pix << 8) | *pp++, z++)
|
||||
;
|
||||
// get bit and draw
|
||||
if(pix < white) {
|
||||
b = (b << 1) | 1;
|
||||
fprintf(fh, "##");
|
||||
} else {
|
||||
b <<= 1;
|
||||
fprintf(fh, "..");
|
||||
}
|
||||
// got byte
|
||||
if((++bcnt) == 8) {
|
||||
*bp++ = b;
|
||||
tag[b]++;
|
||||
bcnt = (b = 0);
|
||||
}
|
||||
}
|
||||
fprintf(fh, "\n");
|
||||
}
|
||||
fprintf(fh, "\n");
|
||||
// padding
|
||||
if(bcnt) {
|
||||
b <<= (bcnt = 8 - bcnt);
|
||||
*bp++ = b;
|
||||
tag[b]++;
|
||||
}
|
||||
// Kill the compression
|
||||
*bp = ~bp[-1]; // https://youtube.com/clip/Ugkx-JZIr16hETy7hz_H6yIdKPtxVe8C5w_V
|
||||
|
||||
// Byte run length compression
|
||||
// Find a good tag
|
||||
for (x = 0; tmax && (x < 256); x++) {
|
||||
if (tag[x] < tmax) {
|
||||
tmax = tag[x];
|
||||
ctag = x;
|
||||
}
|
||||
}
|
||||
// Byte run length compression
|
||||
// Find a good tag
|
||||
for(x = 0; tmax && (x < 256); x++) {
|
||||
if(tag[x] < tmax) {
|
||||
tmax = tag[x];
|
||||
ctag = x;
|
||||
}
|
||||
}
|
||||
|
||||
// compress the data
|
||||
for (bp = buf, x = 0; (clen < blen) && (x < blen); x++) {
|
||||
// need at least 4 the same to be worth it
|
||||
// must compress tag (if it occurs)
|
||||
if ((bp[x] == bp[x+1]) && (bp[x] == bp[x+2]) && (bp[x] == bp[x+3]) || (bp[x] == ctag)) {
|
||||
for (y = 1; (y < 255) && (bp[x] == bp[x+y]); y++) ;
|
||||
*cp++ = ctag; // tag
|
||||
*cp++ = y; // length
|
||||
*cp++ = bp[x]; // byte
|
||||
x += y -1;
|
||||
clen += 3;
|
||||
} else {
|
||||
*cp++ = bp[x];
|
||||
clen++;
|
||||
}
|
||||
}
|
||||
// compress the data
|
||||
for(bp = buf, x = 0; (clen < blen) && (x < blen); x++) {
|
||||
// need at least 4 the same to be worth it
|
||||
// must compress tag (if it occurs)
|
||||
if((bp[x] == bp[x + 1]) && (bp[x] == bp[x + 2]) && (bp[x] == bp[x + 3]) ||
|
||||
(bp[x] == ctag)) {
|
||||
for(y = 1; (y < 255) && (bp[x] == bp[x + y]); y++)
|
||||
;
|
||||
*cp++ = ctag; // tag
|
||||
*cp++ = y; // length
|
||||
*cp++ = bp[x]; // byte
|
||||
x += y - 1;
|
||||
clen += 3;
|
||||
} else {
|
||||
*cp++ = bp[x];
|
||||
clen++;
|
||||
}
|
||||
}
|
||||
|
||||
// create struct
|
||||
fprintf(fh, "#include \"images.h\"\n\n");
|
||||
fprintf(fh, "const image_t img_%s = { %d, %d, ", name, img.w, img.h);
|
||||
// create struct
|
||||
fprintf(fh, "#include \"images.h\"\n\n");
|
||||
fprintf(fh, "const image_t img_%s = { %d, %d, ", name, img.w, img.h);
|
||||
|
||||
if (clen < blen) { // dump compressed?
|
||||
fprintf(fh, "true, %d, 0x%02X, { // orig:%d, comp:%.2f%%\n\t",
|
||||
clen, ctag, 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" : ", ") ;
|
||||
if(clen < blen) { // dump compressed?
|
||||
fprintf(
|
||||
fh,
|
||||
"true, %d, 0x%02X, { // orig:%d, comp:%.2f%%\n\t",
|
||||
clen,
|
||||
ctag,
|
||||
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
|
||||
fprintf(fh, "false, %d, 0, {\n\t", blen);
|
||||
for (x = 0; x < blen; x++)
|
||||
if (x == blen -1) fprintf(fh, "0x%02X\n}};\n", buf[x]) ;
|
||||
else fprintf(fh, "0x%02X%s", buf[x], (!((x+1)%16)) ? ",\n\t" : ", ") ;
|
||||
}
|
||||
} else { // dump UNcompressed
|
||||
fprintf(fh, "false, %d, 0, {\n\t", blen);
|
||||
for(x = 0; x < blen; x++)
|
||||
if(x == blen - 1)
|
||||
fprintf(fh, "0x%02X\n}};\n", buf[x]);
|
||||
else
|
||||
fprintf(fh, "0x%02X%s", buf[x], (!((x + 1) % 16)) ? ",\n\t" : ", ");
|
||||
}
|
||||
|
||||
bail:
|
||||
if (fh) fclose(fh) ;
|
||||
if (buf) free(buf) ;
|
||||
if (cmp) free(cmp) ;
|
||||
if(fh) fclose(fh);
|
||||
if(buf) free(buf);
|
||||
if(cmp) free(cmp);
|
||||
|
||||
return rv;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -1,55 +1,49 @@
|
||||
#include <gui/gui.h> // GUI (screen/keyboard) API
|
||||
#include <gui/gui.h> // GUI (screen/keyboard) API
|
||||
|
||||
#include "images.h"
|
||||
#include "images.h"
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
static Canvas* _canvas;
|
||||
static uint8_t _tlx;
|
||||
static uint8_t _tly;
|
||||
static Canvas* _canvas;
|
||||
static uint8_t _tlx;
|
||||
static uint8_t _tly;
|
||||
|
||||
static uint8_t _x;
|
||||
static uint8_t _y;
|
||||
static uint8_t _x;
|
||||
static uint8_t _y;
|
||||
|
||||
static const image_t* _img;
|
||||
static const image_t* _img;
|
||||
|
||||
static bool _blk;
|
||||
static Color _set;
|
||||
static Color _clr;
|
||||
static bool _blk;
|
||||
static Color _set;
|
||||
static Color _clr;
|
||||
|
||||
//+============================================================================
|
||||
static
|
||||
void _showByteSet (const uint8_t b)
|
||||
{
|
||||
for (uint8_t m = 0x80; m; m >>= 1) {
|
||||
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 _showByteSet(const uint8_t b) {
|
||||
for(uint8_t m = 0x80; m; m >>= 1) {
|
||||
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)
|
||||
{
|
||||
for (uint8_t m = 0x80; m; m >>= 1) {
|
||||
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 _showByteClr(const uint8_t b) {
|
||||
for(uint8_t m = 0x80; m; m >>= 1) {
|
||||
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)
|
||||
{
|
||||
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));
|
||||
_blk = !_blk;
|
||||
}
|
||||
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) {
|
||||
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));
|
||||
_blk = !_blk;
|
||||
}
|
||||
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y));
|
||||
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break;
|
||||
}
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
@@ -61,81 +55,83 @@ void _showByteAll (const uint8_t b)
|
||||
// SHOW_ALL - plot all images pixels as they are
|
||||
// SHOW_ALL_INV - plot all images pixels inverted
|
||||
//
|
||||
void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
|
||||
const image_t* img, const showMode_t mode)
|
||||
{
|
||||
void(*fnShow)(const uint8_t) = NULL;
|
||||
void show(
|
||||
Canvas* const canvas,
|
||||
const uint8_t tlx,
|
||||
const uint8_t tly,
|
||||
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
|
||||
switch (mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
_set = ColorBlack;
|
||||
_clr = ColorWhite;
|
||||
break;
|
||||
// code size optimisation
|
||||
switch(mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
_set = ColorBlack;
|
||||
_clr = ColorWhite;
|
||||
break;
|
||||
|
||||
case SHOW_INV_:
|
||||
_set = ColorWhite;
|
||||
_clr = ColorBlack;
|
||||
break;
|
||||
case SHOW_INV_:
|
||||
_set = ColorWhite;
|
||||
_clr = ColorBlack;
|
||||
break;
|
||||
|
||||
case SHOW_BLK_:
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
break;
|
||||
case SHOW_BLK_:
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
break;
|
||||
|
||||
case SHOW_WHT_:
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
break;
|
||||
case SHOW_WHT_:
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
break;
|
||||
}
|
||||
switch(mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
case SHOW_INV_:
|
||||
fnShow = _showByteAll;
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
_blk = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
switch (mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
case SHOW_INV_:
|
||||
fnShow = _showByteAll;
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
_blk = 0;
|
||||
break;
|
||||
case SHOW_BLK_:
|
||||
case SHOW_WHT_:
|
||||
switch(mode & SHOW_ALL_) {
|
||||
case SHOW_SET_:
|
||||
fnShow = _showByteSet;
|
||||
break;
|
||||
case SHOW_CLR_:
|
||||
fnShow = _showByteClr;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
furi_check(fnShow);
|
||||
|
||||
case SHOW_BLK_:
|
||||
case SHOW_WHT_:
|
||||
switch (mode & SHOW_ALL_) {
|
||||
case SHOW_SET_:
|
||||
fnShow = _showByteSet;
|
||||
break;
|
||||
case SHOW_CLR_:
|
||||
fnShow = _showByteClr;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
furi_check(fnShow);
|
||||
// I want nested functions!
|
||||
_canvas = canvas;
|
||||
_img = img;
|
||||
_tlx = tlx;
|
||||
_tly = tly;
|
||||
_x = 0;
|
||||
_y = 0;
|
||||
|
||||
// I want nested functions!
|
||||
_canvas = canvas;
|
||||
_img = img;
|
||||
_tlx = tlx;
|
||||
_tly = tly;
|
||||
_x = 0;
|
||||
_y = 0;
|
||||
// Compressed
|
||||
if(img->c) {
|
||||
for(unsigned int i = 0; i < img->len; i++, bp++) {
|
||||
// Compressed data? {tag, length, value}
|
||||
if(*bp == img->tag) {
|
||||
for(uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]);
|
||||
bp += 3 - 1;
|
||||
i += 3 - 1;
|
||||
|
||||
// Compressed
|
||||
if (img->c) {
|
||||
for (unsigned int i = 0; i < img->len; i++, bp++) {
|
||||
// Compressed data? {tag, length, value}
|
||||
if (*bp == img->tag) {
|
||||
for (uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]) ;
|
||||
bp += 3 -1;
|
||||
i += 3 -1;
|
||||
// Uncompressed byte
|
||||
} else {
|
||||
fnShow(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
// Uncompressed byte
|
||||
} else {
|
||||
fnShow(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
// Not compressed
|
||||
} else {
|
||||
for (unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp) ;
|
||||
}
|
||||
// Not compressed
|
||||
} else {
|
||||
for(unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
#ifndef IMAGES_H_
|
||||
#define IMAGES_H_
|
||||
#ifndef IMAGES_H_
|
||||
#define IMAGES_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
typedef
|
||||
enum showMode {
|
||||
// {INV:--:WHT:BLK::--:--:CLR:SET}
|
||||
SHOW_SET_ = 0x01,
|
||||
SHOW_CLR_ = 0x02,
|
||||
SHOW_ALL_ = SHOW_SET_ | SHOW_CLR_,
|
||||
typedef enum showMode {
|
||||
// {INV:--:WHT:BLK::--:--:CLR:SET}
|
||||
SHOW_SET_ = 0x01,
|
||||
SHOW_CLR_ = 0x02,
|
||||
SHOW_ALL_ = SHOW_SET_ | SHOW_CLR_,
|
||||
|
||||
SHOW_BLK_ = 0x10,
|
||||
SHOW_WHT_ = 0x20,
|
||||
SHOW_NRM_ = 0x00,
|
||||
SHOW_INV_ = SHOW_BLK_ | SHOW_WHT_,
|
||||
SHOW_BLK_ = 0x10,
|
||||
SHOW_WHT_ = 0x20,
|
||||
SHOW_NRM_ = 0x00,
|
||||
SHOW_INV_ = SHOW_BLK_ | SHOW_WHT_,
|
||||
|
||||
SHOW_SET_BLK = SHOW_SET_ | SHOW_BLK_,
|
||||
SHOW_SET_WHT = SHOW_SET_ | SHOW_WHT_,
|
||||
SHOW_SET_BLK = SHOW_SET_ | SHOW_BLK_,
|
||||
SHOW_SET_WHT = SHOW_SET_ | SHOW_WHT_,
|
||||
|
||||
SHOW_CLR_BLK = SHOW_CLR_ | SHOW_BLK_,
|
||||
SHOW_CLR_WHT = SHOW_CLR_ | SHOW_WHT_,
|
||||
SHOW_CLR_BLK = SHOW_CLR_ | SHOW_BLK_,
|
||||
SHOW_CLR_WHT = SHOW_CLR_ | SHOW_WHT_,
|
||||
|
||||
SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
|
||||
SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
|
||||
}
|
||||
showMode_t;
|
||||
SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
|
||||
SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
|
||||
} showMode_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
typedef
|
||||
struct image {
|
||||
uint8_t w; // width
|
||||
uint8_t h; // height
|
||||
bool c; // compressed?
|
||||
uint16_t len; // image data length
|
||||
uint8_t tag; // rle tag
|
||||
uint8_t data[]; // image data
|
||||
}
|
||||
image_t;
|
||||
typedef struct image {
|
||||
uint8_t w; // width
|
||||
uint8_t h; // height
|
||||
bool c; // compressed?
|
||||
uint16_t len; // image data length
|
||||
uint8_t tag; // rle tag
|
||||
uint8_t data[]; // image data
|
||||
} image_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
//[TAG]
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
#ifndef IMGTEST
|
||||
# include <gui/gui.h>
|
||||
void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
|
||||
const image_t* img, const showMode_t mode) ;
|
||||
#include <gui/gui.h>
|
||||
void show(
|
||||
Canvas* const canvas,
|
||||
const uint8_t tlx,
|
||||
const uint8_t tly,
|
||||
const image_t* img,
|
||||
const showMode_t mode);
|
||||
#endif
|
||||
|
||||
#endif //IMAGES_H_
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "images.h"
|
||||
#include "images.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// This will be the plot function out of your graphics library
|
||||
//
|
||||
#define PLOT(x,y,c) do { \
|
||||
printf("%s", (c ? "#" : ".")); \
|
||||
if (x == img->w -1) printf("\n") ; \
|
||||
}while(0)
|
||||
#define PLOT(x, y, c) \
|
||||
do { \
|
||||
printf("%s", (c ? "#" : ".")); \
|
||||
if(x == img->w - 1) printf("\n"); \
|
||||
} while(0)
|
||||
|
||||
//+============================================================================
|
||||
// The pain we endure to avoid code duplication cleanly
|
||||
//
|
||||
#define PLOTBYTE(b) do { \
|
||||
for (uint8_t m = 0x80; m; m>>=1) { \
|
||||
PLOT(x,y, (b & m)); \
|
||||
if ( ((++x) == img->w) && !(x = 0) && ((++y) == img->h) ) break ; \
|
||||
} \
|
||||
}while(0)
|
||||
#define PLOTBYTE(b) \
|
||||
do { \
|
||||
for(uint8_t m = 0x80; m; m >>= 1) { \
|
||||
PLOT(x, y, (b & m)); \
|
||||
if(((++x) == img->w) && !(x = 0) && ((++y) == img->h)) break; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
void show (const image_t* img)
|
||||
{
|
||||
// Some variables
|
||||
const uint8_t* bp = img->data;
|
||||
unsigned int x = 0;
|
||||
unsigned int y = 0;
|
||||
void show(const image_t* img) {
|
||||
// Some variables
|
||||
const uint8_t* bp = img->data;
|
||||
unsigned int x = 0;
|
||||
unsigned int y = 0;
|
||||
|
||||
// Compressed
|
||||
if (img->c) {
|
||||
for (unsigned int i = 0; i < img->len; i++, bp++) {
|
||||
// Compressed data? {tag, length, value}
|
||||
if (*bp == img->tag) {
|
||||
for (uint16_t c = 0; c < bp[1]; c++) PLOTBYTE(bp[2]) ;
|
||||
bp += 3 -1;
|
||||
i += 3 -1;
|
||||
// Compressed
|
||||
if(img->c) {
|
||||
for(unsigned int i = 0; i < img->len; i++, bp++) {
|
||||
// Compressed data? {tag, length, value}
|
||||
if(*bp == img->tag) {
|
||||
for(uint16_t c = 0; c < bp[1]; c++) PLOTBYTE(bp[2]);
|
||||
bp += 3 - 1;
|
||||
i += 3 - 1;
|
||||
|
||||
// Uncompressed byte
|
||||
} else {
|
||||
PLOTBYTE(*bp);
|
||||
}
|
||||
}
|
||||
// Uncompressed byte
|
||||
} else {
|
||||
PLOTBYTE(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
// Not compressed
|
||||
} else {
|
||||
for (unsigned int i = 0; i < img->len; i++, bp++) PLOTBYTE(*bp) ;
|
||||
}
|
||||
// Not compressed
|
||||
} else {
|
||||
for(unsigned int i = 0; i < img->len; i++, bp++) PLOTBYTE(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
#undef PLOTBYTE
|
||||
#undef PLOTBYTE
|
||||
|
||||
//+============================================================================
|
||||
int main (void)
|
||||
{
|
||||
show(&img_zzz);
|
||||
return 0;
|
||||
int main(void) {
|
||||
show(&img_zzz);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#ifndef BC_LOGGING_H_
|
||||
#define BC_LOGGING_H_
|
||||
#ifndef BC_LOGGING_H_
|
||||
#define BC_LOGGING_H_
|
||||
|
||||
#include <furi.h>
|
||||
#include "err.h" // appName
|
||||
#include "err.h" // appName
|
||||
|
||||
//! WARNING: There is a bug in Furi such that if you crank LOG_LEVEL up to 6=TRACE
|
||||
//! AND you have menu->settings->system->logLevel = trace
|
||||
//! THEN this program will cause the FZ to crash when the plugin exits!
|
||||
#define LOG_LEVEL 4
|
||||
#define LOG_LEVEL 4
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// The FlipperZero Settings->System menu allows you to set the logging level at RUN-time
|
||||
@@ -27,44 +27,44 @@
|
||||
// The FlipperZero Settings->System menu allows you to set the logging level at RUN-time
|
||||
// This lets you limit it at COMPILE-time
|
||||
#ifndef LOG_LEVEL
|
||||
# define LOG_LEVEL 6 // default = full logging
|
||||
#define LOG_LEVEL 6 // default = full logging
|
||||
#endif
|
||||
|
||||
#if (LOG_LEVEL < 2)
|
||||
# undef FURI_LOG_E
|
||||
# define FURI_LOG_E(tag, fmt, ...)
|
||||
#if(LOG_LEVEL < 2)
|
||||
#undef FURI_LOG_E
|
||||
#define FURI_LOG_E(tag, fmt, ...)
|
||||
#endif
|
||||
|
||||
#if (LOG_LEVEL < 3)
|
||||
# undef FURI_LOG_W
|
||||
# define FURI_LOG_W(tag, fmt, ...)
|
||||
#if(LOG_LEVEL < 3)
|
||||
#undef FURI_LOG_W
|
||||
#define FURI_LOG_W(tag, fmt, ...)
|
||||
#endif
|
||||
|
||||
#if (LOG_LEVEL < 4)
|
||||
# undef FURI_LOG_I
|
||||
# define FURI_LOG_I(tag, fmt, ...)
|
||||
#if(LOG_LEVEL < 4)
|
||||
#undef FURI_LOG_I
|
||||
#define FURI_LOG_I(tag, fmt, ...)
|
||||
#endif
|
||||
|
||||
#if (LOG_LEVEL < 5)
|
||||
# undef FURI_LOG_D
|
||||
# define FURI_LOG_D(tag, fmt, ...)
|
||||
#if(LOG_LEVEL < 5)
|
||||
#undef FURI_LOG_D
|
||||
#define FURI_LOG_D(tag, fmt, ...)
|
||||
#endif
|
||||
|
||||
#if (LOG_LEVEL < 6)
|
||||
# undef FURI_LOG_T
|
||||
# define FURI_LOG_T(tag, fmt, ...)
|
||||
#if(LOG_LEVEL < 6)
|
||||
#undef FURI_LOG_T
|
||||
#define FURI_LOG_T(tag, fmt, ...)
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------
|
||||
// Logging helper macros
|
||||
//
|
||||
#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 INFO(fmt, ...) FURI_LOG_I(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 ERROR(fmt, ...) FURI_LOG_E(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 DEBUG(fmt, ...) FURI_LOG_D(appName, fmt __VA_OPT__(, ) __VA_ARGS__)
|
||||
#define TRACE(fmt, ...) FURI_LOG_T(appName, fmt __VA_OPT__(, ) __VA_ARGS__)
|
||||
|
||||
#define ENTER TRACE("(+) %s", __func__)
|
||||
#define LEAVE TRACE("(-) %s", __func__)
|
||||
#define ENTER TRACE("(+) %s", __func__)
|
||||
#define LEAVE TRACE("(-) %s", __func__)
|
||||
|
||||
#endif //BC_LOGGING_H_
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Avoid circular/nested/mulitple inclusion
|
||||
#ifndef ERR_H_
|
||||
#define ERR_H_
|
||||
#ifndef ERR_H_
|
||||
#define ERR_H_
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// Application name
|
||||
//
|
||||
static const char* const appName = "Wii_i2c"; //$ Name used in log files
|
||||
static const char* const appName = "Wii_i2c"; //$ Name used in log files
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// Error codes and messages
|
||||
@@ -13,57 +13,60 @@ static const char* const appName = "Wii_i2c"; //$ Name used in log files
|
||||
|
||||
// You should only ever (need to) edit this list
|
||||
// ...Watch out for extraneous whitespace after the terminating backslashes
|
||||
#define FOREACH_ES(esPrial) \
|
||||
/* The first line MUST define 'ERR_OK = 0' */ \
|
||||
esPrial( 0, ERR_OK , "OK (no error)") \
|
||||
\
|
||||
esPrial( 1, ERR_MALLOC_QUEUE , "malloc() fail - queue") \
|
||||
esPrial( 2, ERR_MALLOC_STATE , "malloc() fail - state") \
|
||||
esPrial( 3, ERR_MALLOC_TEXT , "malloc() fail - text") \
|
||||
esPrial( 4, ERR_MALLOC_VIEW , "malloc() fail - viewport") \
|
||||
esPrial( 5, ERR_NO_MUTEX , "Cannot create mutex") \
|
||||
esPrial( 6, ERR_NO_GUI , "Cannot open GUI") \
|
||||
esPrial( 7, ERR_NO_TIMER , "Cannot create timer") \
|
||||
esPrial( 8, ERR_NO_NOTIFY , "Cannot acquire notifications handle") \
|
||||
\
|
||||
esPrial(10, ERR_MUTEX_BLOCK , "Mutex block failed") \
|
||||
esPrial(11, ERR_MUTEX_RELEASE , "Mutex release failed") \
|
||||
\
|
||||
esPrial(20, ERR_QUEUE_RTOS , "queue - Undefined RTOS error") \
|
||||
esPrial(21, DEBUG_QUEUE_TIMEOUT, "queue - Timeout") \
|
||||
esPrial(22, ERR_QUEUE_RESOURCE , "queue - Resource not available") \
|
||||
esPrial(23, ERR_QUEUE_BADPRM , "queue - Bad parameter") \
|
||||
esPrial(24, ERR_QUEUE_NOMEM , "queue - Out of memory") \
|
||||
esPrial(25, ERR_QUEUE_ISR , "queue - Banned in ISR") \
|
||||
esPrial(26, ERR_QUEUE_UNK , "queue - Unknown") \
|
||||
\
|
||||
esPrial(30, WARN_SCAN_START , "Scan - Already started") \
|
||||
esPrial(31, WARN_SCAN_STOP , "Scan - Already stopped") \
|
||||
esPrial(32, ERR_TIMER_START , "Scan - Cannot start timer") \
|
||||
esPrial(33, ERR_TIMER_STOP , "Scan - Cannot stop timer") \
|
||||
//[EOT]
|
||||
#define FOREACH_ES(esPrial) \
|
||||
/* The first line MUST define 'ERR_OK = 0' */ \
|
||||
esPrial(0, ERR_OK, "OK (no error)") \
|
||||
\
|
||||
esPrial(1, ERR_MALLOC_QUEUE, "malloc() fail - queue") esPrial( \
|
||||
2, \
|
||||
ERR_MALLOC_STATE, \
|
||||
"malloc() fail - state") esPrial(3, ERR_MALLOC_TEXT, "malloc() fail - text") \
|
||||
esPrial(4, ERR_MALLOC_VIEW, "malloc() fail - viewport") esPrial( \
|
||||
5, ERR_NO_MUTEX, "Cannot create mutex") esPrial(6, ERR_NO_GUI, "Cannot open GUI") \
|
||||
esPrial(7, ERR_NO_TIMER, "Cannot create timer") esPrial( \
|
||||
8, ERR_NO_NOTIFY, "Cannot acquire notifications handle") \
|
||||
\
|
||||
esPrial(10, ERR_MUTEX_BLOCK, "Mutex block failed") esPrial( \
|
||||
11, ERR_MUTEX_RELEASE, "Mutex release failed") \
|
||||
\
|
||||
esPrial(20, ERR_QUEUE_RTOS, "queue - Undefined RTOS error") \
|
||||
esPrial(21, DEBUG_QUEUE_TIMEOUT, "queue - Timeout") esPrial( \
|
||||
22, ERR_QUEUE_RESOURCE, "queue - Resource not available") \
|
||||
esPrial(23, ERR_QUEUE_BADPRM, "queue - Bad parameter") esPrial( \
|
||||
24, ERR_QUEUE_NOMEM, "queue - Out of memory") \
|
||||
esPrial(25, ERR_QUEUE_ISR, "queue - Banned in ISR") esPrial( \
|
||||
26, ERR_QUEUE_UNK, "queue - Unknown") \
|
||||
\
|
||||
esPrial(30, WARN_SCAN_START, "Scan - Already started") \
|
||||
esPrial(31, WARN_SCAN_STOP, "Scan - Already stopped") \
|
||||
esPrial( \
|
||||
32, \
|
||||
ERR_TIMER_START, \
|
||||
"Scan - Cannot start timer") \
|
||||
esPrial( \
|
||||
33, \
|
||||
ERR_TIMER_STOP, \
|
||||
"Scan - Cannot stop timer") //[EOT]
|
||||
|
||||
// Declare list extraction macros
|
||||
#define ES_ENUM(num, ename, string) ename = num,
|
||||
#define ES_STRING(num, ename, string) string"\r\n",
|
||||
#define ES_ENUM(num, ename, string) ename = num,
|
||||
#define ES_STRING(num, ename, string) string "\r\n",
|
||||
|
||||
// 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
|
||||
#ifdef ERR_C_
|
||||
// Build the string list
|
||||
const char* const wii_errs[] = { FOREACH_ES(ES_STRING) };
|
||||
// Build the string list
|
||||
const char* const wii_errs[] = {FOREACH_ES(ES_STRING)};
|
||||
#else
|
||||
// Give access to string list
|
||||
extern const char* const wii_errs[];
|
||||
// Give access to string list
|
||||
extern const char* const wii_errs[];
|
||||
#endif
|
||||
|
||||
// This is a header file, clean up
|
||||
#undef ES_ENUM
|
||||
#undef ES_STRING
|
||||
#undef FOREACH_ES
|
||||
#undef ES_ENUM
|
||||
#undef ES_STRING
|
||||
#undef FOREACH_ES
|
||||
|
||||
#endif // ERR_H_
|
||||
|
||||
@@ -1,55 +1,49 @@
|
||||
#include <gui/gui.h> // GUI (screen/keyboard) API
|
||||
#include <gui/gui.h> // GUI (screen/keyboard) API
|
||||
|
||||
#include "images.h"
|
||||
#include "images.h"
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
static Canvas* _canvas;
|
||||
static uint8_t _tlx;
|
||||
static uint8_t _tly;
|
||||
static Canvas* _canvas;
|
||||
static uint8_t _tlx;
|
||||
static uint8_t _tly;
|
||||
|
||||
static uint8_t _x;
|
||||
static uint8_t _y;
|
||||
static uint8_t _x;
|
||||
static uint8_t _y;
|
||||
|
||||
static const image_t* _img;
|
||||
static const image_t* _img;
|
||||
|
||||
static bool _blk;
|
||||
static Color _set;
|
||||
static Color _clr;
|
||||
static bool _blk;
|
||||
static Color _set;
|
||||
static Color _clr;
|
||||
|
||||
//+============================================================================
|
||||
static
|
||||
void _showByteSet (const uint8_t b)
|
||||
{
|
||||
for (uint8_t m = 0x80; m; m >>= 1) {
|
||||
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 _showByteSet(const uint8_t b) {
|
||||
for(uint8_t m = 0x80; m; m >>= 1) {
|
||||
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)
|
||||
{
|
||||
for (uint8_t m = 0x80; m; m >>= 1) {
|
||||
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 _showByteClr(const uint8_t b) {
|
||||
for(uint8_t m = 0x80; m; m >>= 1) {
|
||||
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)
|
||||
{
|
||||
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));
|
||||
_blk = !_blk;
|
||||
}
|
||||
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) {
|
||||
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));
|
||||
_blk = !_blk;
|
||||
}
|
||||
canvas_draw_dot(_canvas, (_tlx + _x), (_tly + _y));
|
||||
if(((++_x) == _img->w) && !(_x = 0) && ((++_y) == _img->h)) break;
|
||||
}
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
@@ -61,81 +55,83 @@ void _showByteAll (const uint8_t b)
|
||||
// SHOW_ALL - plot all images pixels as they are
|
||||
// SHOW_ALL_INV - plot all images pixels inverted
|
||||
//
|
||||
void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
|
||||
const image_t* img, const showMode_t mode)
|
||||
{
|
||||
void(*fnShow)(const uint8_t) = NULL;
|
||||
void show(
|
||||
Canvas* const canvas,
|
||||
const uint8_t tlx,
|
||||
const uint8_t tly,
|
||||
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
|
||||
switch (mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
_set = ColorBlack;
|
||||
_clr = ColorWhite;
|
||||
break;
|
||||
// code size optimisation
|
||||
switch(mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
_set = ColorBlack;
|
||||
_clr = ColorWhite;
|
||||
break;
|
||||
|
||||
case SHOW_INV_:
|
||||
_set = ColorWhite;
|
||||
_clr = ColorBlack;
|
||||
break;
|
||||
case SHOW_INV_:
|
||||
_set = ColorWhite;
|
||||
_clr = ColorBlack;
|
||||
break;
|
||||
|
||||
case SHOW_BLK_:
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
break;
|
||||
case SHOW_BLK_:
|
||||
canvas_set_color(canvas, ColorBlack);
|
||||
break;
|
||||
|
||||
case SHOW_WHT_:
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
break;
|
||||
case SHOW_WHT_:
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
break;
|
||||
}
|
||||
switch(mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
case SHOW_INV_:
|
||||
fnShow = _showByteAll;
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
_blk = 0;
|
||||
break;
|
||||
|
||||
}
|
||||
switch (mode & SHOW_INV_) {
|
||||
case SHOW_NRM_:
|
||||
case SHOW_INV_:
|
||||
fnShow = _showByteAll;
|
||||
canvas_set_color(canvas, ColorWhite);
|
||||
_blk = 0;
|
||||
break;
|
||||
case SHOW_BLK_:
|
||||
case SHOW_WHT_:
|
||||
switch(mode & SHOW_ALL_) {
|
||||
case SHOW_SET_:
|
||||
fnShow = _showByteSet;
|
||||
break;
|
||||
case SHOW_CLR_:
|
||||
fnShow = _showByteClr;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
furi_check(fnShow);
|
||||
|
||||
case SHOW_BLK_:
|
||||
case SHOW_WHT_:
|
||||
switch (mode & SHOW_ALL_) {
|
||||
case SHOW_SET_:
|
||||
fnShow = _showByteSet;
|
||||
break;
|
||||
case SHOW_CLR_:
|
||||
fnShow = _showByteClr;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
furi_check(fnShow);
|
||||
// I want nested functions!
|
||||
_canvas = canvas;
|
||||
_img = img;
|
||||
_tlx = tlx;
|
||||
_tly = tly;
|
||||
_x = 0;
|
||||
_y = 0;
|
||||
|
||||
// I want nested functions!
|
||||
_canvas = canvas;
|
||||
_img = img;
|
||||
_tlx = tlx;
|
||||
_tly = tly;
|
||||
_x = 0;
|
||||
_y = 0;
|
||||
// Compressed
|
||||
if(img->c) {
|
||||
for(unsigned int i = 0; i < img->len; i++, bp++) {
|
||||
// Compressed data? {tag, length, value}
|
||||
if(*bp == img->tag) {
|
||||
for(uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]);
|
||||
bp += 3 - 1;
|
||||
i += 3 - 1;
|
||||
|
||||
// Compressed
|
||||
if (img->c) {
|
||||
for (unsigned int i = 0; i < img->len; i++, bp++) {
|
||||
// Compressed data? {tag, length, value}
|
||||
if (*bp == img->tag) {
|
||||
for (uint16_t c = 0; c < bp[1]; c++) fnShow(bp[2]) ;
|
||||
bp += 3 -1;
|
||||
i += 3 -1;
|
||||
// Uncompressed byte
|
||||
} else {
|
||||
fnShow(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
// Uncompressed byte
|
||||
} else {
|
||||
fnShow(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
// Not compressed
|
||||
} else {
|
||||
for (unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp) ;
|
||||
}
|
||||
// Not compressed
|
||||
} else {
|
||||
for(unsigned int i = 0; i < img->len; i++, bp++) fnShow(*bp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,134 +1,134 @@
|
||||
#ifndef IMAGES_H_
|
||||
#define IMAGES_H_
|
||||
#ifndef IMAGES_H_
|
||||
#define IMAGES_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
typedef
|
||||
enum showMode {
|
||||
// {INV:--:WHT:BLK::--:--:CLR:SET}
|
||||
SHOW_SET_ = 0x01,
|
||||
SHOW_CLR_ = 0x02,
|
||||
SHOW_ALL_ = SHOW_SET_ | SHOW_CLR_,
|
||||
typedef enum showMode {
|
||||
// {INV:--:WHT:BLK::--:--:CLR:SET}
|
||||
SHOW_SET_ = 0x01,
|
||||
SHOW_CLR_ = 0x02,
|
||||
SHOW_ALL_ = SHOW_SET_ | SHOW_CLR_,
|
||||
|
||||
SHOW_BLK_ = 0x10,
|
||||
SHOW_WHT_ = 0x20,
|
||||
SHOW_NRM_ = 0x00,
|
||||
SHOW_INV_ = SHOW_BLK_ | SHOW_WHT_,
|
||||
SHOW_BLK_ = 0x10,
|
||||
SHOW_WHT_ = 0x20,
|
||||
SHOW_NRM_ = 0x00,
|
||||
SHOW_INV_ = SHOW_BLK_ | SHOW_WHT_,
|
||||
|
||||
SHOW_SET_BLK = SHOW_SET_ | SHOW_BLK_,
|
||||
SHOW_SET_WHT = SHOW_SET_ | SHOW_WHT_,
|
||||
SHOW_SET_BLK = SHOW_SET_ | SHOW_BLK_,
|
||||
SHOW_SET_WHT = SHOW_SET_ | SHOW_WHT_,
|
||||
|
||||
SHOW_CLR_BLK = SHOW_CLR_ | SHOW_BLK_,
|
||||
SHOW_CLR_WHT = SHOW_CLR_ | SHOW_WHT_,
|
||||
SHOW_CLR_BLK = SHOW_CLR_ | SHOW_BLK_,
|
||||
SHOW_CLR_WHT = SHOW_CLR_ | SHOW_WHT_,
|
||||
|
||||
SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
|
||||
SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
|
||||
}
|
||||
showMode_t;
|
||||
SHOW_ALL = SHOW_ALL_ | SHOW_NRM_,
|
||||
SHOW_ALL_INV = SHOW_ALL_ | SHOW_INV_,
|
||||
} showMode_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
typedef
|
||||
struct image {
|
||||
uint8_t w; // width
|
||||
uint8_t h; // height
|
||||
bool c; // compressed?
|
||||
uint16_t len; // image data length
|
||||
uint8_t tag; // rle tag
|
||||
uint8_t data[]; // image data
|
||||
}
|
||||
image_t;
|
||||
typedef struct image {
|
||||
uint8_t w; // width
|
||||
uint8_t h; // height
|
||||
bool c; // compressed?
|
||||
uint16_t len; // image data length
|
||||
uint8_t tag; // rle tag
|
||||
uint8_t data[]; // image data
|
||||
} image_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
//[TAG]
|
||||
extern const image_t img_csLogo_Small;
|
||||
extern const image_t img_3x5_v;
|
||||
extern const image_t img_3x5_9;
|
||||
extern const image_t img_3x5_8;
|
||||
extern const image_t img_3x5_7;
|
||||
extern const image_t img_3x5_6;
|
||||
extern const image_t img_3x5_5;
|
||||
extern const image_t img_3x5_4;
|
||||
extern const image_t img_3x5_3;
|
||||
extern const image_t img_3x5_2;
|
||||
extern const image_t img_3x5_1;
|
||||
extern const image_t img_3x5_0;
|
||||
extern const image_t img_key_Ui;
|
||||
extern const image_t img_key_OKi;
|
||||
extern const image_t img_RIP;
|
||||
extern const image_t img_cc_trg_R4;
|
||||
extern const image_t img_cc_trg_R3;
|
||||
extern const image_t img_cc_trg_R2;
|
||||
extern const image_t img_cc_trg_R1;
|
||||
extern const image_t img_cc_trg_L4;
|
||||
extern const image_t img_cc_trg_L3;
|
||||
extern const image_t img_cc_trg_L2;
|
||||
extern const image_t img_cc_trg_L1;
|
||||
extern const image_t img_cc_Joy;
|
||||
extern const image_t img_cc_Main;
|
||||
extern const image_t img_cc_Cable;
|
||||
extern const image_t img_key_Back;
|
||||
extern const image_t img_key_OK;
|
||||
extern const image_t img_6x8_Z;
|
||||
extern const image_t img_6x8_Y;
|
||||
extern const image_t img_6x8_X;
|
||||
extern const image_t img_key_U;
|
||||
extern const image_t img_key_D;
|
||||
extern const image_t img_csLogo_FULL;
|
||||
extern const image_t img_6x8_7;
|
||||
extern const image_t img_key_R;
|
||||
extern const image_t img_key_L;
|
||||
extern const image_t img_5x7_7;
|
||||
extern const image_t img_5x7_F;
|
||||
extern const image_t img_5x7_E;
|
||||
extern const image_t img_5x7_D;
|
||||
extern const image_t img_5x7_C;
|
||||
extern const image_t img_5x7_B;
|
||||
extern const image_t img_5x7_A;
|
||||
extern const image_t img_5x7_9;
|
||||
extern const image_t img_5x7_8;
|
||||
extern const image_t img_5x7_6;
|
||||
extern const image_t img_5x7_5;
|
||||
extern const image_t img_5x7_4;
|
||||
extern const image_t img_5x7_3;
|
||||
extern const image_t img_5x7_2;
|
||||
extern const image_t img_5x7_1;
|
||||
extern const image_t img_5x7_0;
|
||||
extern const image_t img_6x8_v;
|
||||
extern const image_t img_6x8_n;
|
||||
extern const image_t img_6x8_G;
|
||||
extern const image_t img_6x8_F;
|
||||
extern const image_t img_6x8_E;
|
||||
extern const image_t img_6x8_d;
|
||||
extern const image_t img_6x8_C;
|
||||
extern const image_t img_6x8_B;
|
||||
extern const image_t img_6x8_A;
|
||||
extern const image_t img_6x8_9;
|
||||
extern const image_t img_6x8_8;
|
||||
extern const image_t img_6x8_6;
|
||||
extern const image_t img_6x8_5;
|
||||
extern const image_t img_6x8_4;
|
||||
extern const image_t img_6x8_3;
|
||||
extern const image_t img_6x8_2;
|
||||
extern const image_t img_6x8_1;
|
||||
extern const image_t img_6x8_0;
|
||||
extern const image_t img_ecp_SDA;
|
||||
extern const image_t img_ecp_SCL;
|
||||
extern const image_t img_ecp_port;
|
||||
extern const image_t img_cc_pad_UD1;
|
||||
extern const image_t img_cc_pad_LR1;
|
||||
extern const image_t img_cc_btn_Y1;
|
||||
extern const image_t img_cc_btn_X1;
|
||||
extern const image_t img_cc_btn_B1;
|
||||
extern const image_t img_cc_btn_A1;
|
||||
extern const image_t img_6x8_D;
|
||||
extern const image_t img_csLogo_Small;
|
||||
extern const image_t img_3x5_v;
|
||||
extern const image_t img_3x5_9;
|
||||
extern const image_t img_3x5_8;
|
||||
extern const image_t img_3x5_7;
|
||||
extern const image_t img_3x5_6;
|
||||
extern const image_t img_3x5_5;
|
||||
extern const image_t img_3x5_4;
|
||||
extern const image_t img_3x5_3;
|
||||
extern const image_t img_3x5_2;
|
||||
extern const image_t img_3x5_1;
|
||||
extern const image_t img_3x5_0;
|
||||
extern const image_t img_key_Ui;
|
||||
extern const image_t img_key_OKi;
|
||||
extern const image_t img_RIP;
|
||||
extern const image_t img_cc_trg_R4;
|
||||
extern const image_t img_cc_trg_R3;
|
||||
extern const image_t img_cc_trg_R2;
|
||||
extern const image_t img_cc_trg_R1;
|
||||
extern const image_t img_cc_trg_L4;
|
||||
extern const image_t img_cc_trg_L3;
|
||||
extern const image_t img_cc_trg_L2;
|
||||
extern const image_t img_cc_trg_L1;
|
||||
extern const image_t img_cc_Joy;
|
||||
extern const image_t img_cc_Main;
|
||||
extern const image_t img_cc_Cable;
|
||||
extern const image_t img_key_Back;
|
||||
extern const image_t img_key_OK;
|
||||
extern const image_t img_6x8_Z;
|
||||
extern const image_t img_6x8_Y;
|
||||
extern const image_t img_6x8_X;
|
||||
extern const image_t img_key_U;
|
||||
extern const image_t img_key_D;
|
||||
extern const image_t img_csLogo_FULL;
|
||||
extern const image_t img_6x8_7;
|
||||
extern const image_t img_key_R;
|
||||
extern const image_t img_key_L;
|
||||
extern const image_t img_5x7_7;
|
||||
extern const image_t img_5x7_F;
|
||||
extern const image_t img_5x7_E;
|
||||
extern const image_t img_5x7_D;
|
||||
extern const image_t img_5x7_C;
|
||||
extern const image_t img_5x7_B;
|
||||
extern const image_t img_5x7_A;
|
||||
extern const image_t img_5x7_9;
|
||||
extern const image_t img_5x7_8;
|
||||
extern const image_t img_5x7_6;
|
||||
extern const image_t img_5x7_5;
|
||||
extern const image_t img_5x7_4;
|
||||
extern const image_t img_5x7_3;
|
||||
extern const image_t img_5x7_2;
|
||||
extern const image_t img_5x7_1;
|
||||
extern const image_t img_5x7_0;
|
||||
extern const image_t img_6x8_v;
|
||||
extern const image_t img_6x8_n;
|
||||
extern const image_t img_6x8_G;
|
||||
extern const image_t img_6x8_F;
|
||||
extern const image_t img_6x8_E;
|
||||
extern const image_t img_6x8_d;
|
||||
extern const image_t img_6x8_C;
|
||||
extern const image_t img_6x8_B;
|
||||
extern const image_t img_6x8_A;
|
||||
extern const image_t img_6x8_9;
|
||||
extern const image_t img_6x8_8;
|
||||
extern const image_t img_6x8_6;
|
||||
extern const image_t img_6x8_5;
|
||||
extern const image_t img_6x8_4;
|
||||
extern const image_t img_6x8_3;
|
||||
extern const image_t img_6x8_2;
|
||||
extern const image_t img_6x8_1;
|
||||
extern const image_t img_6x8_0;
|
||||
extern const image_t img_ecp_SDA;
|
||||
extern const image_t img_ecp_SCL;
|
||||
extern const image_t img_ecp_port;
|
||||
extern const image_t img_cc_pad_UD1;
|
||||
extern const image_t img_cc_pad_LR1;
|
||||
extern const image_t img_cc_btn_Y1;
|
||||
extern const image_t img_cc_btn_X1;
|
||||
extern const image_t img_cc_btn_B1;
|
||||
extern const image_t img_cc_btn_A1;
|
||||
extern const image_t img_6x8_D;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
#ifndef IMGTEST
|
||||
# include <gui/gui.h>
|
||||
void show (Canvas* const canvas, const uint8_t tlx, const uint8_t tly,
|
||||
const image_t* img, const showMode_t mode) ;
|
||||
#include <gui/gui.h>
|
||||
void show(
|
||||
Canvas* const canvas,
|
||||
const uint8_t tlx,
|
||||
const uint8_t tly,
|
||||
const image_t* img,
|
||||
const showMode_t mode);
|
||||
#endif
|
||||
|
||||
#endif //IMAGES_H_
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -65,58 +65,66 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_RIP = { 128, 64, true, 837, 0x06, { // orig:1024, comp:18.26%
|
||||
0x06, 0x20, 0xFF, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xD4, 0x06, 0x0E, 0x00, 0x2B, 0xC8, 0x01, 0xFC,
|
||||
0x1E, 0x1F, 0xF0, 0x00, 0xFE, 0x20, 0x8F, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x13, 0xD4, 0x01, 0xFC,
|
||||
0x0E, 0x0F, 0xF0, 0x00, 0xFE, 0x71, 0xCF, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x2B, 0xC0, 0x00, 0x0E,
|
||||
0x0A, 0x00, 0x38, 0x01, 0x87, 0x71, 0xD8, 0x77, 0x1C, 0x07, 0x71, 0xC0, 0x03, 0xC0, 0x03, 0x8E,
|
||||
0x0A, 0x0E, 0x28, 0x01, 0xC5, 0x51, 0x5C, 0x77, 0x1D, 0xC7, 0x71, 0x40, 0x03, 0xC0, 0x03, 0x8A,
|
||||
0x0A, 0x0E, 0x28, 0x01, 0x47, 0x51, 0x5C, 0x55, 0x15, 0xC5, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A,
|
||||
0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x15, 0x45, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A,
|
||||
0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x15, 0x45, 0x51, 0xC0, 0x03, 0xC0, 0x02, 0x8E,
|
||||
0x0A, 0x0A, 0x38, 0x01, 0x40, 0x51, 0x54, 0x75, 0x55, 0x47, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8,
|
||||
0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x71, 0xD7, 0xC5, 0x15, 0x7C, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8,
|
||||
0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x3F, 0x97, 0xC5, 0x15, 0x7C, 0x57, 0x80, 0x03, 0xC0, 0x02, 0x9C,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0x40, 0x1B, 0x14, 0x75, 0x55, 0x4E, 0x57, 0xC0, 0x03, 0xC0, 0x02, 0x94,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0xC7, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x94,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0xC5, 0x0A, 0x1C, 0x77, 0x1D, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x94,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0x87, 0x0E, 0x1C, 0x77, 0x1D, 0x4A, 0x61, 0xC0, 0x03, 0xC0, 0x03, 0x9C,
|
||||
0xCE, 0xCE, 0xC0, 0x00, 0xFE, 0x0E, 0x0F, 0xE3, 0xF9, 0xCE, 0x3F, 0x80, 0x03, 0xC0, 0x03, 0x8E,
|
||||
0xDE, 0xDE, 0xC0, 0x00, 0xFE, 0x1F, 0x0F, 0xE3, 0xF9, 0xC7, 0x3F, 0x80, 0x03, 0xC0, 0x06, 0x0E,
|
||||
0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x01, 0x8C, 0x07, 0xF0, 0x03,
|
||||
0xC0, 0x06, 0x07, 0x00, 0x04, 0x00, 0x00, 0x02, 0x52, 0x18, 0x0C, 0x03, 0xC1, 0xD5, 0xC7, 0x57,
|
||||
0x77, 0x6D, 0xC4, 0x5D, 0x2B, 0x8E, 0xE0, 0x03, 0x5A, 0x20, 0x02, 0x03, 0xC0, 0x95, 0x04, 0x54,
|
||||
0x24, 0x55, 0x04, 0x55, 0xA1, 0x0A, 0x80, 0x01, 0x8C, 0x47, 0xC1, 0x03, 0xC0, 0x9D, 0x87, 0x27,
|
||||
0x26, 0x55, 0xC5, 0x55, 0x61, 0x0C, 0xC0, 0x00, 0x50, 0x88, 0x21, 0x03, 0xC0, 0x95, 0x01, 0x21,
|
||||
0x24, 0x44, 0x45, 0x55, 0x21, 0x0A, 0x80, 0x00, 0x20, 0x90, 0x11, 0x03, 0xC0, 0x95, 0xC7, 0x27,
|
||||
0x27, 0x45, 0xC6, 0xDD, 0x21, 0x0E, 0xE0, 0x00, 0x70, 0x91, 0x91, 0x03, 0xC0, 0x06, 0x0B, 0x00,
|
||||
0x88, 0x92, 0x51, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x01, 0x08, 0x92, 0x91, 0x03, 0xC0, 0x06, 0x0A,
|
||||
0x00, 0x01, 0x08, 0x92, 0x11, 0x03, 0xC1, 0xD5, 0xC7, 0x76, 0xDC, 0x45, 0xDD, 0x5D, 0x5C, 0x57,
|
||||
0x50, 0x00, 0x87, 0x11, 0xE2, 0x03, 0xC0, 0x95, 0x04, 0x55, 0x50, 0x44, 0x89, 0x55, 0x48, 0x55,
|
||||
0x50, 0x00, 0x80, 0x88, 0x03, 0x03, 0xC0, 0x9D, 0x87, 0x75, 0x58, 0x54, 0x89, 0xD5, 0x48, 0x25,
|
||||
0x50, 0x00, 0x40, 0x7C, 0x04, 0x83, 0xC0, 0x95, 0x01, 0x54, 0x50, 0x54, 0x89, 0x55, 0x48, 0x25,
|
||||
0x50, 0x00, 0x40, 0x07, 0xF8, 0x43, 0xC0, 0x95, 0xC7, 0x54, 0x5C, 0x6D, 0xC9, 0x5D, 0xC8, 0x27,
|
||||
0x70, 0x00, 0x30, 0x00, 0x00, 0x43, 0xC0, 0x06, 0x0B, 0x00, 0x0F, 0xFF, 0xFF, 0x83, 0xC0, 0x06,
|
||||
0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xC7, 0xF1, 0xFC, 0x7F, 0x00,
|
||||
0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xC7, 0xF1, 0xFC, 0x7F, 0x00,
|
||||
0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x05, 0x4E, 0x3B, 0x8E, 0xE3, 0x80,
|
||||
0x07, 0x1D, 0xC7, 0x71, 0xDC, 0x70, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4E, 0x3A, 0x8E, 0xE3, 0x80,
|
||||
0x05, 0x15, 0xC7, 0x51, 0x54, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x2B, 0x8A, 0xA2, 0x80,
|
||||
0x07, 0x15, 0x45, 0x71, 0x5C, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA2, 0x80,
|
||||
0x00, 0x15, 0x45, 0x01, 0x40, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA6, 0x80,
|
||||
0x00, 0x15, 0x4D, 0x01, 0x40, 0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4E, 0x28, 0x0E, 0xA6, 0x80,
|
||||
0x00, 0x1D, 0x4D, 0x01, 0xC0, 0x70, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x0E, 0xAA, 0x9F,
|
||||
0xE1, 0xF9, 0x55, 0x1F, 0x87, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x38, 0xAA, 0x90,
|
||||
0x23, 0xF1, 0x55, 0x3F, 0x0F, 0xC0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x38, 0xB2, 0x9F,
|
||||
0xE7, 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
|
||||
}};
|
||||
const image_t img_RIP = {
|
||||
128,
|
||||
64,
|
||||
true,
|
||||
837,
|
||||
0x06,
|
||||
{// orig:1024, comp:18.26%
|
||||
0x06, 0x20, 0xFF, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xD4, 0x06, 0x0E, 0x00, 0x2B, 0xC8, 0x01,
|
||||
0xFC, 0x1E, 0x1F, 0xF0, 0x00, 0xFE, 0x20, 0x8F, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x13, 0xD4,
|
||||
0x01, 0xFC, 0x0E, 0x0F, 0xF0, 0x00, 0xFE, 0x71, 0xCF, 0xE3, 0xF8, 0xFE, 0x3F, 0x80, 0x2B,
|
||||
0xC0, 0x00, 0x0E, 0x0A, 0x00, 0x38, 0x01, 0x87, 0x71, 0xD8, 0x77, 0x1C, 0x07, 0x71, 0xC0,
|
||||
0x03, 0xC0, 0x03, 0x8E, 0x0A, 0x0E, 0x28, 0x01, 0xC5, 0x51, 0x5C, 0x77, 0x1D, 0xC7, 0x71,
|
||||
0x40, 0x03, 0xC0, 0x03, 0x8A, 0x0A, 0x0E, 0x28, 0x01, 0x47, 0x51, 0x5C, 0x55, 0x15, 0xC5,
|
||||
0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A, 0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55, 0x15,
|
||||
0x45, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x8A, 0x0A, 0x0A, 0x28, 0x01, 0x40, 0x51, 0x54, 0x55,
|
||||
0x15, 0x45, 0x51, 0xC0, 0x03, 0xC0, 0x02, 0x8E, 0x0A, 0x0A, 0x38, 0x01, 0x40, 0x51, 0x54,
|
||||
0x75, 0x55, 0x47, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8, 0x0A, 0x0B, 0xE0, 0x01, 0x40, 0x71,
|
||||
0xD7, 0xC5, 0x15, 0x7C, 0x50, 0x00, 0x03, 0xC0, 0x02, 0xF8, 0x0A, 0x0B, 0xE0, 0x01, 0x40,
|
||||
0x3F, 0x97, 0xC5, 0x15, 0x7C, 0x57, 0x80, 0x03, 0xC0, 0x02, 0x9C, 0x0A, 0x0A, 0x00, 0x01,
|
||||
0x40, 0x1B, 0x14, 0x75, 0x55, 0x4E, 0x57, 0xC0, 0x03, 0xC0, 0x02, 0x94, 0x0A, 0x0A, 0x00,
|
||||
0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94, 0x0A, 0x0A,
|
||||
0x00, 0x01, 0x40, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x51, 0x40, 0x03, 0xC0, 0x02, 0x94, 0x0A,
|
||||
0x0A, 0x00, 0x01, 0xC7, 0x0A, 0x14, 0x55, 0x15, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02, 0x94,
|
||||
0x0A, 0x0A, 0x00, 0x01, 0xC5, 0x0A, 0x1C, 0x77, 0x1D, 0x4A, 0x71, 0x40, 0x03, 0xC0, 0x02,
|
||||
0x94, 0x0A, 0x0A, 0x00, 0x01, 0x87, 0x0E, 0x1C, 0x77, 0x1D, 0x4A, 0x61, 0xC0, 0x03, 0xC0,
|
||||
0x03, 0x9C, 0xCE, 0xCE, 0xC0, 0x00, 0xFE, 0x0E, 0x0F, 0xE3, 0xF9, 0xCE, 0x3F, 0x80, 0x03,
|
||||
0xC0, 0x03, 0x8E, 0xDE, 0xDE, 0xC0, 0x00, 0xFE, 0x1F, 0x0F, 0xE3, 0xF9, 0xC7, 0x3F, 0x80,
|
||||
0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0A, 0x00,
|
||||
0x01, 0x8C, 0x07, 0xF0, 0x03, 0xC0, 0x06, 0x07, 0x00, 0x04, 0x00, 0x00, 0x02, 0x52, 0x18,
|
||||
0x0C, 0x03, 0xC1, 0xD5, 0xC7, 0x57, 0x77, 0x6D, 0xC4, 0x5D, 0x2B, 0x8E, 0xE0, 0x03, 0x5A,
|
||||
0x20, 0x02, 0x03, 0xC0, 0x95, 0x04, 0x54, 0x24, 0x55, 0x04, 0x55, 0xA1, 0x0A, 0x80, 0x01,
|
||||
0x8C, 0x47, 0xC1, 0x03, 0xC0, 0x9D, 0x87, 0x27, 0x26, 0x55, 0xC5, 0x55, 0x61, 0x0C, 0xC0,
|
||||
0x00, 0x50, 0x88, 0x21, 0x03, 0xC0, 0x95, 0x01, 0x21, 0x24, 0x44, 0x45, 0x55, 0x21, 0x0A,
|
||||
0x80, 0x00, 0x20, 0x90, 0x11, 0x03, 0xC0, 0x95, 0xC7, 0x27, 0x27, 0x45, 0xC6, 0xDD, 0x21,
|
||||
0x0E, 0xE0, 0x00, 0x70, 0x91, 0x91, 0x03, 0xC0, 0x06, 0x0B, 0x00, 0x88, 0x92, 0x51, 0x03,
|
||||
0xC0, 0x06, 0x0A, 0x00, 0x01, 0x08, 0x92, 0x91, 0x03, 0xC0, 0x06, 0x0A, 0x00, 0x01, 0x08,
|
||||
0x92, 0x11, 0x03, 0xC1, 0xD5, 0xC7, 0x76, 0xDC, 0x45, 0xDD, 0x5D, 0x5C, 0x57, 0x50, 0x00,
|
||||
0x87, 0x11, 0xE2, 0x03, 0xC0, 0x95, 0x04, 0x55, 0x50, 0x44, 0x89, 0x55, 0x48, 0x55, 0x50,
|
||||
0x00, 0x80, 0x88, 0x03, 0x03, 0xC0, 0x9D, 0x87, 0x75, 0x58, 0x54, 0x89, 0xD5, 0x48, 0x25,
|
||||
0x50, 0x00, 0x40, 0x7C, 0x04, 0x83, 0xC0, 0x95, 0x01, 0x54, 0x50, 0x54, 0x89, 0x55, 0x48,
|
||||
0x25, 0x50, 0x00, 0x40, 0x07, 0xF8, 0x43, 0xC0, 0x95, 0xC7, 0x54, 0x5C, 0x6D, 0xC9, 0x5D,
|
||||
0xC8, 0x27, 0x70, 0x00, 0x30, 0x00, 0x00, 0x43, 0xC0, 0x06, 0x0B, 0x00, 0x0F, 0xFF, 0xFF,
|
||||
0x83, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x06, 0x0E, 0x00, 0x03, 0xC0, 0x00, 0x07, 0xC7,
|
||||
0xF1, 0xFC, 0x7F, 0x00, 0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07,
|
||||
0xC7, 0xF1, 0xFC, 0x7F, 0x00, 0x03, 0xF8, 0xFE, 0x3F, 0x8F, 0xE0, 0x00, 0x03, 0xC0, 0x00,
|
||||
0x05, 0x4E, 0x3B, 0x8E, 0xE3, 0x80, 0x07, 0x1D, 0xC7, 0x71, 0xDC, 0x70, 0x00, 0x03, 0xC0,
|
||||
0x00, 0x01, 0x4E, 0x3A, 0x8E, 0xE3, 0x80, 0x05, 0x15, 0xC7, 0x51, 0x54, 0x50, 0x00, 0x03,
|
||||
0xC0, 0x00, 0x01, 0x4A, 0x2B, 0x8A, 0xA2, 0x80, 0x07, 0x15, 0x45, 0x71, 0x5C, 0x50, 0x00,
|
||||
0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA2, 0x80, 0x00, 0x15, 0x45, 0x01, 0x40, 0x50,
|
||||
0x00, 0x03, 0xC0, 0x00, 0x01, 0x4A, 0x28, 0x0A, 0xA6, 0x80, 0x00, 0x15, 0x4D, 0x01, 0x40,
|
||||
0x50, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x4E, 0x28, 0x0E, 0xA6, 0x80, 0x00, 0x1D, 0x4D, 0x01,
|
||||
0xC0, 0x70, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x0E, 0xAA, 0x9F, 0xE1, 0xF9, 0x55,
|
||||
0x1F, 0x87, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xC3, 0xE8, 0x38, 0xAA, 0x90, 0x23, 0xF1,
|
||||
0x55, 0x3F, 0x0F, 0xC0, 0x00, 0x03, 0xC0, 0x00, 0x01, 0x40, 0x28, 0x38, 0xB2, 0x9F, 0xE7,
|
||||
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}};
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_Cable = { 4, 11, true, 4, 0x00, { // orig:6, comp:33.33%
|
||||
0x00, 0x05, 0xDB, 0xD0
|
||||
}};
|
||||
const image_t img_cc_Cable = {
|
||||
4,
|
||||
11,
|
||||
true,
|
||||
4,
|
||||
0x00,
|
||||
{// orig:6, comp:33.33%
|
||||
0x00,
|
||||
0x05,
|
||||
0xDB,
|
||||
0xD0}};
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_Joy = { 17, 17, false, 37, 0, {
|
||||
0x00, 0x80, 0x01, 0xF0, 0x0F, 0xDF, 0x87, 0x01, 0xC3, 0x00, 0x61, 0x00, 0x11, 0x80, 0x0C, 0xC0,
|
||||
0x06, 0xC0, 0x01, 0xB0, 0x01, 0x98, 0x00, 0xC4, 0x00, 0x43, 0x00, 0x61, 0xC0, 0x70, 0xFD, 0xF8,
|
||||
0x07, 0xC0, 0x00, 0x80, 0x00
|
||||
}};
|
||||
const image_t img_cc_Joy = {17, 17, false, 37, 0, {0x00, 0x80, 0x01, 0xF0, 0x0F, 0xDF, 0x87, 0x01,
|
||||
0xC3, 0x00, 0x61, 0x00, 0x11, 0x80, 0x0C, 0xC0,
|
||||
0x06, 0xC0, 0x01, 0xB0, 0x01, 0x98, 0x00, 0xC4,
|
||||
0x00, 0x43, 0x00, 0x61, 0xC0, 0x70, 0xFD, 0xF8,
|
||||
0x07, 0xC0, 0x00, 0x80, 0x00}};
|
||||
|
||||
@@ -54,39 +54,47 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_Main = { 116, 53, true, 542, 0x05, { // orig:769, comp:29.52%
|
||||
0x00, 0x00, 0x00, 0x7F, 0xC0, 0x05, 0x05, 0x00, 0x3F, 0xE0, 0x05, 0x04, 0x00, 0x01, 0xF8, 0x04,
|
||||
0x0F, 0x80, 0x00, 0x00, 0x1F, 0x02, 0x01, 0xF8, 0x05, 0x04, 0x00, 0x60, 0x00, 0x41, 0x04, 0x00,
|
||||
0x60, 0x02, 0x08, 0x20, 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xF0, 0x7F, 0xFF, 0xFF,
|
||||
0xE0, 0xFE, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x41, 0x04, 0x00, 0x60, 0x02, 0x08,
|
||||
0x20, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x50, 0x03, 0xFC, 0x10, 0x40, 0x06, 0x00, 0x20, 0x83, 0xFC,
|
||||
0x00, 0xA0, 0x00, 0x00, 0x09, 0x0F, 0xC0, 0x00, 0xF8, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x3F, 0x09,
|
||||
0x00, 0x00, 0x01, 0x1F, 0x05, 0x09, 0x00, 0x0F, 0x88, 0x00, 0x00, 0x20, 0x05, 0x0A, 0xFF, 0xF0,
|
||||
0x40, 0x00, 0x04, 0x78, 0x05, 0x09, 0x00, 0x01, 0xE2, 0x00, 0x00, 0x9C, 0x05, 0x0A, 0x00, 0x03,
|
||||
0x90, 0x00, 0x13, 0x05, 0x0B, 0x00, 0x0C, 0x80, 0x03, 0xE0, 0x05, 0x0B, 0x00, 0x7C, 0x00, 0x38,
|
||||
0x05, 0x05, 0x00, 0xC6, 0xD8, 0x05, 0x04, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x1F, 0xF0, 0x00, 0x00,
|
||||
0x0D, 0x60, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x60, 0x01, 0xFF, 0x00, 0x00, 0x00, 0xD6,
|
||||
0xD8, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x60, 0x0C, 0x00, 0x18, 0x30, 0x00, 0x00, 0x0D, 0x6D, 0x80,
|
||||
0x00, 0x00, 0x31, 0x80, 0x03, 0x01, 0xC0, 0x01, 0x83, 0x00, 0x00, 0x00, 0x6C, 0xD8, 0x00, 0x00,
|
||||
0x06, 0x0C, 0x00, 0x38, 0x18, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xCA, 0x60, 0x01, 0x81, 0x00,
|
||||
0x01, 0x93, 0x05, 0x07, 0x00, 0x0C, 0x46, 0x00, 0x0C, 0x30, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00,
|
||||
0xCA, 0x60, 0x00, 0xC2, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x05, 0x00, 0x07, 0x06, 0x0C, 0x1C, 0x04,
|
||||
0x60, 0x0F, 0xF8, 0x3F, 0xE0, 0x05, 0x05, 0x00, 0xF8, 0x31, 0x83, 0xE0, 0x64, 0x00, 0xC0, 0x00,
|
||||
0x06, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x02, 0x40, 0x0C, 0x00, 0x00, 0x60,
|
||||
0x01, 0x99, 0x99, 0x98, 0x03, 0x06, 0x0E, 0x0C, 0x98, 0x2C, 0x00, 0xCE, 0x00, 0xE6, 0x00, 0x10,
|
||||
0x90, 0x90, 0x80, 0x65, 0x30, 0x01, 0x94, 0xC3, 0x80, 0x0C, 0x00, 0x00, 0x60, 0x01, 0x09, 0x09,
|
||||
0x08, 0x06, 0x73, 0x00, 0x19, 0xCC, 0x18, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x19, 0x99, 0x99, 0x80,
|
||||
0x61, 0x30, 0x01, 0x94, 0xC1, 0x80, 0x0F, 0xF8, 0x3F, 0xE0, 0x00, 0xF0, 0xF0, 0xF0, 0x03, 0x26,
|
||||
0x0E, 0x0C, 0x18, 0x18, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x05, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x01,
|
||||
0x80, 0x00, 0x19, 0x30, 0x05, 0x06, 0x00, 0xF8, 0x31, 0x83, 0xE0, 0x18, 0x00, 0x01, 0x93, 0x05,
|
||||
0x06, 0x00, 0x07, 0x06, 0x8C, 0x1C, 0x01, 0x80, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xC8, 0x60,
|
||||
0x00, 0x18, 0x00, 0x01, 0x83, 0x05, 0x07, 0x00, 0x0C, 0xC6, 0x00, 0x01, 0x80, 0x00, 0x18, 0x30,
|
||||
0x05, 0x07, 0x00, 0xCA, 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
|
||||
}};
|
||||
const image_t img_cc_Main = {
|
||||
116,
|
||||
53,
|
||||
true,
|
||||
542,
|
||||
0x05,
|
||||
{// orig:769, comp:29.52%
|
||||
0x00, 0x00, 0x00, 0x7F, 0xC0, 0x05, 0x05, 0x00, 0x3F, 0xE0, 0x05, 0x04, 0x00, 0x01, 0xF8,
|
||||
0x04, 0x0F, 0x80, 0x00, 0x00, 0x1F, 0x02, 0x01, 0xF8, 0x05, 0x04, 0x00, 0x60, 0x00, 0x41,
|
||||
0x04, 0x00, 0x60, 0x02, 0x08, 0x20, 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0xF0,
|
||||
0x7F, 0xFF, 0xFF, 0xE0, 0xFE, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x41, 0x04,
|
||||
0x00, 0x60, 0x02, 0x08, 0x20, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x50, 0x03, 0xFC, 0x10, 0x40,
|
||||
0x06, 0x00, 0x20, 0x83, 0xFC, 0x00, 0xA0, 0x00, 0x00, 0x09, 0x0F, 0xC0, 0x00, 0xF8, 0x00,
|
||||
0x00, 0x01, 0xF0, 0x00, 0x3F, 0x09, 0x00, 0x00, 0x01, 0x1F, 0x05, 0x09, 0x00, 0x0F, 0x88,
|
||||
0x00, 0x00, 0x20, 0x05, 0x0A, 0xFF, 0xF0, 0x40, 0x00, 0x04, 0x78, 0x05, 0x09, 0x00, 0x01,
|
||||
0xE2, 0x00, 0x00, 0x9C, 0x05, 0x0A, 0x00, 0x03, 0x90, 0x00, 0x13, 0x05, 0x0B, 0x00, 0x0C,
|
||||
0x80, 0x03, 0xE0, 0x05, 0x0B, 0x00, 0x7C, 0x00, 0x38, 0x05, 0x05, 0x00, 0xC6, 0xD8, 0x05,
|
||||
0x04, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x0D, 0x60, 0x00, 0x00, 0x00,
|
||||
0x0E, 0x00, 0x0E, 0x00, 0x60, 0x01, 0xFF, 0x00, 0x00, 0x00, 0xD6, 0xD8, 0x00, 0x00, 0x01,
|
||||
0xF0, 0x00, 0x60, 0x0C, 0x00, 0x18, 0x30, 0x00, 0x00, 0x0D, 0x6D, 0x80, 0x00, 0x00, 0x31,
|
||||
0x80, 0x03, 0x01, 0xC0, 0x01, 0x83, 0x00, 0x00, 0x00, 0x6C, 0xD8, 0x00, 0x00, 0x06, 0x0C,
|
||||
0x00, 0x38, 0x18, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xCA, 0x60, 0x01, 0x81, 0x00, 0x01,
|
||||
0x93, 0x05, 0x07, 0x00, 0x0C, 0x46, 0x00, 0x0C, 0x30, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00,
|
||||
0xCA, 0x60, 0x00, 0xC2, 0x00, 0xFF, 0x83, 0xFE, 0x05, 0x05, 0x00, 0x07, 0x06, 0x0C, 0x1C,
|
||||
0x04, 0x60, 0x0F, 0xF8, 0x3F, 0xE0, 0x05, 0x05, 0x00, 0xF8, 0x31, 0x83, 0xE0, 0x64, 0x00,
|
||||
0xC0, 0x00, 0x06, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x02, 0x40, 0x0C,
|
||||
0x00, 0x00, 0x60, 0x01, 0x99, 0x99, 0x98, 0x03, 0x06, 0x0E, 0x0C, 0x98, 0x2C, 0x00, 0xCE,
|
||||
0x00, 0xE6, 0x00, 0x10, 0x90, 0x90, 0x80, 0x65, 0x30, 0x01, 0x94, 0xC3, 0x80, 0x0C, 0x00,
|
||||
0x00, 0x60, 0x01, 0x09, 0x09, 0x08, 0x06, 0x73, 0x00, 0x19, 0xCC, 0x18, 0x00, 0xC0, 0x00,
|
||||
0x06, 0x00, 0x19, 0x99, 0x99, 0x80, 0x61, 0x30, 0x01, 0x94, 0xC1, 0x80, 0x0F, 0xF8, 0x3F,
|
||||
0xE0, 0x00, 0xF0, 0xF0, 0xF0, 0x03, 0x26, 0x0E, 0x0C, 0x18, 0x18, 0x00, 0xFF, 0x83, 0xFE,
|
||||
0x05, 0x05, 0x00, 0x18, 0xC1, 0xF0, 0x63, 0x01, 0x80, 0x00, 0x19, 0x30, 0x05, 0x06, 0x00,
|
||||
0xF8, 0x31, 0x83, 0xE0, 0x18, 0x00, 0x01, 0x93, 0x05, 0x06, 0x00, 0x07, 0x06, 0x8C, 0x1C,
|
||||
0x01, 0x80, 0x00, 0x19, 0x30, 0x05, 0x07, 0x00, 0xC8, 0x60, 0x00, 0x18, 0x00, 0x01, 0x83,
|
||||
0x05, 0x07, 0x00, 0x0C, 0xC6, 0x00, 0x01, 0x80, 0x00, 0x18, 0x30, 0x05, 0x07, 0x00, 0xCA,
|
||||
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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -8,6 +8,4 @@
|
||||
|
||||
#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}};
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_L1 = { 17, 6, false, 13, 0, {
|
||||
0x1F, 0xC9, 0x34, 0x92, 0x64, 0x92, 0x54, 0x92, 0x44, 0x93, 0xFC, 0xFE, 0x00
|
||||
}};
|
||||
const image_t img_cc_trg_L1 = {
|
||||
17,
|
||||
6,
|
||||
false,
|
||||
13,
|
||||
0,
|
||||
{0x1F, 0xC9, 0x34, 0x92, 0x64, 0x92, 0x54, 0x92, 0x44, 0x93, 0xFC, 0xFE, 0x00}};
|
||||
|
||||
@@ -7,6 +7,22 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_L2 = { 17, 6, true, 12, 0x01, { // orig:13, comp:7.69%
|
||||
0x1F, 0xD5, 0x35, 0x55, 0x75, 0x01, 0x04, 0x55, 0x57, 0xFD, 0x7E, 0x00
|
||||
}};
|
||||
const image_t img_cc_trg_L2 = {
|
||||
17,
|
||||
6,
|
||||
true,
|
||||
12,
|
||||
0x01,
|
||||
{// orig:13, comp:7.69%
|
||||
0x1F,
|
||||
0xD5,
|
||||
0x35,
|
||||
0x55,
|
||||
0x75,
|
||||
0x01,
|
||||
0x04,
|
||||
0x55,
|
||||
0x57,
|
||||
0xFD,
|
||||
0x7E,
|
||||
0x00}};
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_L3 = { 17, 6, false, 13, 0, {
|
||||
0x1F, 0xB6, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6F, 0xFB, 0x7E, 0x00
|
||||
}};
|
||||
const image_t img_cc_trg_L3 = {
|
||||
17,
|
||||
6,
|
||||
false,
|
||||
13,
|
||||
0,
|
||||
{0x1F, 0xB6, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6D, 0xBB, 0x6F, 0xFB, 0x7E, 0x00}};
|
||||
|
||||
@@ -7,6 +7,18 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_L4 = { 17, 6, true, 8, 0x01, { // orig:13, comp:38.46%
|
||||
0x1F, 0xFF, 0xBF, 0x01, 0x08, 0xFF, 0xFE, 0x00
|
||||
}};
|
||||
const image_t img_cc_trg_L4 = {
|
||||
17,
|
||||
6,
|
||||
true,
|
||||
8,
|
||||
0x01,
|
||||
{// orig:13, comp:38.46%
|
||||
0x1F,
|
||||
0xFF,
|
||||
0xBF,
|
||||
0x01,
|
||||
0x08,
|
||||
0xFF,
|
||||
0xFE,
|
||||
0x00}};
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_R1 = { 17, 6, false, 13, 0, {
|
||||
0x49, 0xFC, 0x49, 0x25, 0x92, 0x49, 0x24, 0x92, 0x5F, 0xE4, 0x90, 0x0F, 0xE4
|
||||
}};
|
||||
const image_t img_cc_trg_R1 = {
|
||||
17,
|
||||
6,
|
||||
false,
|
||||
13,
|
||||
0,
|
||||
{0x49, 0xFC, 0x49, 0x25, 0x92, 0x49, 0x24, 0x92, 0x5F, 0xE4, 0x90, 0x0F, 0xE4}};
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_R2 = { 17, 6, false, 13, 0, {
|
||||
0x55, 0xFC, 0x55, 0x55, 0x95, 0x55, 0x75, 0x55, 0x5F, 0xF5, 0x50, 0x0F, 0xD4
|
||||
}};
|
||||
const image_t img_cc_trg_R2 = {
|
||||
17,
|
||||
6,
|
||||
false,
|
||||
13,
|
||||
0,
|
||||
{0x55, 0xFC, 0x55, 0x55, 0x95, 0x55, 0x75, 0x55, 0x5F, 0xF5, 0x50, 0x0F, 0xD4}};
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_R3 = { 17, 6, false, 13, 0, {
|
||||
0xB6, 0xFC, 0x36, 0xDB, 0xAD, 0xB6, 0xFB, 0x6D, 0xBF, 0xFB, 0x68, 0x0F, 0xD8
|
||||
}};
|
||||
const image_t img_cc_trg_R3 = {
|
||||
17,
|
||||
6,
|
||||
false,
|
||||
13,
|
||||
0,
|
||||
{0xB6, 0xFC, 0x36, 0xDB, 0xAD, 0xB6, 0xFB, 0x6D, 0xBF, 0xFB, 0x68, 0x0F, 0xD8}};
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_cc_trg_R4 = { 17, 6, true, 11, 0x00, { // orig:13, comp:15.38%
|
||||
0xFF, 0xFC, 0x7F, 0xFF, 0xBF, 0x00, 0x05, 0xFF, 0xF8, 0x0F, 0xFC
|
||||
}};
|
||||
const image_t img_cc_trg_R4 = {
|
||||
17,
|
||||
6,
|
||||
true,
|
||||
11,
|
||||
0x00,
|
||||
{// orig:13, comp:15.38%
|
||||
0xFF,
|
||||
0xFC,
|
||||
0x7F,
|
||||
0xFF,
|
||||
0xBF,
|
||||
0x00,
|
||||
0x05,
|
||||
0xFF,
|
||||
0xF8,
|
||||
0x0F,
|
||||
0xFC}};
|
||||
|
||||
@@ -41,41 +41,49 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_csLogo_FULL = { 124, 40, true, 571, 0x0B, { // orig:620, comp:7.90%
|
||||
0x3F, 0xFF, 0xFE, 0x10, 0x43, 0xF8, 0x7F, 0x0F, 0xE1, 0xFC, 0x0B, 0x05, 0x00, 0x03, 0xFF, 0xFF,
|
||||
0xE3, 0x8E, 0x3F, 0x87, 0xF0, 0xFE, 0x1F, 0xC0, 0x0B, 0x05, 0x00, 0xFC, 0x00, 0x07, 0x38, 0xE6,
|
||||
0x1C, 0xE3, 0x80, 0x73, 0x8E, 0x03, 0xBB, 0x80, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x52, 0x8A, 0x71,
|
||||
0xCE, 0x39, 0xC7, 0x38, 0xA0, 0x22, 0x10, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x05, 0x28, 0xA7, 0x14,
|
||||
0xA2, 0x9C, 0x52, 0x8A, 0x03, 0x39, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x52, 0x8A, 0x51, 0x4A,
|
||||
0x29, 0x45, 0x28, 0xA0, 0x20, 0x90, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x07, 0x28, 0xA5, 0x14, 0xA2,
|
||||
0x94, 0x52, 0x8E, 0x03, 0xB9, 0x40, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x02, 0x8A, 0x51, 0xCA, 0xA9,
|
||||
0x47, 0x28, 0x0B, 0x06, 0x00, 0xCC, 0x00, 0x00, 0x38, 0xE5, 0xF0, 0xA2, 0x97, 0xC2, 0x80, 0x06,
|
||||
0xEE, 0x80, 0x00, 0x00, 0x0E, 0xC3, 0x00, 0x01, 0xFC, 0x5F, 0x0A, 0x29, 0x7C, 0x2B, 0xC0, 0x2A,
|
||||
0xAA, 0x00, 0x00, 0x00, 0xDC, 0x30, 0x00, 0x0D, 0x85, 0x1C, 0xAA, 0x94, 0xE2, 0xBE, 0x02, 0xEE,
|
||||
0xE0, 0x00, 0x00, 0x0E, 0xC0, 0x30, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x28, 0xA0, 0x22, 0xA2,
|
||||
0x00, 0x00, 0x00, 0xDC, 0x04, 0x80, 0x05, 0x05, 0x14, 0xA2, 0x94, 0xA2, 0x8A, 0x07, 0x2E, 0x20,
|
||||
0x00, 0x08, 0x0E, 0xC0, 0x48, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x38, 0xA0, 0x00, 0x00, 0x00,
|
||||
0x01, 0x40, 0xDC, 0x03, 0x00, 0x05, 0x07, 0x1C, 0xE3, 0x94, 0xA3, 0x8A, 0x0B, 0x04, 0x00, 0xE2,
|
||||
0x0C, 0xC0, 0x00, 0x00, 0x70, 0x71, 0xCE, 0x39, 0x4A, 0x30, 0xE0, 0x00, 0x00, 0x00, 0x0C, 0x90,
|
||||
0xCC, 0x00, 0x00, 0x07, 0x03, 0xF8, 0x7F, 0x1C, 0xE1, 0xFC, 0x0B, 0x04, 0x00, 0x94, 0x8C, 0xC0,
|
||||
0x00, 0x00, 0xF8, 0x3F, 0x87, 0xF1, 0xC7, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x72, 0x24, 0xCC, 0x0B,
|
||||
0x0C, 0x00, 0x06, 0x15, 0x2C, 0xC0, 0x0B, 0x0C, 0x00, 0x48, 0x89, 0xCC, 0x00, 0xFE, 0x10, 0x43,
|
||||
0xF8, 0xFF, 0x8F, 0xE1, 0xFC, 0x3F, 0x80, 0x00, 0x39, 0x05, 0x3C, 0xC0, 0x0F, 0xE3, 0x8E, 0x3F,
|
||||
0x8F, 0xF8, 0xFE, 0x1F, 0xC3, 0xF8, 0x00, 0x03, 0x22, 0x27, 0xDC, 0x01, 0x87, 0x38, 0xE6, 0x1C,
|
||||
0xDD, 0x99, 0xF3, 0xFE, 0x61, 0xC0, 0x00, 0x21, 0x50, 0xFE, 0xC0, 0x1C, 0x52, 0x8A, 0x71, 0x41,
|
||||
0x41, 0xC0, 0x3A, 0xE7, 0x14, 0x00, 0x1C, 0x88, 0x9E, 0xDC, 0x01, 0x45, 0x28, 0xA5, 0x14, 0x14,
|
||||
0x14, 0x02, 0xAA, 0x51, 0x40, 0x01, 0x94, 0x13, 0xEE, 0xC0, 0x14, 0x52, 0x8A, 0x51, 0x41, 0x41,
|
||||
0x40, 0x2A, 0xA5, 0x14, 0x00, 0x12, 0x22, 0x7F, 0xDC, 0x01, 0x47, 0x28, 0xA5, 0x1C, 0x14, 0x14,
|
||||
0x02, 0xAA, 0x51, 0xC0, 0x0E, 0x05, 0x0F, 0x3E, 0xC0, 0x1C, 0x02, 0x8A, 0x70, 0x01, 0x41, 0x4E,
|
||||
0x2A, 0xA7, 0x00, 0x00, 0xC0, 0x09, 0xF0, 0xCC, 0x00, 0xFC, 0x38, 0xE3, 0xF0, 0x14, 0x17, 0x82,
|
||||
0xAA, 0x3F, 0x00, 0x09, 0x01, 0x3F, 0x8F, 0xC0, 0x03, 0xE1, 0xFC, 0x0F, 0x81, 0x41, 0x78, 0x2A,
|
||||
0xA0, 0xF8, 0x01, 0x28, 0x27, 0x98, 0xFC, 0x00, 0x07, 0x0D, 0x80, 0x1C, 0x14, 0x14, 0xE2, 0xAA,
|
||||
0x01, 0xC0, 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
|
||||
}};
|
||||
const image_t img_csLogo_FULL = {
|
||||
124,
|
||||
40,
|
||||
true,
|
||||
571,
|
||||
0x0B,
|
||||
{// orig:620, comp:7.90%
|
||||
0x3F, 0xFF, 0xFE, 0x10, 0x43, 0xF8, 0x7F, 0x0F, 0xE1, 0xFC, 0x0B, 0x05, 0x00, 0x03, 0xFF,
|
||||
0xFF, 0xE3, 0x8E, 0x3F, 0x87, 0xF0, 0xFE, 0x1F, 0xC0, 0x0B, 0x05, 0x00, 0xFC, 0x00, 0x07,
|
||||
0x38, 0xE6, 0x1C, 0xE3, 0x80, 0x73, 0x8E, 0x03, 0xBB, 0x80, 0x00, 0x00, 0x0F, 0xC0, 0x00,
|
||||
0x52, 0x8A, 0x71, 0xCE, 0x39, 0xC7, 0x38, 0xA0, 0x22, 0x10, 0x00, 0x00, 0x00, 0xFC, 0x00,
|
||||
0x05, 0x28, 0xA7, 0x14, 0xA2, 0x9C, 0x52, 0x8A, 0x03, 0x39, 0x00, 0x00, 0x00, 0x0C, 0xC0,
|
||||
0x00, 0x52, 0x8A, 0x51, 0x4A, 0x29, 0x45, 0x28, 0xA0, 0x20, 0x90, 0x00, 0x00, 0x00, 0xFC,
|
||||
0x00, 0x07, 0x28, 0xA5, 0x14, 0xA2, 0x94, 0x52, 0x8E, 0x03, 0xB9, 0x40, 0x00, 0x00, 0x0F,
|
||||
0xC0, 0x00, 0x02, 0x8A, 0x51, 0xCA, 0xA9, 0x47, 0x28, 0x0B, 0x06, 0x00, 0xCC, 0x00, 0x00,
|
||||
0x38, 0xE5, 0xF0, 0xA2, 0x97, 0xC2, 0x80, 0x06, 0xEE, 0x80, 0x00, 0x00, 0x0E, 0xC3, 0x00,
|
||||
0x01, 0xFC, 0x5F, 0x0A, 0x29, 0x7C, 0x2B, 0xC0, 0x2A, 0xAA, 0x00, 0x00, 0x00, 0xDC, 0x30,
|
||||
0x00, 0x0D, 0x85, 0x1C, 0xAA, 0x94, 0xE2, 0xBE, 0x02, 0xEE, 0xE0, 0x00, 0x00, 0x0E, 0xC0,
|
||||
0x30, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x28, 0xA0, 0x22, 0xA2, 0x00, 0x00, 0x00, 0xDC,
|
||||
0x04, 0x80, 0x05, 0x05, 0x14, 0xA2, 0x94, 0xA2, 0x8A, 0x07, 0x2E, 0x20, 0x00, 0x08, 0x0E,
|
||||
0xC0, 0x48, 0x00, 0x50, 0x51, 0x4A, 0x29, 0x4A, 0x38, 0xA0, 0x00, 0x00, 0x00, 0x01, 0x40,
|
||||
0xDC, 0x03, 0x00, 0x05, 0x07, 0x1C, 0xE3, 0x94, 0xA3, 0x8A, 0x0B, 0x04, 0x00, 0xE2, 0x0C,
|
||||
0xC0, 0x00, 0x00, 0x70, 0x71, 0xCE, 0x39, 0x4A, 0x30, 0xE0, 0x00, 0x00, 0x00, 0x0C, 0x90,
|
||||
0xCC, 0x00, 0x00, 0x07, 0x03, 0xF8, 0x7F, 0x1C, 0xE1, 0xFC, 0x0B, 0x04, 0x00, 0x94, 0x8C,
|
||||
0xC0, 0x00, 0x00, 0xF8, 0x3F, 0x87, 0xF1, 0xC7, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x72, 0x24,
|
||||
0xCC, 0x0B, 0x0C, 0x00, 0x06, 0x15, 0x2C, 0xC0, 0x0B, 0x0C, 0x00, 0x48, 0x89, 0xCC, 0x00,
|
||||
0xFE, 0x10, 0x43, 0xF8, 0xFF, 0x8F, 0xE1, 0xFC, 0x3F, 0x80, 0x00, 0x39, 0x05, 0x3C, 0xC0,
|
||||
0x0F, 0xE3, 0x8E, 0x3F, 0x8F, 0xF8, 0xFE, 0x1F, 0xC3, 0xF8, 0x00, 0x03, 0x22, 0x27, 0xDC,
|
||||
0x01, 0x87, 0x38, 0xE6, 0x1C, 0xDD, 0x99, 0xF3, 0xFE, 0x61, 0xC0, 0x00, 0x21, 0x50, 0xFE,
|
||||
0xC0, 0x1C, 0x52, 0x8A, 0x71, 0x41, 0x41, 0xC0, 0x3A, 0xE7, 0x14, 0x00, 0x1C, 0x88, 0x9E,
|
||||
0xDC, 0x01, 0x45, 0x28, 0xA5, 0x14, 0x14, 0x14, 0x02, 0xAA, 0x51, 0x40, 0x01, 0x94, 0x13,
|
||||
0xEE, 0xC0, 0x14, 0x52, 0x8A, 0x51, 0x41, 0x41, 0x40, 0x2A, 0xA5, 0x14, 0x00, 0x12, 0x22,
|
||||
0x7F, 0xDC, 0x01, 0x47, 0x28, 0xA5, 0x1C, 0x14, 0x14, 0x02, 0xAA, 0x51, 0xC0, 0x0E, 0x05,
|
||||
0x0F, 0x3E, 0xC0, 0x1C, 0x02, 0x8A, 0x70, 0x01, 0x41, 0x4E, 0x2A, 0xA7, 0x00, 0x00, 0xC0,
|
||||
0x09, 0xF0, 0xCC, 0x00, 0xFC, 0x38, 0xE3, 0xF0, 0x14, 0x17, 0x82, 0xAA, 0x3F, 0x00, 0x09,
|
||||
0x01, 0x3F, 0x8F, 0xC0, 0x03, 0xE1, 0xFC, 0x0F, 0x81, 0x41, 0x78, 0x2A, 0xA0, 0xF8, 0x01,
|
||||
0x28, 0x27, 0x98, 0xFC, 0x00, 0x07, 0x0D, 0x80, 0x1C, 0x14, 0x14, 0xE2, 0xAA, 0x01, 0xC0,
|
||||
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}};
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_csLogo_Small = { 9, 12, false, 14, 0, {
|
||||
0xFF, 0xFF, 0xF0, 0x78, 0x3D, 0x06, 0x3F, 0x13, 0x88, 0xC7, 0xE0, 0x7D, 0x3E, 0xF0
|
||||
}};
|
||||
const image_t img_csLogo_Small = {
|
||||
9,
|
||||
12,
|
||||
false,
|
||||
14,
|
||||
0,
|
||||
{0xFF, 0xFF, 0xF0, 0x78, 0x3D, 0x06, 0x3F, 0x13, 0x88, 0xC7, 0xE0, 0x7D, 0x3E, 0xF0}};
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_ecp_SCL = { 16, 7, false, 14, 0, {
|
||||
0x3F, 0x8F, 0x3F, 0x8F, 0x31, 0x8C, 0x31, 0x8C, 0x31, 0x8C, 0xF1, 0xFC, 0xF1, 0xFC
|
||||
}};
|
||||
const image_t img_ecp_SCL = {
|
||||
16,
|
||||
7,
|
||||
false,
|
||||
14,
|
||||
0,
|
||||
{0x3F, 0x8F, 0x3F, 0x8F, 0x31, 0x8C, 0x31, 0x8C, 0x31, 0x8C, 0xF1, 0xFC, 0xF1, 0xFC}};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_ecp_SDA = { 17, 12, false, 26, 0, {
|
||||
0x10, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1F, 0xFC, 0x0F, 0xFE, 0x43, 0x00, 0x30, 0xC0, 0x0C, 0x27,
|
||||
0xFF, 0x03, 0xFF, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x80
|
||||
}};
|
||||
const image_t img_ecp_SDA = {17, 12, false, 26, 0, {0x10, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1F,
|
||||
0xFC, 0x0F, 0xFE, 0x43, 0x00, 0x30, 0xC0,
|
||||
0x0C, 0x27, 0xFF, 0x03, 0xFF, 0x80, 0x01,
|
||||
0x80, 0x01, 0x80, 0x00, 0x80}};
|
||||
|
||||
@@ -43,24 +43,30 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_ecp_port = { 69, 42, true, 290, 0x04, { // orig:363, comp:20.11%
|
||||
0x00, 0x2A, 0x04, 0x06, 0xAA, 0xA8, 0x02, 0x04, 0x07, 0xAA, 0x80, 0x2A, 0x04, 0x07, 0xAA, 0x02,
|
||||
0x04, 0x07, 0xAA, 0xA0, 0x2A, 0x04, 0x07, 0xAA, 0x82, 0x04, 0x07, 0xAA, 0xA8, 0x2A, 0x04, 0x07,
|
||||
0xAA, 0xA3, 0x04, 0x07, 0xFF, 0xAA, 0x1F, 0x04, 0x06, 0xFF, 0xFE, 0xA8, 0xC0, 0x04, 0x06, 0x00,
|
||||
0x6A, 0x86, 0x04, 0x06, 0x00, 0x03, 0xAA, 0x30, 0x04, 0x06, 0x00, 0x1A, 0xA1, 0x80, 0x04, 0x06,
|
||||
0x00, 0xEA, 0x8C, 0x04, 0x06, 0x00, 0x06, 0xA8, 0x61, 0x04, 0x05, 0xFF, 0xFC, 0x3A, 0xA3, 0x0F,
|
||||
0x04, 0x05, 0xFF, 0xE1, 0xAA, 0x18, 0x61, 0x83, 0x0C, 0x18, 0x60, 0xC3, 0x0E, 0xA8, 0xC3, 0x0C,
|
||||
0x18, 0x60, 0xC3, 0x06, 0x18, 0x6A, 0x86, 0x18, 0x7F, 0xC3, 0xFE, 0x1F, 0xF0, 0xC3, 0xAA, 0x30,
|
||||
0xC3, 0xFE, 0x1F, 0xF0, 0xFF, 0x86, 0x1A, 0xA1, 0x86, 0x04, 0x05, 0x00, 0x30, 0xEA, 0xBC, 0x30,
|
||||
0x04, 0x04, 0x00, 0x01, 0x86, 0xFB, 0xE1, 0x80, 0x04, 0x04, 0x00, 0x0C, 0x3F, 0xFF, 0x0C, 0x04,
|
||||
0x05, 0x00, 0x61, 0xBE, 0x78, 0x60, 0x04, 0x04, 0x00, 0x03, 0x0F, 0xF8, 0xC3, 0x0F, 0xF8, 0x00,
|
||||
0x03, 0xFE, 0x18, 0x6A, 0x86, 0x18, 0x7F, 0xC0, 0x00, 0x1F, 0xF0, 0xC3, 0xAA, 0x30, 0xC3, 0x06,
|
||||
0x1F, 0xF0, 0xC1, 0x86, 0x1A, 0xA1, 0x86, 0x18, 0x30, 0x80, 0x86, 0x0C, 0x30, 0xEA, 0x8C, 0x3F,
|
||||
0x04, 0x05, 0xFF, 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
|
||||
}};
|
||||
const image_t img_ecp_port = {
|
||||
69,
|
||||
42,
|
||||
true,
|
||||
290,
|
||||
0x04,
|
||||
{// orig:363, comp:20.11%
|
||||
0x00, 0x2A, 0x04, 0x06, 0xAA, 0xA8, 0x02, 0x04, 0x07, 0xAA, 0x80, 0x2A, 0x04, 0x07, 0xAA,
|
||||
0x02, 0x04, 0x07, 0xAA, 0xA0, 0x2A, 0x04, 0x07, 0xAA, 0x82, 0x04, 0x07, 0xAA, 0xA8, 0x2A,
|
||||
0x04, 0x07, 0xAA, 0xA3, 0x04, 0x07, 0xFF, 0xAA, 0x1F, 0x04, 0x06, 0xFF, 0xFE, 0xA8, 0xC0,
|
||||
0x04, 0x06, 0x00, 0x6A, 0x86, 0x04, 0x06, 0x00, 0x03, 0xAA, 0x30, 0x04, 0x06, 0x00, 0x1A,
|
||||
0xA1, 0x80, 0x04, 0x06, 0x00, 0xEA, 0x8C, 0x04, 0x06, 0x00, 0x06, 0xA8, 0x61, 0x04, 0x05,
|
||||
0xFF, 0xFC, 0x3A, 0xA3, 0x0F, 0x04, 0x05, 0xFF, 0xE1, 0xAA, 0x18, 0x61, 0x83, 0x0C, 0x18,
|
||||
0x60, 0xC3, 0x0E, 0xA8, 0xC3, 0x0C, 0x18, 0x60, 0xC3, 0x06, 0x18, 0x6A, 0x86, 0x18, 0x7F,
|
||||
0xC3, 0xFE, 0x1F, 0xF0, 0xC3, 0xAA, 0x30, 0xC3, 0xFE, 0x1F, 0xF0, 0xFF, 0x86, 0x1A, 0xA1,
|
||||
0x86, 0x04, 0x05, 0x00, 0x30, 0xEA, 0xBC, 0x30, 0x04, 0x04, 0x00, 0x01, 0x86, 0xFB, 0xE1,
|
||||
0x80, 0x04, 0x04, 0x00, 0x0C, 0x3F, 0xFF, 0x0C, 0x04, 0x05, 0x00, 0x61, 0xBE, 0x78, 0x60,
|
||||
0x04, 0x04, 0x00, 0x03, 0x0F, 0xF8, 0xC3, 0x0F, 0xF8, 0x00, 0x03, 0xFE, 0x18, 0x6A, 0x86,
|
||||
0x18, 0x7F, 0xC0, 0x00, 0x1F, 0xF0, 0xC3, 0xAA, 0x30, 0xC3, 0x06, 0x1F, 0xF0, 0xC1, 0x86,
|
||||
0x1A, 0xA1, 0x86, 0x18, 0x30, 0x80, 0x86, 0x0C, 0x30, 0xEA, 0x8C, 0x3F, 0x04, 0x05, 0xFF,
|
||||
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}};
|
||||
|
||||
@@ -10,6 +10,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_Back = { 9, 9, false, 11, 0, {
|
||||
0x7F, 0x7F, 0xFB, 0xF8, 0x7E, 0xDF, 0xEF, 0xCF, 0xFF, 0x3F, 0x00
|
||||
}};
|
||||
const image_t img_key_Back =
|
||||
{9, 9, false, 11, 0, {0x7F, 0x7F, 0xFB, 0xF8, 0x7E, 0xDF, 0xEF, 0xCF, 0xFF, 0x3F, 0x00}};
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_D = { 9, 8, false, 9, 0, {
|
||||
0x7F, 0x7F, 0xFF, 0xF8, 0x3E, 0x3F, 0xBF, 0xFE, 0xFE
|
||||
}};
|
||||
const image_t img_key_D =
|
||||
{9, 8, false, 9, 0, {0x7F, 0x7F, 0xFF, 0xF8, 0x3E, 0x3F, 0xBF, 0xFE, 0xFE}};
|
||||
|
||||
@@ -10,6 +10,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_L = { 8, 9, false, 9, 0, {
|
||||
0x7E, 0xFF, 0xF7, 0xE7, 0xC7, 0xE7, 0xF7, 0xFF, 0x7E
|
||||
}};
|
||||
const image_t img_key_L =
|
||||
{8, 9, false, 9, 0, {0x7E, 0xFF, 0xF7, 0xE7, 0xC7, 0xE7, 0xF7, 0xFF, 0x7E}};
|
||||
|
||||
@@ -10,6 +10,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_OK = { 9, 9, false, 11, 0, {
|
||||
0x7F, 0x7F, 0xF8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8F, 0xFF, 0x3F, 0x00
|
||||
}};
|
||||
const image_t img_key_OK =
|
||||
{9, 9, false, 11, 0, {0x7F, 0x7F, 0xF8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8F, 0xFF, 0x3F, 0x00}};
|
||||
|
||||
@@ -10,6 +10,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_OKi = { 9, 9, false, 11, 0, {
|
||||
0x7F, 0x60, 0xE7, 0x37, 0xDB, 0xED, 0xF6, 0x73, 0x83, 0x7F, 0x00
|
||||
}};
|
||||
const image_t img_key_OKi =
|
||||
{9, 9, false, 11, 0, {0x7F, 0x60, 0xE7, 0x37, 0xDB, 0xED, 0xF6, 0x73, 0x83, 0x7F, 0x00}};
|
||||
|
||||
@@ -10,6 +10,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_R = { 8, 9, false, 9, 0, {
|
||||
0x7E, 0xFF, 0xEF, 0xE7, 0xE3, 0xE7, 0xEF, 0xFF, 0x7E
|
||||
}};
|
||||
const image_t img_key_R =
|
||||
{8, 9, false, 9, 0, {0x7E, 0xFF, 0xEF, 0xE7, 0xE3, 0xE7, 0xEF, 0xFF, 0x7E}};
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_U = { 9, 8, false, 9, 0, {
|
||||
0x7F, 0x7F, 0xFD, 0xFC, 0x7C, 0x1F, 0xFF, 0xFE, 0xFE
|
||||
}};
|
||||
const image_t img_key_U =
|
||||
{9, 8, false, 9, 0, {0x7F, 0x7F, 0xFD, 0xFC, 0x7C, 0x1F, 0xFF, 0xFE, 0xFE}};
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
|
||||
#include "images.h"
|
||||
|
||||
const image_t img_key_Ui = { 9, 8, false, 9, 0, {
|
||||
0x7F, 0x60, 0xE2, 0x33, 0x9B, 0xEC, 0x07, 0x06, 0xFE
|
||||
}};
|
||||
const image_t img_key_Ui =
|
||||
{9, 8, false, 9, 0, {0x7F, 0x60, 0xE2, 0x33, 0x9B, 0xEC, 0x07, 0x06, 0xFE}};
|
||||
|
||||
@@ -40,62 +40,70 @@ void furi_hal_i2c_release (FuriHalI2cBusHandle* handle)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef I2C_WORKAROUND_H_
|
||||
#define I2C_WORKAROUND_H_
|
||||
#ifndef I2C_WORKAROUND_H_
|
||||
#define I2C_WORKAROUND_H_
|
||||
|
||||
#include <furi_hal.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
#define ENABLE_WORKAROUND 1
|
||||
|
||||
#if ENABLE_WORKAROUND == 1
|
||||
//+============================================================================ ========================================
|
||||
static inline
|
||||
bool furi_hal_Wi2c_is_device_ready (FuriHalI2cBusHandle* const bus, const uint8_t addr, const uint32_t tmo)
|
||||
{
|
||||
furi_hal_i2c_acquire(bus);
|
||||
bool rv = furi_hal_i2c_is_device_ready(bus, addr, tmo);
|
||||
furi_hal_i2c_release(bus);
|
||||
return rv;
|
||||
}
|
||||
//+============================================================================ ========================================
|
||||
static inline bool furi_hal_Wi2c_is_device_ready(
|
||||
FuriHalI2cBusHandle* const bus,
|
||||
const uint8_t addr,
|
||||
const uint32_t tmo) {
|
||||
furi_hal_i2c_acquire(bus);
|
||||
bool rv = furi_hal_i2c_is_device_ready(bus, addr, tmo);
|
||||
furi_hal_i2c_release(bus);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
static inline
|
||||
bool furi_hal_Wi2c_tx ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
|
||||
const void* buf, const size_t len, const uint32_t tmo )
|
||||
{
|
||||
furi_hal_i2c_acquire(bus);
|
||||
bool rv = furi_hal_i2c_tx(bus, addr, buf, len, tmo);
|
||||
furi_hal_i2c_release(bus);
|
||||
return rv;
|
||||
}
|
||||
//+============================================================================
|
||||
static inline bool furi_hal_Wi2c_tx(
|
||||
FuriHalI2cBusHandle* const bus,
|
||||
const uint8_t addr,
|
||||
const void* buf,
|
||||
const size_t len,
|
||||
const uint32_t tmo) {
|
||||
furi_hal_i2c_acquire(bus);
|
||||
bool rv = furi_hal_i2c_tx(bus, addr, buf, len, tmo);
|
||||
furi_hal_i2c_release(bus);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
static inline
|
||||
bool furi_hal_Wi2c_rx ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
|
||||
void* buf, const size_t len, const uint32_t tmo )
|
||||
{
|
||||
furi_hal_i2c_acquire(bus);
|
||||
bool rv = furi_hal_i2c_rx(bus, addr, buf, len, tmo);
|
||||
furi_hal_i2c_release(bus);
|
||||
return rv;
|
||||
}
|
||||
//+============================================================================
|
||||
static inline bool furi_hal_Wi2c_rx(
|
||||
FuriHalI2cBusHandle* const bus,
|
||||
const uint8_t addr,
|
||||
void* buf,
|
||||
const size_t len,
|
||||
const uint32_t tmo) {
|
||||
furi_hal_i2c_acquire(bus);
|
||||
bool rv = furi_hal_i2c_rx(bus, addr, buf, len, tmo);
|
||||
furi_hal_i2c_release(bus);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
static inline
|
||||
bool furi_hal_Wi2c_trx ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
|
||||
const void* tx, 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);
|
||||
if (rv) rv = furi_hal_Wi2c_rx(bus, addr, rx, rxlen, tmo);
|
||||
return rv;
|
||||
}
|
||||
//+============================================================================
|
||||
static inline bool furi_hal_Wi2c_trx(
|
||||
FuriHalI2cBusHandle* const bus,
|
||||
const uint8_t addr,
|
||||
const void* tx,
|
||||
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);
|
||||
if(rv) rv = furi_hal_Wi2c_rx(bus, addr, rx, rxlen, tmo);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
# 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_rx(...) furi_hal_Wi2c_rx(__VA_ARGS__)
|
||||
# define furi_hal_i2c_trx(...) furi_hal_Wi2c_trx(__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_rx(...) furi_hal_Wi2c_rx(__VA_ARGS__)
|
||||
#define furi_hal_i2c_trx(...) furi_hal_Wi2c_trx(__VA_ARGS__)
|
||||
|
||||
#endif //ENABLE_WORKAROUND
|
||||
|
||||
@@ -103,17 +111,21 @@ void furi_hal_i2c_release (FuriHalI2cBusHandle* handle)
|
||||
// Some devices take a moment to respond to read requests
|
||||
// The puts a delay between the address being set and the data being read
|
||||
//
|
||||
static inline
|
||||
bool furi_hal_i2c_trxd ( FuriHalI2cBusHandle* const bus, const uint8_t addr,
|
||||
const void* tx, 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);
|
||||
if (rv) {
|
||||
furi_delay_us(us);
|
||||
rv = furi_hal_i2c_rx(bus, addr, rx, rxlen, tmo);
|
||||
}
|
||||
return rv;
|
||||
static inline bool furi_hal_i2c_trxd(
|
||||
FuriHalI2cBusHandle* const bus,
|
||||
const uint8_t addr,
|
||||
const void* tx,
|
||||
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);
|
||||
if(rv) {
|
||||
furi_delay_us(us);
|
||||
rv = furi_hal_i2c_rx(bus, addr, rx, rxlen, tmo);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
#endif //I2C_WORKAROUND_H_
|
||||
|
||||
@@ -3,34 +3,34 @@
|
||||
//
|
||||
|
||||
// System libs
|
||||
#include <stdlib.h> // malloc
|
||||
#include <stdint.h> // uint32_t
|
||||
#include <stdarg.h> // __VA_ARGS__
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h> // malloc
|
||||
#include <stdint.h> // uint32_t
|
||||
#include <stdarg.h> // __VA_ARGS__
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// FlipperZero libs
|
||||
#include <furi.h> // Core API
|
||||
#include <gui/gui.h> // GUI (screen/keyboard) API
|
||||
#include <input/input.h> // GUI Input extensions
|
||||
#include <notification/notification_messages.h>
|
||||
#include <furi.h> // Core API
|
||||
#include <gui/gui.h> // GUI (screen/keyboard) API
|
||||
#include <input/input.h> // GUI Input extensions
|
||||
#include <notification/notification_messages.h>
|
||||
|
||||
// Do this first!
|
||||
#define ERR_C_ // Do this in precisely ONE file
|
||||
#include "err.h" // Error numbers & messages
|
||||
#include "err.h" // Error numbers & messages
|
||||
|
||||
#include "bc_logging.h"
|
||||
#include "bc_logging.h"
|
||||
|
||||
// Local headers
|
||||
#include "wii_anal.h" // Various enums and struct declarations
|
||||
#include "wii_i2c.h" // Wii i2c functions
|
||||
#include "wii_ec.h" // Wii Extension Controller functions (eg. draw)
|
||||
#include "wii_anal_keys.h" // key mappings
|
||||
#include "gfx/images.h" // Images
|
||||
#include "wii_anal_lcd.h" // Drawing functions
|
||||
#include "wii_anal_ec.h" // Wii controller events
|
||||
#include "wii_anal.h" // Various enums and struct declarations
|
||||
#include "wii_i2c.h" // Wii i2c functions
|
||||
#include "wii_ec.h" // Wii Extension Controller functions (eg. draw)
|
||||
#include "wii_anal_keys.h" // key mappings
|
||||
#include "gfx/images.h" // Images
|
||||
#include "wii_anal_lcd.h" // Drawing functions
|
||||
#include "wii_anal_ec.h" // Wii controller events
|
||||
|
||||
#include "wii_anal_ver.h" // Version number
|
||||
#include "wii_anal_ver.h" // Version number
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// OOOOO // SSSSS CCCCC AAA L L BBBB AAA CCCC K K SSSSS
|
||||
@@ -44,48 +44,42 @@
|
||||
// OS Callback : Timer tick
|
||||
// We register this function to be called when the OS signals a timer 'tick' event
|
||||
//
|
||||
static
|
||||
void cbTimer (FuriMessageQueue* queue)
|
||||
{
|
||||
ENTER;
|
||||
furi_assert(queue);
|
||||
static void cbTimer(FuriMessageQueue* queue) {
|
||||
ENTER;
|
||||
furi_assert(queue);
|
||||
|
||||
eventMsg_t message = {.id = EVID_TICK};
|
||||
furi_message_queue_put(queue, &message, 0);
|
||||
eventMsg_t message = {.id = EVID_TICK};
|
||||
furi_message_queue_put(queue, &message, 0);
|
||||
|
||||
LEAVE;
|
||||
return;
|
||||
LEAVE;
|
||||
return;
|
||||
}
|
||||
|
||||
//+============================================================================ ========================================
|
||||
// OS Callback : Keypress
|
||||
// We register this function to be called when the OS detects a keypress
|
||||
//
|
||||
static
|
||||
void cbInput (InputEvent* event, FuriMessageQueue* queue)
|
||||
{
|
||||
ENTER;
|
||||
furi_assert(queue);
|
||||
furi_assert(event);
|
||||
static void cbInput(InputEvent* event, FuriMessageQueue* queue) {
|
||||
ENTER;
|
||||
furi_assert(queue);
|
||||
furi_assert(event);
|
||||
|
||||
// Put an "input" event message on the message queue
|
||||
eventMsg_t message = {.id = EVID_KEY, .input = *event};
|
||||
furi_message_queue_put(queue, &message, FuriWaitForever);
|
||||
// Put an "input" event message on the message queue
|
||||
eventMsg_t message = {.id = EVID_KEY, .input = *event};
|
||||
furi_message_queue_put(queue, &message, FuriWaitForever);
|
||||
|
||||
LEAVE;
|
||||
return;
|
||||
LEAVE;
|
||||
return;
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
// Show version number
|
||||
//
|
||||
static
|
||||
void showVer (Canvas* const canvas)
|
||||
{
|
||||
show(canvas, 0,59, &img_3x5_v, 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);
|
||||
static void showVer(Canvas* const canvas) {
|
||||
show(canvas, 0, 59, &img_3x5_v, 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);
|
||||
}
|
||||
|
||||
//+============================================================================
|
||||
@@ -95,105 +89,103 @@ void showVer (Canvas* const canvas)
|
||||
// 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 !?
|
||||
//
|
||||
static
|
||||
void cbDraw (Canvas* const canvas, void* ctx)
|
||||
{
|
||||
ENTER;
|
||||
furi_assert(canvas);
|
||||
furi_assert(ctx);
|
||||
static void cbDraw(Canvas* const canvas, void* ctx) {
|
||||
ENTER;
|
||||
furi_assert(canvas);
|
||||
furi_assert(ctx);
|
||||
|
||||
state_t* state = NULL;
|
||||
state_t* state = NULL;
|
||||
|
||||
// Try to acquire the mutex for the plugin state variables, timeout = 25mS
|
||||
if ( !(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25)) ) return ;
|
||||
// Try to acquire the mutex for the plugin state variables, timeout = 25mS
|
||||
if(!(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25))) return;
|
||||
|
||||
switch (state->scene) {
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_SPLASH:
|
||||
show(canvas, 2,0, &img_csLogo_FULL, SHOW_SET_BLK);
|
||||
switch(state->scene) {
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_SPLASH:
|
||||
show(canvas, 2, 0, &img_csLogo_FULL, SHOW_SET_BLK);
|
||||
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
canvas_draw_str_aligned(canvas, 64,43, AlignCenter, AlignTop, "Wii Extension Controller");
|
||||
canvas_draw_str_aligned(canvas, 64,55, AlignCenter, AlignTop, "Protocol Analyser");
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
canvas_draw_str_aligned(canvas, 64, 43, AlignCenter, AlignTop, "Wii Extension Controller");
|
||||
canvas_draw_str_aligned(canvas, 64, 55, AlignCenter, AlignTop, "Protocol Analyser");
|
||||
|
||||
showVer(canvas);
|
||||
showVer(canvas);
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_RIP:
|
||||
show(canvas, 0,0, &img_RIP, SHOW_SET_BLK);
|
||||
break;
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_RIP:
|
||||
show(canvas, 0, 0, &img_RIP, SHOW_SET_BLK);
|
||||
break;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_WAIT:
|
||||
# define xo 2
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_WAIT:
|
||||
#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(48+xo,21, 82+xo,23); // C1
|
||||
BOX_BL(22+xo,41, 82+xo,58); // C0
|
||||
BOX_BL(48+xo,41, 82+xo,44); // Gnd
|
||||
BOX_TL(22 + xo, 6, 82 + xo, 23); // 3v3
|
||||
BOX_TL(48 + xo, 21, 82 + xo, 23); // C1
|
||||
BOX_BL(22 + xo, 41, 82 + xo, 58); // C0
|
||||
BOX_BL(48 + xo, 41, 82 + xo, 44); // Gnd
|
||||
|
||||
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, 104+xo, 3, &img_6x8_3, SHOW_SET_BLK);
|
||||
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, 104 + xo, 3, &img_6x8_3, SHOW_SET_BLK);
|
||||
|
||||
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, 107+xo,16, &img_ecp_SDA, SHOW_SET_BLK);
|
||||
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, 107 + xo, 16, &img_ecp_SDA, SHOW_SET_BLK);
|
||||
|
||||
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, 104+xo,40, &img_6x8_d, SHOW_SET_BLK);
|
||||
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, 104 + xo, 40, &img_6x8_d, SHOW_SET_BLK);
|
||||
|
||||
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, 108+xo,54, &img_ecp_SCL, SHOW_SET_BLK);
|
||||
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, 108 + xo, 54, &img_ecp_SCL, SHOW_SET_BLK);
|
||||
|
||||
show(canvas, 0,0, &img_csLogo_Small, SHOW_SET_BLK);
|
||||
showVer(canvas);
|
||||
show(canvas, 0, 0, &img_csLogo_Small, SHOW_SET_BLK);
|
||||
showVer(canvas);
|
||||
|
||||
# undef xo
|
||||
break;
|
||||
#undef xo
|
||||
break;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_DEBUG:
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
//---------------------------------------------------------------------
|
||||
case SCENE_DEBUG:
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
|
||||
show(canvas, 0,0, &img_key_U, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11, 0, AlignLeft, AlignTop, "Initialise Perhipheral");
|
||||
show(canvas, 0, 0, &img_key_U, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11, 0, AlignLeft, AlignTop, "Initialise Perhipheral");
|
||||
|
||||
show(canvas, 0,11, &img_key_OK, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11,11, AlignLeft, AlignTop, "Read values [see log]");
|
||||
show(canvas, 0, 11, &img_key_OK, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11, 11, AlignLeft, AlignTop, "Read values [see log]");
|
||||
|
||||
show(canvas, 0,23, &img_key_D, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11,22, AlignLeft, AlignTop, "Restart Scanner");
|
||||
show(canvas, 0, 23, &img_key_D, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11, 22, AlignLeft, AlignTop, "Restart Scanner");
|
||||
|
||||
show(canvas, 0,33, &img_key_Back, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11,33, AlignLeft, AlignTop, "Exit");
|
||||
show(canvas, 0, 33, &img_key_Back, SHOW_SET_BLK);
|
||||
canvas_draw_str_aligned(canvas, 11, 33, AlignLeft, AlignTop, "Exit");
|
||||
|
||||
break ;
|
||||
break;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
default:
|
||||
if (state->ec.pidx >= PID_ERROR) {
|
||||
ERROR("%s : bad PID = %d", __func__, state->ec.pidx);
|
||||
} else {
|
||||
if ((state->scene == SCENE_DUMP) || !ecId[state->ec.pidx].show)
|
||||
ecId[PID_UNKNOWN].show(canvas, state);
|
||||
else
|
||||
ecId[state->ec.pidx].show(canvas, state);
|
||||
}
|
||||
break;
|
||||
}
|
||||
//---------------------------------------------------------------------
|
||||
default:
|
||||
if(state->ec.pidx >= PID_ERROR) {
|
||||
ERROR("%s : bad PID = %d", __func__, state->ec.pidx);
|
||||
} else {
|
||||
if((state->scene == SCENE_DUMP) || !ecId[state->ec.pidx].show)
|
||||
ecId[PID_UNKNOWN].show(canvas, state);
|
||||
else
|
||||
ecId[state->ec.pidx].show(canvas, state);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Release the mutex
|
||||
release_mutex((ValueMutex*)ctx, state);
|
||||
// Release the mutex
|
||||
release_mutex((ValueMutex*)ctx, state);
|
||||
|
||||
LEAVE;
|
||||
return;
|
||||
LEAVE;
|
||||
return;
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -207,56 +199,54 @@ void cbDraw (Canvas* const canvas, void* ctx)
|
||||
//+============================================================================ ========================================
|
||||
// Initialise plugin state variables
|
||||
//
|
||||
static inline
|
||||
bool stateInit (state_t* const state)
|
||||
{
|
||||
ENTER;
|
||||
furi_assert(state);
|
||||
static inline bool stateInit(state_t* const state) {
|
||||
ENTER;
|
||||
furi_assert(state);
|
||||
|
||||
bool rv = true; // assume success
|
||||
bool rv = true; // assume success
|
||||
|
||||
// Enable the main loop
|
||||
state->run = true;
|
||||
// Enable the main loop
|
||||
state->run = true;
|
||||
|
||||
// Timer
|
||||
state->timerEn = false;
|
||||
state->timer = NULL;
|
||||
state->timerHz = furi_kernel_get_tick_frequency();
|
||||
state->fps = 30;
|
||||
// Timer
|
||||
state->timerEn = false;
|
||||
state->timer = NULL;
|
||||
state->timerHz = furi_kernel_get_tick_frequency();
|
||||
state->fps = 30;
|
||||
|
||||
// Scene
|
||||
state->scene = SCENE_SPLASH;
|
||||
state->scenePrev = SCENE_NONE;
|
||||
state->scenePegg = SCENE_NONE;
|
||||
// Scene
|
||||
state->scene = SCENE_SPLASH;
|
||||
state->scenePrev = SCENE_NONE;
|
||||
state->scenePegg = SCENE_NONE;
|
||||
|
||||
state->hold = 0; // show hold meters (-1=lowest, 0=current, +1=highest}
|
||||
state->calib = CAL_TRACK;
|
||||
state->pause = false; // animation running
|
||||
state->apause = false; // auto-pause animation
|
||||
state->hold = 0; // show hold meters (-1=lowest, 0=current, +1=highest}
|
||||
state->calib = CAL_TRACK;
|
||||
state->pause = false; // animation running
|
||||
state->apause = false; // auto-pause animation
|
||||
|
||||
// Notifications
|
||||
state->notify = NULL;
|
||||
// Notifications
|
||||
state->notify = NULL;
|
||||
|
||||
// Perhipheral
|
||||
state->ec.init = false;
|
||||
state->ec.pidx = PID_UNKNOWN;
|
||||
state->ec.sid = ecId[state->ec.pidx].name;
|
||||
// Perhipheral
|
||||
state->ec.init = false;
|
||||
state->ec.pidx = PID_UNKNOWN;
|
||||
state->ec.sid = ecId[state->ec.pidx].name;
|
||||
|
||||
// Controller data
|
||||
memset(state->ec.pid, 0xC5, PID_LEN); // Cyborg 5ystems
|
||||
memset(state->ec.calF, 0xC5, CAL_LEN);
|
||||
memset(state->ec.joy, 0xC5, JOY_LEN);
|
||||
// Controller data
|
||||
memset(state->ec.pid, 0xC5, PID_LEN); // Cyborg 5ystems
|
||||
memset(state->ec.calF, 0xC5, CAL_LEN);
|
||||
memset(state->ec.joy, 0xC5, JOY_LEN);
|
||||
|
||||
// Encryption details
|
||||
state->ec.encrypt = false;
|
||||
memset(state->ec.encKey, 0x00, ENC_LEN);
|
||||
// Encryption details
|
||||
state->ec.encrypt = false;
|
||||
memset(state->ec.encKey, 0x00, ENC_LEN);
|
||||
|
||||
// Seed the PRNG
|
||||
// CYCCNT --> lib/STM32CubeWB/Drivers/CMSIS/Include/core_cm7.h
|
||||
// srand(DWT->CYCCNT);
|
||||
// Seed the PRNG
|
||||
// CYCCNT --> lib/STM32CubeWB/Drivers/CMSIS/Include/core_cm7.h
|
||||
// srand(DWT->CYCCNT);
|
||||
|
||||
LEAVE;
|
||||
return rv;
|
||||
LEAVE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -270,271 +260,284 @@ bool stateInit (state_t* const state)
|
||||
//+============================================================================ ========================================
|
||||
// Enable/Disable scanning
|
||||
//
|
||||
void timerEn (state_t* state, bool on)
|
||||
{
|
||||
ENTER;
|
||||
furi_assert(state);
|
||||
void timerEn(state_t* state, bool on) {
|
||||
ENTER;
|
||||
furi_assert(state);
|
||||
|
||||
// ENable scanning
|
||||
if (on) {
|
||||
if (state->timerEn) {
|
||||
WARN(wii_errs[WARN_SCAN_START]);
|
||||
} else {
|
||||
// Set the timer to fire at 'fps' times/second
|
||||
if (furi_timer_start(state->timer, state->timerHz/state->fps) == FuriStatusOk) {
|
||||
state->timerEn = true;
|
||||
INFO("%s : monitor started", __func__);
|
||||
} else {
|
||||
ERROR(wii_errs[ERR_TIMER_START]);
|
||||
}
|
||||
}
|
||||
// ENable scanning
|
||||
if(on) {
|
||||
if(state->timerEn) {
|
||||
WARN(wii_errs[WARN_SCAN_START]);
|
||||
} else {
|
||||
// Set the timer to fire at 'fps' times/second
|
||||
if(furi_timer_start(state->timer, state->timerHz / state->fps) == FuriStatusOk) {
|
||||
state->timerEn = true;
|
||||
INFO("%s : monitor started", __func__);
|
||||
} else {
|
||||
ERROR(wii_errs[ERR_TIMER_START]);
|
||||
}
|
||||
}
|
||||
|
||||
// DISable scanning
|
||||
} else {
|
||||
if (!state->timerEn) {
|
||||
WARN(wii_errs[WARN_SCAN_STOP]);
|
||||
} else {
|
||||
// Stop the timer
|
||||
if (furi_timer_stop(state->timer) == FuriStatusOk) {
|
||||
state->timerEn = false;
|
||||
INFO("%s : monitor stopped", __func__);
|
||||
} else {
|
||||
ERROR(wii_errs[ERR_TIMER_STOP]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// DISable scanning
|
||||
} else {
|
||||
if(!state->timerEn) {
|
||||
WARN(wii_errs[WARN_SCAN_STOP]);
|
||||
} else {
|
||||
// Stop the timer
|
||||
if(furi_timer_stop(state->timer) == FuriStatusOk) {
|
||||
state->timerEn = false;
|
||||
INFO("%s : monitor stopped", __func__);
|
||||
} else {
|
||||
ERROR(wii_errs[ERR_TIMER_STOP]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LEAVE;
|
||||
return;
|
||||
LEAVE;
|
||||
return;
|
||||
}
|
||||
|
||||
//+============================================================================ ========================================
|
||||
// Plugin entry point
|
||||
//
|
||||
int32_t wii_ec_anal (void)
|
||||
{
|
||||
ENTER;
|
||||
int32_t wii_ec_anal(void) {
|
||||
ENTER;
|
||||
|
||||
// ===== Variables =====
|
||||
err_t error = 0; // assume success
|
||||
Gui* gui = NULL;
|
||||
ViewPort* vpp = NULL;
|
||||
state_t* state = NULL;
|
||||
ValueMutex mutex = {0};
|
||||
FuriMessageQueue* queue = NULL;
|
||||
const uint32_t queueSz = 20; // maximum messages in queue
|
||||
uint32_t tmo = (3.5f *1000); // timeout splash screen after N seconds
|
||||
// ===== Variables =====
|
||||
err_t error = 0; // assume success
|
||||
Gui* gui = NULL;
|
||||
ViewPort* vpp = NULL;
|
||||
state_t* state = NULL;
|
||||
ValueMutex mutex = {0};
|
||||
FuriMessageQueue* queue = NULL;
|
||||
const uint32_t queueSz = 20; // maximum messages in queue
|
||||
uint32_t tmo = (3.5f * 1000); // timeout splash screen after N seconds
|
||||
|
||||
// The queue will contain plugin event-messages
|
||||
// --> local
|
||||
eventMsg_t msg = {0};
|
||||
// The queue will contain plugin event-messages
|
||||
// --> local
|
||||
eventMsg_t msg = {0};
|
||||
|
||||
INFO("BEGIN");
|
||||
INFO("BEGIN");
|
||||
|
||||
// ===== Message queue =====
|
||||
// 1. Create a message queue (for up to 8 (keyboard) event messages)
|
||||
if ( !(queue = furi_message_queue_alloc(queueSz, sizeof(msg))) ) {
|
||||
ERROR(wii_errs[(error = ERR_MALLOC_QUEUE)]);
|
||||
goto bail;
|
||||
}
|
||||
// ===== Message queue =====
|
||||
// 1. Create a message queue (for up to 8 (keyboard) event messages)
|
||||
if(!(queue = furi_message_queue_alloc(queueSz, sizeof(msg)))) {
|
||||
ERROR(wii_errs[(error = ERR_MALLOC_QUEUE)]);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// ===== Create GUI Interface =====
|
||||
// 2. Create a GUI interface
|
||||
if ( !(gui = furi_record_open("gui")) ) {
|
||||
ERROR(wii_errs[(error = ERR_NO_GUI)]);
|
||||
goto bail;
|
||||
}
|
||||
// ===== Create GUI Interface =====
|
||||
// 2. Create a GUI interface
|
||||
if(!(gui = furi_record_open("gui"))) {
|
||||
ERROR(wii_errs[(error = ERR_NO_GUI)]);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// ===== Plugin state variables =====
|
||||
// 3. Allocate space on the heap for the plugin state variables
|
||||
if ( !(state = malloc(sizeof(state_t))) ) {
|
||||
ERROR(wii_errs[(error = ERR_MALLOC_STATE)]);
|
||||
goto bail;
|
||||
}
|
||||
// 4. Initialise the plugin state variables
|
||||
if (!stateInit(state)) {
|
||||
// error message(s) is/are output by stateInit()
|
||||
error = 15;
|
||||
goto bail;
|
||||
}
|
||||
// 5. Create a mutex for (reading/writing) the plugin state variables
|
||||
if (!init_mutex(&mutex, state, sizeof(state))) {
|
||||
ERROR(wii_errs[(error = ERR_NO_MUTEX)]);
|
||||
goto bail;
|
||||
}
|
||||
// ===== Plugin state variables =====
|
||||
// 3. Allocate space on the heap for the plugin state variables
|
||||
if(!(state = malloc(sizeof(state_t)))) {
|
||||
ERROR(wii_errs[(error = ERR_MALLOC_STATE)]);
|
||||
goto bail;
|
||||
}
|
||||
// 4. Initialise the plugin state variables
|
||||
if(!stateInit(state)) {
|
||||
// error message(s) is/are output by stateInit()
|
||||
error = 15;
|
||||
goto bail;
|
||||
}
|
||||
// 5. Create a mutex for (reading/writing) the plugin state variables
|
||||
if(!init_mutex(&mutex, state, sizeof(state))) {
|
||||
ERROR(wii_errs[(error = ERR_NO_MUTEX)]);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// ===== Viewport =====
|
||||
// 6. Allocate space on the heap for the viewport
|
||||
if ( !(vpp = view_port_alloc()) ) {
|
||||
ERROR(wii_errs[(error = ERR_MALLOC_VIEW)]);
|
||||
goto bail;
|
||||
}
|
||||
// 7a. Register a callback for input events
|
||||
view_port_input_callback_set(vpp, cbInput, queue);
|
||||
// 7b. Register a callback for draw events
|
||||
view_port_draw_callback_set(vpp, cbDraw, &mutex);
|
||||
// ===== Viewport =====
|
||||
// 6. Allocate space on the heap for the viewport
|
||||
if(!(vpp = view_port_alloc())) {
|
||||
ERROR(wii_errs[(error = ERR_MALLOC_VIEW)]);
|
||||
goto bail;
|
||||
}
|
||||
// 7a. Register a callback for input events
|
||||
view_port_input_callback_set(vpp, cbInput, queue);
|
||||
// 7b. Register a callback for draw events
|
||||
view_port_draw_callback_set(vpp, cbDraw, &mutex);
|
||||
|
||||
// ===== Start GUI Interface =====
|
||||
// 8. Attach the viewport to the GUI
|
||||
gui_add_view_port(gui, vpp, GuiLayerFullscreen);
|
||||
// ===== Start GUI Interface =====
|
||||
// 8. Attach the viewport to the GUI
|
||||
gui_add_view_port(gui, vpp, GuiLayerFullscreen);
|
||||
|
||||
// ===== Timer =====
|
||||
// 9. Allocate a timer
|
||||
if ( !(state->timer = furi_timer_alloc(cbTimer, FuriTimerTypePeriodic, queue)) ) {
|
||||
ERROR(wii_errs[(error = ERR_NO_TIMER)]);
|
||||
goto bail;
|
||||
}
|
||||
// ===== Timer =====
|
||||
// 9. Allocate a timer
|
||||
if(!(state->timer = furi_timer_alloc(cbTimer, FuriTimerTypePeriodic, queue))) {
|
||||
ERROR(wii_errs[(error = ERR_NO_TIMER)]);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// === System Notifications ===
|
||||
// 10. Acquire a handle for the system notification queue
|
||||
if ( !(state->notify = furi_record_open(RECORD_NOTIFICATION)) ) {
|
||||
ERROR(wii_errs[(error = ERR_NO_NOTIFY)]);
|
||||
goto bail;
|
||||
}
|
||||
patBacklight(state); // Turn on the backlight [qv. remote FAP launch]
|
||||
// === System Notifications ===
|
||||
// 10. Acquire a handle for the system notification queue
|
||||
if(!(state->notify = furi_record_open(RECORD_NOTIFICATION))) {
|
||||
ERROR(wii_errs[(error = ERR_NO_NOTIFY)]);
|
||||
goto bail;
|
||||
}
|
||||
patBacklight(state); // Turn on the backlight [qv. remote FAP launch]
|
||||
|
||||
INFO("INITIALISED");
|
||||
INFO("INITIALISED");
|
||||
|
||||
// ==================== Main event loop ====================
|
||||
// ==================== Main event loop ====================
|
||||
|
||||
if (state->run) do {
|
||||
bool redraw = false;
|
||||
FuriStatus status = FuriStatusErrorTimeout;
|
||||
if(state->run) do {
|
||||
bool redraw = false;
|
||||
FuriStatus status = FuriStatusErrorTimeout;
|
||||
|
||||
// Wait for a message
|
||||
// while ((status = furi_message_queue_get(queue, &msg, tmo)) == FuriStatusErrorTimeout) ;
|
||||
status = furi_message_queue_get(queue, &msg, tmo);
|
||||
// Wait for a message
|
||||
// while ((status = furi_message_queue_get(queue, &msg, tmo)) == FuriStatusErrorTimeout) ;
|
||||
status = furi_message_queue_get(queue, &msg, tmo);
|
||||
|
||||
// Clear splash screen
|
||||
if ( (state->scene == SCENE_SPLASH) && (state->scenePrev == SCENE_NONE) && // Initial splash
|
||||
( (status == FuriStatusErrorTimeout) || // timeout
|
||||
((msg.id == EVID_KEY) && (msg.input.type == InputTypeShort)) ) // or <any> key-short
|
||||
) {
|
||||
tmo = 60 *1000; // increase message-wait timeout to 60secs
|
||||
timerEn(state, true); // start scanning the i2c bus
|
||||
status = FuriStatusOk; // pass status check
|
||||
msg.id = EVID_NONE; // valid msg ID
|
||||
sceneSet(state, SCENE_WAIT); // move to wait screen
|
||||
}
|
||||
// Clear splash screen
|
||||
if((state->scene == SCENE_SPLASH) &&
|
||||
(state->scenePrev == SCENE_NONE) && // Initial splash
|
||||
((status == FuriStatusErrorTimeout) || // timeout
|
||||
((msg.id == EVID_KEY) && (msg.input.type == InputTypeShort))) // or <any> key-short
|
||||
) {
|
||||
tmo = 60 * 1000; // increase message-wait timeout to 60secs
|
||||
timerEn(state, true); // start scanning the i2c bus
|
||||
status = FuriStatusOk; // pass status check
|
||||
msg.id = EVID_NONE; // valid msg ID
|
||||
sceneSet(state, SCENE_WAIT); // move to wait screen
|
||||
}
|
||||
|
||||
// Check for queue errors
|
||||
if (status != FuriStatusOk) {
|
||||
switch (status) {
|
||||
case FuriStatusErrorTimeout: DEBUG(wii_errs[DEBUG_QUEUE_TIMEOUT]); continue ;
|
||||
case FuriStatusError: ERROR(wii_errs[(error = ERR_QUEUE_RTOS)]); goto bail ;
|
||||
case FuriStatusErrorResource: 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
|
||||
// Check for queue errors
|
||||
if(status != FuriStatusOk) {
|
||||
switch(status) {
|
||||
case FuriStatusErrorTimeout:
|
||||
DEBUG(wii_errs[DEBUG_QUEUE_TIMEOUT]);
|
||||
continue;
|
||||
case FuriStatusError:
|
||||
ERROR(wii_errs[(error = ERR_QUEUE_RTOS)]);
|
||||
goto bail;
|
||||
case FuriStatusErrorResource:
|
||||
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
|
||||
|
||||
// *** Try to lock the plugin state variables ***
|
||||
if ( !(state = (state_t*)acquire_mutex_block(&mutex)) ) {
|
||||
ERROR(wii_errs[(error = ERR_MUTEX_BLOCK)]);
|
||||
goto bail;
|
||||
}
|
||||
// *** Try to lock the plugin state variables ***
|
||||
if(!(state = (state_t*)acquire_mutex_block(&mutex))) {
|
||||
ERROR(wii_errs[(error = ERR_MUTEX_BLOCK)]);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
// *** Handle events ***
|
||||
switch (msg.id) {
|
||||
//---------------------------------------------
|
||||
case EVID_TICK: // Timer events
|
||||
//! I would prefer to have ecPoll() called by cbTimer()
|
||||
//! ...but how does cbTimer() get the required access to the state variables? Namely: 'state->ec'
|
||||
//! So, for now, the timer pushes a message to call ecPoll()
|
||||
//! which, in turn, will push WIIEC event meesages! <facepalm>
|
||||
ecPoll(&state->ec, queue);
|
||||
break;
|
||||
// *** Handle events ***
|
||||
switch(msg.id) {
|
||||
//---------------------------------------------
|
||||
case EVID_TICK: // Timer events
|
||||
//! I would prefer to have ecPoll() called by cbTimer()
|
||||
//! ...but how does cbTimer() get the required access to the state variables? Namely: 'state->ec'
|
||||
//! So, for now, the timer pushes a message to call ecPoll()
|
||||
//! which, in turn, will push WIIEC event meesages! <facepalm>
|
||||
ecPoll(&state->ec, queue);
|
||||
break;
|
||||
|
||||
//---------------------------------------------
|
||||
case EVID_WIIEC: // WiiMote Perhipheral
|
||||
if (evWiiEC(&msg, state)) redraw = true ;
|
||||
break;
|
||||
//---------------------------------------------
|
||||
case EVID_WIIEC: // WiiMote Perhipheral
|
||||
if(evWiiEC(&msg, state)) redraw = true;
|
||||
break;
|
||||
|
||||
//---------------------------------------------
|
||||
case EVID_KEY: // Key events
|
||||
patBacklight(state);
|
||||
if (evKey(&msg, state)) redraw = true;
|
||||
break;
|
||||
//---------------------------------------------
|
||||
case EVID_KEY: // Key events
|
||||
patBacklight(state);
|
||||
if(evKey(&msg, state)) redraw = true;
|
||||
break;
|
||||
|
||||
//---------------------------------------------
|
||||
case EVID_NONE:
|
||||
break;
|
||||
//---------------------------------------------
|
||||
case EVID_NONE:
|
||||
break;
|
||||
|
||||
//---------------------------------------------
|
||||
default: // Unknown event
|
||||
WARN("Unknown message.ID [%d]", msg.id);
|
||||
break;
|
||||
}
|
||||
//---------------------------------------------
|
||||
default: // Unknown event
|
||||
WARN("Unknown message.ID [%d]", msg.id);
|
||||
break;
|
||||
}
|
||||
|
||||
// *** Update the GUI screen via the viewport ***
|
||||
if (redraw) view_port_update(vpp) ;
|
||||
// *** Update the GUI screen via the viewport ***
|
||||
if(redraw) view_port_update(vpp);
|
||||
|
||||
// *** Try to release the plugin state variables ***
|
||||
if ( !release_mutex(&mutex, state) ) {
|
||||
ERROR(wii_errs[(error = ERR_MUTEX_RELEASE)]);
|
||||
goto bail;
|
||||
}
|
||||
} while (state->run);
|
||||
// *** Try to release the plugin state variables ***
|
||||
if(!release_mutex(&mutex, state)) {
|
||||
ERROR(wii_errs[(error = ERR_MUTEX_RELEASE)]);
|
||||
goto bail;
|
||||
}
|
||||
} while(state->run);
|
||||
|
||||
// ===== Game Over =====
|
||||
INFO("USER EXIT");
|
||||
// ===== Game Over =====
|
||||
INFO("USER EXIT");
|
||||
|
||||
bail:
|
||||
// 10. Release system notification queue
|
||||
if (state->notify) {
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
state->notify = NULL;
|
||||
}
|
||||
// 10. Release system notification queue
|
||||
if(state->notify) {
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
state->notify = NULL;
|
||||
}
|
||||
|
||||
// 9. Stop the timer
|
||||
if (state->timer) {
|
||||
(void)furi_timer_stop(state->timer);
|
||||
furi_timer_free(state->timer);
|
||||
state->timer = NULL;
|
||||
state->timerEn = false;
|
||||
}
|
||||
// 9. Stop the timer
|
||||
if(state->timer) {
|
||||
(void)furi_timer_stop(state->timer);
|
||||
furi_timer_free(state->timer);
|
||||
state->timer = NULL;
|
||||
state->timerEn = false;
|
||||
}
|
||||
|
||||
// 8. Detach the viewport
|
||||
gui_remove_view_port(gui, vpp);
|
||||
// 8. Detach the viewport
|
||||
gui_remove_view_port(gui, vpp);
|
||||
|
||||
// 7. No need to unreqgister the callbacks
|
||||
// ...they will go when the viewport is destroyed
|
||||
// 7. No need to unreqgister the callbacks
|
||||
// ...they will go when the viewport is destroyed
|
||||
|
||||
// 6. Destroy the viewport
|
||||
if (vpp) {
|
||||
view_port_enabled_set(vpp, false);
|
||||
view_port_free(vpp);
|
||||
vpp = NULL;
|
||||
}
|
||||
// 6. Destroy the viewport
|
||||
if(vpp) {
|
||||
view_port_enabled_set(vpp, false);
|
||||
view_port_free(vpp);
|
||||
vpp = NULL;
|
||||
}
|
||||
|
||||
// 5. Free the mutex
|
||||
if (mutex.mutex) {
|
||||
delete_mutex(&mutex);
|
||||
mutex.mutex = NULL;
|
||||
}
|
||||
// 5. Free the mutex
|
||||
if(mutex.mutex) {
|
||||
delete_mutex(&mutex);
|
||||
mutex.mutex = NULL;
|
||||
}
|
||||
|
||||
// 4. Free up state pointer(s)
|
||||
// none
|
||||
// 4. Free up state pointer(s)
|
||||
// none
|
||||
|
||||
// 3. Free the plugin state variables
|
||||
if (state) {
|
||||
free(state);
|
||||
state = NULL;
|
||||
}
|
||||
// 3. Free the plugin state variables
|
||||
if(state) {
|
||||
free(state);
|
||||
state = NULL;
|
||||
}
|
||||
|
||||
// 2. Close the GUI
|
||||
furi_record_close("gui");
|
||||
// 2. Close the GUI
|
||||
furi_record_close("gui");
|
||||
|
||||
// 1. Destroy the message queue
|
||||
if (queue) {
|
||||
furi_message_queue_free(queue);
|
||||
queue = NULL;
|
||||
}
|
||||
// 1. Destroy the message queue
|
||||
if(queue) {
|
||||
furi_message_queue_free(queue);
|
||||
queue = NULL;
|
||||
}
|
||||
|
||||
INFO("CLEAN EXIT ... Exit code: %d", error);
|
||||
LEAVE;
|
||||
return (int32_t)error;
|
||||
INFO("CLEAN EXIT ... Exit code: %d", error);
|
||||
LEAVE;
|
||||
return (int32_t)error;
|
||||
}
|
||||
|
||||
@@ -1,97 +1,89 @@
|
||||
#ifndef WII_ANAL_H_
|
||||
#define WII_ANAL_H_
|
||||
#ifndef WII_ANAL_H_
|
||||
#define WII_ANAL_H_
|
||||
|
||||
#include <furi.h> // Core API
|
||||
#include <input/input.h> // GUI Input extensions
|
||||
#include <notification/notification_messages.h>
|
||||
#include <furi.h> // Core API
|
||||
#include <input/input.h> // GUI Input extensions
|
||||
#include <notification/notification_messages.h>
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// GUI scenes
|
||||
//
|
||||
typedef
|
||||
enum scene {
|
||||
SCENE_NONE = 0,
|
||||
SCENE_SPLASH = 1,
|
||||
SCENE_RIP = 2,
|
||||
SCENE_WAIT = 3,
|
||||
SCENE_DEBUG = 4,
|
||||
SCENE_DUMP = 5,
|
||||
SCENE_CLASSIC = 6,
|
||||
SCENE_CLASSIC_N = 7,
|
||||
SCENE_NUNCHUCK = 8,
|
||||
SCENE_NUNCHUCK_ACC = 9,
|
||||
}
|
||||
scene_t;
|
||||
typedef enum scene {
|
||||
SCENE_NONE = 0,
|
||||
SCENE_SPLASH = 1,
|
||||
SCENE_RIP = 2,
|
||||
SCENE_WAIT = 3,
|
||||
SCENE_DEBUG = 4,
|
||||
SCENE_DUMP = 5,
|
||||
SCENE_CLASSIC = 6,
|
||||
SCENE_CLASSIC_N = 7,
|
||||
SCENE_NUNCHUCK = 8,
|
||||
SCENE_NUNCHUCK_ACC = 9,
|
||||
} scene_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
#include "wii_i2c.h"
|
||||
#include "wii_ec.h"
|
||||
#include "wii_i2c.h"
|
||||
#include "wii_ec.h"
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// A list of event IDs handled by this plugin
|
||||
//
|
||||
typedef
|
||||
enum eventID {
|
||||
EVID_NONE,
|
||||
EVID_UNKNOWN,
|
||||
typedef enum eventID {
|
||||
EVID_NONE,
|
||||
EVID_UNKNOWN,
|
||||
|
||||
// A full list of events can be found with: `grep -r --color "void.*set_.*_callback" applications/gui/*`
|
||||
// ...A free gift to you from the makers of well written code that conforms to a good coding standard
|
||||
EVID_KEY, // keypad
|
||||
EVID_TICK, // tick
|
||||
EVID_WIIEC, // wii extension controller
|
||||
}
|
||||
eventID_t;
|
||||
// A full list of events can be found with: `grep -r --color "void.*set_.*_callback" applications/gui/*`
|
||||
// ...A free gift to you from the makers of well written code that conforms to a good coding standard
|
||||
EVID_KEY, // keypad
|
||||
EVID_TICK, // tick
|
||||
EVID_WIIEC, // wii extension controller
|
||||
} eventID_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// An item in the event message-queue
|
||||
//
|
||||
typedef
|
||||
struct eventMsg {
|
||||
eventID_t id;
|
||||
union {
|
||||
InputEvent input; // --> applications/input/input.h
|
||||
wiiEcEvent_t wiiEc; // --> local
|
||||
};
|
||||
}
|
||||
eventMsg_t;
|
||||
typedef struct eventMsg {
|
||||
eventID_t id;
|
||||
union {
|
||||
InputEvent input; // --> applications/input/input.h
|
||||
wiiEcEvent_t wiiEc; // --> local
|
||||
};
|
||||
} eventMsg_t;
|
||||
|
||||
//----------------------------------------------------------------------------- ----------------------------------------
|
||||
// State variables for this plugin
|
||||
// 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
|
||||
//
|
||||
typedef
|
||||
struct state {
|
||||
bool run; // true : plugin is running
|
||||
typedef struct state {
|
||||
bool run; // true : plugin is running
|
||||
|
||||
bool timerEn; // controller scanning enabled
|
||||
FuriTimer* timer; // the timer
|
||||
uint32_t timerHz; // system ticks per second
|
||||
int fps; // poll/refresh [frames]-per-second
|
||||
bool timerEn; // controller scanning enabled
|
||||
FuriTimer* timer; // the timer
|
||||
uint32_t timerHz; // system ticks per second
|
||||
int fps; // poll/refresh [frames]-per-second
|
||||
|
||||
int cnvW; // canvas width
|
||||
int cnvH; // canvas height
|
||||
scene_t scene; // current scene
|
||||
scene_t scenePrev; // previous scene
|
||||
scene_t scenePegg; // previous scene for easter eggs
|
||||
int flash; // flash counter (flashing icons)
|
||||
int cnvW; // canvas width
|
||||
int cnvH; // canvas height
|
||||
scene_t scene; // current scene
|
||||
scene_t scenePrev; // previous scene
|
||||
scene_t scenePegg; // previous scene for easter eggs
|
||||
int flash; // flash counter (flashing icons)
|
||||
|
||||
int hold; // hold type: {-1=tough-peak, 0=none, +1=peak-hold}
|
||||
ecCalib_t calib; // Software calibration mode
|
||||
int hold; // hold type: {-1=tough-peak, 0=none, +1=peak-hold}
|
||||
ecCalib_t calib; // Software calibration mode
|
||||
|
||||
bool pause; // Accelerometer animation pause
|
||||
bool apause; // Accelerometer animation auto-pause
|
||||
bool pause; // Accelerometer animation pause
|
||||
bool apause; // Accelerometer animation auto-pause
|
||||
|
||||
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
|
||||
}
|
||||
state_t;
|
||||
wiiEC_t ec; // Extension Controller details
|
||||
} state_t;
|
||||
|
||||
//============================================================================= ========================================
|
||||
// Function prototypes
|
||||
//
|
||||
void timerEn (state_t* state, bool on) ;
|
||||
void timerEn(state_t* state, bool on);
|
||||
|
||||
#endif //WII_ANAL_H_
|
||||
|
||||
@@ -1,85 +1,105 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "wii_anal.h"
|
||||
#include "wii_anal_lcd.h"
|
||||
#include "wii_anal_keys.h"
|
||||
#include "wii_anal.h"
|
||||
#include "wii_anal_lcd.h"
|
||||
#include "wii_anal_keys.h"
|
||||
|
||||
//+============================================================================ ========================================
|
||||
// Handle Wii Extension Controller events
|
||||
//
|
||||
bool evWiiEC (const eventMsg_t* const msg, state_t* const state)
|
||||
{
|
||||
bool redraw = false;
|
||||
bool evWiiEC(const eventMsg_t* const msg, state_t* const state) {
|
||||
bool redraw = false;
|
||||
|
||||
# if LOG_LEVEL >= 4
|
||||
{
|
||||
const char* s = NULL;
|
||||
switch (msg->wiiEc.type) {
|
||||
case WIIEC_NONE: s = "Error"; break ;
|
||||
case WIIEC_CONN: s = "Connect"; break ;
|
||||
case WIIEC_DISCONN: s = "Disconnect"; 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("WIIP : %s '%c' = %d", 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);
|
||||
}
|
||||
# endif
|
||||
|
||||
switch (msg->wiiEc.type) {
|
||||
case WIIEC_CONN:
|
||||
patBacklight(state);
|
||||
state->hold = 0;
|
||||
state->calib = CAL_TRACK;
|
||||
sceneSet(state, ecId[msg->wiiEc.val].scene);
|
||||
redraw = true ;
|
||||
break;
|
||||
|
||||
case WIIEC_DISCONN:
|
||||
patBacklight(state);
|
||||
sceneSet(state, SCENE_WAIT);
|
||||
redraw = true;
|
||||
break;
|
||||
|
||||
case WIIEC_PRESS:
|
||||
if (state->scene == SCENE_NUNCHUCK_ACC) switch (msg->wiiEc.in) {
|
||||
case 'z': // un-pause
|
||||
state->pause = !state->pause;
|
||||
break;
|
||||
case 'c': // toggle auto-pause
|
||||
state->pause = false;
|
||||
state->apause = !state->apause;
|
||||
break;
|
||||
default: break ;
|
||||
}
|
||||
|
||||
#if 1 //! factory calibration method not known for classic triggers - this will set the digital switch point
|
||||
if (state->ec.pidx == PID_CLASSIC) {
|
||||
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 LOG_LEVEL >= 4
|
||||
{
|
||||
const char* s = NULL;
|
||||
switch(msg->wiiEc.type) {
|
||||
case WIIEC_NONE:
|
||||
s = "Error";
|
||||
break;
|
||||
case WIIEC_CONN:
|
||||
s = "Connect";
|
||||
break;
|
||||
case WIIEC_DISCONN:
|
||||
s = "Disconnect";
|
||||
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(
|
||||
"WIIP : %s '%c' = %d",
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
__attribute__ ((fallthrough));
|
||||
|
||||
case WIIEC_RELEASE:
|
||||
patBacklight(state);
|
||||
redraw = true;
|
||||
break;
|
||||
switch(msg->wiiEc.type) {
|
||||
case WIIEC_CONN:
|
||||
patBacklight(state);
|
||||
state->hold = 0;
|
||||
state->calib = CAL_TRACK;
|
||||
sceneSet(state, ecId[msg->wiiEc.val].scene);
|
||||
redraw = true;
|
||||
break;
|
||||
|
||||
case WIIEC_ANALOG:
|
||||
case WIIEC_ACCEL:
|
||||
ecCalibrate(&state->ec, state->calib);
|
||||
redraw = true;
|
||||
break;
|
||||
case WIIEC_DISCONN:
|
||||
patBacklight(state);
|
||||
sceneSet(state, SCENE_WAIT);
|
||||
redraw = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case WIIEC_PRESS:
|
||||
if(state->scene == SCENE_NUNCHUCK_ACC) switch(msg->wiiEc.in) {
|
||||
case 'z': // un-pause
|
||||
state->pause = !state->pause;
|
||||
break;
|
||||
case 'c': // toggle auto-pause
|
||||
state->pause = false;
|
||||
state->apause = !state->apause;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return redraw;
|
||||
#if 1 //! factory calibration method not known for classic triggers - this will set the digital switch point
|
||||
if(state->ec.pidx == PID_CLASSIC) {
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
__attribute__((fallthrough));
|
||||
|
||||
case WIIEC_RELEASE:
|
||||
patBacklight(state);
|
||||
redraw = true;
|
||||
break;
|
||||
|
||||
case WIIEC_ANALOG:
|
||||
case WIIEC_ACCEL:
|
||||
ecCalibrate(&state->ec, state->calib);
|
||||
redraw = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return redraw;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user