mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-28 01:58:11 -07:00
Merge branch 'UNLEASHED' into 420
This commit is contained in:
@@ -609,7 +609,7 @@ int32_t blackjack_app(void* p) {
|
||||
processing = localstate->processing;
|
||||
}
|
||||
} else {
|
||||
FURI_LOG_D(APP_NAME, "osMessageQueue: event timeout");
|
||||
//FURI_LOG_D(APP_NAME, "osMessageQueue: event timeout");
|
||||
// event timeout
|
||||
}
|
||||
view_port_update(view_port);
|
||||
|
||||
@@ -81,7 +81,7 @@ void draw_score(Canvas* const canvas, bool top, uint8_t amount) {
|
||||
|
||||
void draw_money(Canvas* const canvas, uint32_t score) {
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
char drawChar[10];
|
||||
char drawChar[11];
|
||||
uint32_t currAmount = score;
|
||||
if(currAmount < 1000) {
|
||||
snprintf(drawChar, sizeof(drawChar), "$%lu", currAmount);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
App(
|
||||
appid="hex_viewer",
|
||||
name="Hex Viewer",
|
||||
name="HEX Viewer",
|
||||
apptype=FlipperAppType.EXTERNAL,
|
||||
entry_point="hex_viewer_app",
|
||||
cdefines=["APP_HEX_VIEWER"],
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
#include <gui/elements.h>
|
||||
#include <dialogs/dialogs.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#include <stream/stream.h>
|
||||
#include <stream/buffered_file_stream.h>
|
||||
|
||||
#include <lib/flipper_format/flipper_format.h>
|
||||
|
||||
#include <toolbox/stream/file_stream.h>
|
||||
|
||||
#define TAG "HexViewer"
|
||||
@@ -54,7 +50,7 @@ static void render_callback(Canvas* canvas, void* ctx) {
|
||||
elements_button_right(canvas, "Info");
|
||||
|
||||
int ROW_HEIGHT = 12;
|
||||
int TOP_OFFSET = 10; // 24
|
||||
int TOP_OFFSET = 10;
|
||||
int LEFT_OFFSET = 3;
|
||||
|
||||
uint32_t line_count = hex_viewer->model->file_size / HEX_VIEWER_BYTES_PER_ROW;
|
||||
@@ -113,7 +109,7 @@ static void input_callback(InputEvent* input_event, void* ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
HexViewer* hex_viewer_alloc() {
|
||||
static HexViewer* hex_viewer_alloc() {
|
||||
HexViewer* instance = malloc(sizeof(HexViewer));
|
||||
|
||||
instance->model = malloc(sizeof(HexViewerModel));
|
||||
@@ -135,7 +131,7 @@ HexViewer* hex_viewer_alloc() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
void hex_viewer_free(HexViewer* instance) {
|
||||
static void hex_viewer_free(HexViewer* instance) {
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
gui_remove_view_port(instance->gui, instance->view_port);
|
||||
@@ -152,44 +148,7 @@ void hex_viewer_free(HexViewer* instance) {
|
||||
free(instance);
|
||||
}
|
||||
|
||||
// bool hex_viewer_read_file2(HexViewer* hex_viewer, const char* file_path) {
|
||||
// furi_assert(hex_viewer);
|
||||
// furi_assert(file_path);
|
||||
|
||||
// memset(hex_viewer->model->file_bytes, 0x0, HEX_VIEWER_BUF_SIZE);
|
||||
|
||||
// Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
// File* file = storage_file_alloc(storage);
|
||||
|
||||
// bool isOk = true;
|
||||
|
||||
// do {
|
||||
// if(!storage_file_open(file, file_path, FSAM_READ, FSOM_OPEN_EXISTING)) {
|
||||
// FURI_LOG_E(TAG, "Unable to open file: %s", file_path);
|
||||
// isOk = false;
|
||||
// break;
|
||||
// };
|
||||
|
||||
// hex_viewer->model->file_size = storage_file_size(file);
|
||||
|
||||
// uint32_t offset = hex_viewer->model->line * HEX_VIEWER_BYTES_PER_ROW;
|
||||
// if(!storage_file_seek(file, offset, true)) {
|
||||
// FURI_LOG_E(TAG, "Unable to seek file: %s", file_path);
|
||||
// isOk = false;
|
||||
// break;
|
||||
// }
|
||||
|
||||
// hex_viewer->model->read_bytes =
|
||||
// storage_file_read(file, hex_viewer->model->file_bytes, HEX_VIEWER_BUF_SIZE);
|
||||
// } while(false);
|
||||
|
||||
// storage_file_free(file);
|
||||
// furi_record_close(RECORD_STORAGE);
|
||||
|
||||
// return isOk;
|
||||
// }
|
||||
|
||||
bool hex_viewer_open_file(HexViewer* hex_viewer, const char* file_path) {
|
||||
static bool hex_viewer_open_file(HexViewer* hex_viewer, const char* file_path) {
|
||||
furi_assert(hex_viewer);
|
||||
furi_assert(file_path);
|
||||
|
||||
@@ -210,9 +169,9 @@ bool hex_viewer_open_file(HexViewer* hex_viewer, const char* file_path) {
|
||||
return isOk;
|
||||
}
|
||||
|
||||
bool hex_viewer_read_file(HexViewer* hex_viewer) {
|
||||
static bool hex_viewer_read_file(HexViewer* hex_viewer) {
|
||||
furi_assert(hex_viewer);
|
||||
// furi_assert(file_path);
|
||||
furi_assert(hex_viewer->model->stream);
|
||||
|
||||
memset(hex_viewer->model->file_bytes, 0x0, HEX_VIEWER_BUF_SIZE);
|
||||
bool isOk = true;
|
||||
|
||||
@@ -540,7 +540,7 @@ int32_t solitaire_app(void* p) {
|
||||
localstate->input = InputKeyMAX;
|
||||
}
|
||||
} else {
|
||||
FURI_LOG_W(APP_NAME, "osMessageQueue: event timeout");
|
||||
//FURI_LOG_W(APP_NAME, "osMessageQueue: event timeout");
|
||||
// event timeout
|
||||
}
|
||||
if(hadChange || game_state->state == GameStateAnimate) view_port_update(view_port);
|
||||
|
||||
@@ -365,8 +365,6 @@ int32_t esp8266_deauth_app(void* p) {
|
||||
|
||||
DEAUTH_APP_LOG_I("Mutex created");
|
||||
|
||||
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
|
||||
|
||||
//app->m_notification = furi_record_open("notification");
|
||||
|
||||
ViewPort* view_port = view_port_alloc();
|
||||
@@ -379,13 +377,7 @@ int32_t esp8266_deauth_app(void* p) {
|
||||
|
||||
//notification_message(app->notification, &sequence_set_only_blue_255);
|
||||
|
||||
// Enable uart listener
|
||||
#if DISABLE_CONSOLE
|
||||
furi_hal_console_disable();
|
||||
#endif
|
||||
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
|
||||
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
|
||||
DEAUTH_APP_LOG_I("UART Listener created");
|
||||
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
|
||||
|
||||
app->m_worker_thread = furi_thread_alloc();
|
||||
furi_thread_set_name(app->m_worker_thread, "WiFiDeauthModuleUARTWorker");
|
||||
@@ -395,6 +387,14 @@ int32_t esp8266_deauth_app(void* p) {
|
||||
furi_thread_start(app->m_worker_thread);
|
||||
DEAUTH_APP_LOG_I("UART thread allocated");
|
||||
|
||||
// Enable uart listener
|
||||
#if DISABLE_CONSOLE
|
||||
furi_hal_console_disable();
|
||||
#endif
|
||||
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
|
||||
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
|
||||
DEAUTH_APP_LOG_I("UART Listener created");
|
||||
|
||||
SPluginEvent event;
|
||||
for(bool processing = true; processing;) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
|
||||
|
||||
@@ -674,8 +674,6 @@ int32_t wifi_scanner_app(void* p) {
|
||||
|
||||
WIFI_APP_LOG_I("Mutex created");
|
||||
|
||||
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
|
||||
|
||||
app->m_notification = furi_record_open("notification");
|
||||
|
||||
ViewPort* view_port = view_port_alloc();
|
||||
@@ -688,13 +686,7 @@ int32_t wifi_scanner_app(void* p) {
|
||||
|
||||
//notification_message(app->notification, &sequence_set_only_blue_255);
|
||||
|
||||
// Enable uart listener
|
||||
#if DISABLE_CONSOLE
|
||||
furi_hal_console_disable();
|
||||
#endif
|
||||
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
|
||||
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
|
||||
WIFI_APP_LOG_I("UART Listener created");
|
||||
app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1);
|
||||
|
||||
app->m_worker_thread = furi_thread_alloc();
|
||||
furi_thread_set_name(app->m_worker_thread, "WiFiModuleUARTWorker");
|
||||
@@ -704,6 +696,14 @@ int32_t wifi_scanner_app(void* p) {
|
||||
furi_thread_start(app->m_worker_thread);
|
||||
WIFI_APP_LOG_I("UART thread allocated");
|
||||
|
||||
// Enable uart listener
|
||||
#if DISABLE_CONSOLE
|
||||
furi_hal_console_disable();
|
||||
#endif
|
||||
furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD);
|
||||
furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app);
|
||||
WIFI_APP_LOG_I("UART Listener created");
|
||||
|
||||
// Because we assume that module was on before we launched the app. We need to ensure that module will be in initial state on app start
|
||||
send_serial_command(ESerialCommand_Restart);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user