Blink f1 (#50)

* Fix target_f1 build

* restore build for F1 target

* change default LED pin state

* add real hw gif

Co-authored-by: Vadim Kaushan <admin@disasm.info>
This commit is contained in:
coreglitch
2020-08-26 14:43:18 +06:00
committed by GitHub
parent e7aa6caf0e
commit ab07bfb104
12 changed files with 134 additions and 62 deletions

View File

@@ -2,9 +2,9 @@
#include "cmsis_os.h"
#include <string.h>
#define DEBUG
// TODO: this file contains printf, that not implemented on uC target
#ifdef DEBUG
#ifdef FURI_DEBUG
#include <stdio.h>
#endif
@@ -28,13 +28,13 @@ static FuriRecord* find_record(const char* name) {
}
bool furi_create(const char* name, void* value, size_t size) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] creating %s record\n", name);
#endif
if(current_buffer_idx >= MAX_RECORD_COUNT) {
// max record count exceed
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] max record count exceed\n");
#endif
return NULL;
@@ -62,7 +62,7 @@ FuriRecordHandler furi_open(
FlipperRecordCallback value_callback,
FlipperRecordStateCallback state_callback
) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] opening %s record\n", name);
#endif
@@ -71,7 +71,7 @@ FuriRecordHandler furi_open(
if(record == NULL) {
// cannot find record
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] cannot find record %s\n", name);
#endif
@@ -91,7 +91,7 @@ FuriRecordHandler furi_open(
if(subscriber == NULL) {
// cannot add subscriber (full)
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] cannot add subscriber (full)\n");
#endif
@@ -123,7 +123,7 @@ FuriRecordHandler furi_open(
void furi_close(FuriRecordHandler* handler) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] closing %s record\n", handler->record->name);
#endif
@@ -163,7 +163,7 @@ void furi_give(FuriRecordHandler* handler) {
}
bool furi_read(FuriRecordHandler* handler, void* value, size_t size) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] read from %s\n", handler->record->name);
#endif
@@ -183,7 +183,7 @@ bool furi_read(FuriRecordHandler* handler, void* value, size_t size) {
}
bool furi_write(FuriRecordHandler* handler, const void* value, size_t size) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURI] write to %s\n", handler->record->name);
#endif

View File

@@ -1,9 +1,9 @@
#include "furi.h"
#include "cmsis_os.h"
#define DEBUG
// TODO: this file contains printf, that not implemented on uC target
#ifdef DEBUG
#ifdef FURI_DEBUG
#include <stdio.h>
#endif
@@ -29,7 +29,7 @@ FuriApp* find_task(TaskHandle_t handler) {
}
FuriApp* furiac_start(FlipperApplication app, const char* name, void* param) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] start %s\n", name);
#endif
@@ -37,7 +37,7 @@ FuriApp* furiac_start(FlipperApplication app, const char* name, void* param) {
if(current_buffer_idx >= MAX_TASK_COUNT) {
// max task count exceed
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] max task count exceed\n");
#endif
return NULL;
@@ -67,7 +67,7 @@ FuriApp* furiac_start(FlipperApplication app, const char* name, void* param) {
}
bool furiac_kill(FuriApp* app) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] kill %s\n", app->name);
#endif
@@ -90,14 +90,14 @@ void furiac_exit(void* param) {
// run prev
if(current_task != NULL) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] exit %s\n", current_task->name);
#endif
if(current_task->prev != NULL) {
furiac_start(current_task->prev, current_task->prev_name, param);
} else {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] no prev\n");
#endif
}
@@ -116,12 +116,12 @@ void furiac_switch(FlipperApplication app, char* name, void* param) {
FuriApp* current_task = find_task(xTaskGetCurrentTaskHandle());
if(current_task == NULL) {
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] no current task found\n");
#endif
}
#ifdef DEBUG
#ifdef FURI_DEBUG
printf("[FURIAC] switch %s to %s\n", current_task->name, name);
#endif