Merge pull request #186 from Flipper-Zero/fix-build-flag

fix build flag
This commit is contained in:
coreglitch 2020-10-20 11:59:42 +06:00 committed by GitHub
commit c4e3f28a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 26 deletions

View file

@ -1,6 +1,7 @@
#include "flipper_v2.h"
#include <gui/gui.h>
#include "menu/menu.h"
#include "applications.h"
typedef struct {
FuriApp* handler;
@ -48,18 +49,6 @@ static void handle_menu(void* _ctx) {
ctx->state->handler = furiac_start(ctx->app->app, ctx->app->name, NULL);
}
void application_blink(void* p);
void application_uart_write(void* p);
void application_input_dump(void* p);
void cc1101_workaround(void* p);
const FlipperStartupApp FLIPPER_APPS[] = {
{.app = application_blink, .name = "blink", .libs = {0}},
{.app = application_uart_write, .name = "uart write", .libs = {0}},
{.app = application_input_dump, .name = "input dump", .libs = {1, FURI_LIB{"input_task"}}},
{.app = cc1101_workaround, .name = "cc1101 workaround", .libs = {1, FURI_LIB{"gui_task"}}},
};
void app_loader(void* p) {
osThreadId_t self_id = osThreadGetId();
assert(self_id);

View file

@ -74,3 +74,21 @@ const FlipperStartupApp FLIPPER_STARTUP[] = {
{.app = u8g2_example, .name = "u8g2_example", .libs = {1, FURI_LIB{"display_u8g2"}}},
#endif
};
const FlipperStartupApp FLIPPER_APPS[] = {
#ifdef BUILD_EXAMPLE_BLINK
{.app = application_blink, .name = "blink", .libs = {0}},
#endif
#ifdef BUILD_EXAMPLE_UART_WRITE
{.app = application_uart_write, .name = "uart write", .libs = {0}},
#endif
#ifdef BUILD_EXAMPLE_INPUT_DUMP
{.app = application_input_dump, .name = "input dump", .libs = {1, FURI_LIB{"input_task"}}},
#endif
#ifdef BUILD_CC1101
{.app = cc1101_workaround, .name = "cc1101 workaround", .libs = {1, FURI_LIB{"gui_task"}}},
#endif
};

View file

@ -3,24 +3,30 @@ LIB_DIR = $(PROJECT_ROOT)/lib
CFLAGS += -I$(APP_DIR)
# Use APP_* for autostart app
# Use BUILD_* for add app to build
APP_RELEASE ?= 0
ifeq ($(APP_RELEASE), 1)
APP_GUI = 1
APP_INPUT = 1
APP_MENU = 1
BUILD_EXAMPLE_BLINK = 1
BUILD_EXAMPLE_UART_WRITE = 1
BUILD_EXAMPLE_INPUT_DUMP = 1
BUILD_CC1101 = 1
endif
APP_MENU ?= 0
ifeq ($(APP_MENU), 1)
CFLAGS += -DAPP_MENU
BUILD_MENU = 1
endif
BUILD_MENU ?= 0
ifeq ($(BUILD_MENU), 1)
APP_INPUT = 1
APP_GUI = 1
CFLAGS += -DAPP_MENU
CFLAGS += -DBUILD_MENU
C_SOURCES += $(wildcard $(APP_DIR)/menu/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/app-loader/*.c)
APP_EXAMPLE_BLINK = 1
APP_EXAMPLE_UART_WRITE = 1
APP_EXAMPLE_INPUT_DUMP = 1
endif
APP_TEST ?= 0
@ -38,24 +44,44 @@ endif
APP_EXAMPLE_BLINK ?= 0
ifeq ($(APP_EXAMPLE_BLINK), 1)
CFLAGS += -DAPP_EXAMPLE_BLINK
BUILD_EXAMPLE_BLINK = 1
endif
BUILD_EXAMPLE_BLINK ?= 0
ifeq ($(BUILD_EXAMPLE_BLINK), 1)
CFLAGS += -DBUILD_EXAMPLE_BLINK
C_SOURCES += $(APP_DIR)/examples/blink.c
endif
APP_EXAMPLE_UART_WRITE ?= 0
ifeq ($(APP_EXAMPLE_UART_WRITE), 1)
CFLAGS += -DAPP_EXAMPLE_UART_WRITE
BUILD_EXAMPLE_UART_WRITE = 1
endif
BUILD_EXAMPLE_UART_WRITE ?= 0
ifeq ($(BUILD_EXAMPLE_UART_WRITE), 1)
CFLAGS += -DBUILD_EXAMPLE_UART_WRITE
C_SOURCES += $(APP_DIR)/examples/uart_write.c
endif
APP_EXAMPLE_IPC ?= 0
ifeq ($(APP_EXAMPLE_IPC), 1)
CFLAGS += -DAPP_EXAMPLE_IPC
BUILD_EXAMPLE_IPC = 1
endif
BUILD_EXAMPLE_IPC ?= 0
ifeq ($(BUILD_EXAMPLE_IPC), 1)
CFLAGS += -DBUILD_EXAMPLE_IPC
C_SOURCES += $(APP_DIR)/examples/ipc.c
endif
APP_EXAMPLE_INPUT_DUMP ?= 0
ifeq ($(APP_EXAMPLE_INPUT_DUMP), 1)
CFLAGS += -DAPP_EXAMPLE_INPUT_DUMP
BUILD_EXAMPLE_INPUT_DUMP = 1
endif
BUILD_EXAMPLE_INPUT_DUMP ?= 0
ifeq ($(BUILD_EXAMPLE_INPUT_DUMP), 1)
CFLAGS += -DBUILD_EXAMPLE_INPUT_DUMP
C_SOURCES += $(APP_DIR)/examples/input_dump.c
APP_INPUT = 1
endif
@ -63,11 +89,17 @@ endif
APP_EXAMPLE_QRCODE ?= 0
ifeq ($(APP_EXAMPLE_QRCODE), 1)
CFLAGS += -DAPP_EXAMPLE_QRCODE
BUILD_EXAMPLE_QRCODE = 1
endif
BUILD_EXAMPLE_QRCODE ?= 0
ifeq ($(BUILD_EXAMPLE_QRCODE), 1)
CFLAGS += -DBUILD_EXAMPLE_QRCODE
C_SOURCES += $(APP_DIR)/examples/u8g2_qrcode.c
C_SOURCES += $(LIB_DIR)/qrcode/qrcode.c
APP_DISPLAY = 1
endif
# deprecated
APP_EXAMPLE_DISPLAY ?= 0
ifeq ($(APP_EXAMPLE_DISPLAY), 1)
CFLAGS += -DAPP_EXAMPLE_DISPLAY
@ -78,6 +110,11 @@ endif
APP_EXAMPLE_FATFS ?= 0
ifeq ($(APP_EXAMPLE_FATFS), 1)
CFLAGS += -DAPP_EXAMPLE_FATFS
BUILD_EXAMPLE_FATFS = 1
endif
BUILD_EXAMPLE_FATFS ?= 0
ifeq ($(BUILD_EXAMPLE_FATFS), 1)
CFLAGS += -DBUILD_EXAMPLE_FATFS
C_SOURCES += $(APP_DIR)/examples/fatfs_list.c
APP_INPUT = 1
APP_DISPLAY = 1
@ -86,13 +123,11 @@ endif
APP_CC1101 ?= 0
ifeq ($(APP_CC1101), 1)
CFLAGS += -DAPP_CC1101
C_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.c)
CPP_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp)
APP_INPUT = 1
APP_GUI = 1
BUILD_CC1101 = 1
endif
ifeq ($(APP_RELEASE), 1)
BUILD_CC1101 ?= 0
ifeq ($(BUILD_CC1101), 1)
CFLAGS += -DBUILD_CC1101
C_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.c)
CPP_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp)
APP_INPUT = 1
@ -100,6 +135,7 @@ APP_GUI = 1
endif
# device drivers
APP_GUI ?= 0
ifeq ($(APP_GUI), 1)
CFLAGS += -DAPP_GUI
@ -107,6 +143,7 @@ C_SOURCES += $(wildcard $(APP_DIR)/gui/*.c)
C_SOURCES += $(wildcard $(APP_DIR)/backlight-control/*.c)
endif
# deprecated
ifeq ($(APP_DISPLAY), 1)
CFLAGS += -DAPP_DISPLAY
C_SOURCES += $(APP_DIR)/display-u8g2/display-u8g2.c

View file

@ -3,7 +3,7 @@
extern "C" {
#include "flipper.h"
#include "log.h"
#include "startup.h"
#include "applications.h"
#include "tty_uart.h"
}