fix build flag
This commit is contained in:
		
							parent
							
								
									a30968bc6f
								
							
						
					
					
						commit
						3da3022dff
					
				| @ -1,6 +1,7 @@ | |||||||
| #include "flipper_v2.h" | #include "flipper_v2.h" | ||||||
| #include <gui/gui.h> | #include <gui/gui.h> | ||||||
| #include "menu/menu.h" | #include "menu/menu.h" | ||||||
|  | #include "applications.h" | ||||||
| 
 | 
 | ||||||
| typedef struct { | typedef struct { | ||||||
|     FuriApp* handler; |     FuriApp* handler; | ||||||
| @ -48,18 +49,6 @@ static void handle_menu(void* _ctx) { | |||||||
|     ctx->state->handler = furiac_start(ctx->app->app, ctx->app->name, NULL); |     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) { | void app_loader(void* p) { | ||||||
|     osThreadId_t self_id = osThreadGetId(); |     osThreadId_t self_id = osThreadGetId(); | ||||||
|     assert(self_id); |     assert(self_id); | ||||||
|  | |||||||
| @ -74,3 +74,21 @@ const FlipperStartupApp FLIPPER_STARTUP[] = { | |||||||
|     {.app = u8g2_example, .name = "u8g2_example", .libs = {1, FURI_LIB{"display_u8g2"}}}, |     {.app = u8g2_example, .name = "u8g2_example", .libs = {1, FURI_LIB{"display_u8g2"}}}, | ||||||
| #endif | #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 | ||||||
|  | }; | ||||||
| @ -3,24 +3,30 @@ LIB_DIR 	= $(PROJECT_ROOT)/lib | |||||||
| 
 | 
 | ||||||
| CFLAGS		+= -I$(APP_DIR) | CFLAGS		+= -I$(APP_DIR) | ||||||
| 
 | 
 | ||||||
|  | # Use APP_* for autostart app
 | ||||||
|  | # Use BUILD_* for add app to build
 | ||||||
|  | 
 | ||||||
| APP_RELEASE ?= 0 | APP_RELEASE ?= 0 | ||||||
| ifeq ($(APP_RELEASE), 1) | ifeq ($(APP_RELEASE), 1) | ||||||
| APP_GUI		= 1 |  | ||||||
| APP_INPUT	= 1 |  | ||||||
| APP_MENU = 1 | APP_MENU = 1 | ||||||
|  | BUILD_EXAMPLE_BLINK = 1 | ||||||
|  | BUILD_EXAMPLE_UART_WRITE = 1 | ||||||
|  | BUILD_EXAMPLE_INPUT_DUMP = 1 | ||||||
|  | BUILD_CC1101 = 1 | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| APP_MENU ?= 0 | APP_MENU ?= 0 | ||||||
| ifeq ($(APP_MENU), 1) | ifeq ($(APP_MENU), 1) | ||||||
|  | CFLAGS += -DAPP_MENU | ||||||
|  | BUILD_MENU = 1 | ||||||
|  | endif | ||||||
|  | BUILD_MENU ?= 0 | ||||||
|  | ifeq ($(BUILD_MENU), 1) | ||||||
| APP_INPUT	= 1 | APP_INPUT	= 1 | ||||||
| APP_GUI		= 1 | APP_GUI		= 1 | ||||||
| CFLAGS		+= -DAPP_MENU | CFLAGS		+= -DBUILD_MENU | ||||||
| C_SOURCES	+= $(wildcard $(APP_DIR)/menu/*.c) | C_SOURCES	+= $(wildcard $(APP_DIR)/menu/*.c) | ||||||
| C_SOURCES	+= $(wildcard $(APP_DIR)/app-loader/*.c) | C_SOURCES	+= $(wildcard $(APP_DIR)/app-loader/*.c) | ||||||
| 
 |  | ||||||
| APP_EXAMPLE_BLINK = 1 |  | ||||||
| APP_EXAMPLE_UART_WRITE = 1 |  | ||||||
| APP_EXAMPLE_INPUT_DUMP = 1 |  | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| APP_TEST	?= 0 | APP_TEST	?= 0 | ||||||
| @ -38,24 +44,44 @@ endif | |||||||
| APP_EXAMPLE_BLINK ?= 0 | APP_EXAMPLE_BLINK ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_BLINK), 1) | ifeq ($(APP_EXAMPLE_BLINK), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_BLINK | 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 | C_SOURCES	+= $(APP_DIR)/examples/blink.c | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| APP_EXAMPLE_UART_WRITE ?= 0 | APP_EXAMPLE_UART_WRITE ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_UART_WRITE), 1) | ifeq ($(APP_EXAMPLE_UART_WRITE), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_UART_WRITE | 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 | C_SOURCES	+= $(APP_DIR)/examples/uart_write.c | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| APP_EXAMPLE_IPC ?= 0 | APP_EXAMPLE_IPC ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_IPC), 1) | ifeq ($(APP_EXAMPLE_IPC), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_IPC | 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 | C_SOURCES	+= $(APP_DIR)/examples/ipc.c | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| APP_EXAMPLE_INPUT_DUMP ?= 0 | APP_EXAMPLE_INPUT_DUMP ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_INPUT_DUMP), 1) | ifeq ($(APP_EXAMPLE_INPUT_DUMP), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_INPUT_DUMP | 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 | C_SOURCES	+= $(APP_DIR)/examples/input_dump.c | ||||||
| APP_INPUT = 1 | APP_INPUT = 1 | ||||||
| endif | endif | ||||||
| @ -63,11 +89,17 @@ endif | |||||||
| APP_EXAMPLE_QRCODE ?= 0 | APP_EXAMPLE_QRCODE ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_QRCODE), 1) | ifeq ($(APP_EXAMPLE_QRCODE), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_QRCODE | 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	+= $(APP_DIR)/examples/u8g2_qrcode.c | ||||||
| C_SOURCES	+= $(LIB_DIR)/qrcode/qrcode.c | C_SOURCES	+= $(LIB_DIR)/qrcode/qrcode.c | ||||||
| APP_DISPLAY = 1 | APP_DISPLAY = 1 | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
|  | # deprecated
 | ||||||
| APP_EXAMPLE_DISPLAY ?= 0 | APP_EXAMPLE_DISPLAY ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_DISPLAY), 1) | ifeq ($(APP_EXAMPLE_DISPLAY), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_DISPLAY | CFLAGS		+= -DAPP_EXAMPLE_DISPLAY | ||||||
| @ -78,6 +110,11 @@ endif | |||||||
| APP_EXAMPLE_FATFS ?= 0 | APP_EXAMPLE_FATFS ?= 0 | ||||||
| ifeq ($(APP_EXAMPLE_FATFS), 1) | ifeq ($(APP_EXAMPLE_FATFS), 1) | ||||||
| CFLAGS		+= -DAPP_EXAMPLE_FATFS | 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 | C_SOURCES	+= $(APP_DIR)/examples/fatfs_list.c | ||||||
| APP_INPUT = 1 | APP_INPUT = 1 | ||||||
| APP_DISPLAY = 1 | APP_DISPLAY = 1 | ||||||
| @ -86,13 +123,11 @@ endif | |||||||
| APP_CC1101 ?= 0 | APP_CC1101 ?= 0 | ||||||
| ifeq ($(APP_CC1101), 1) | ifeq ($(APP_CC1101), 1) | ||||||
| CFLAGS		+= -DAPP_CC1101 | CFLAGS		+= -DAPP_CC1101 | ||||||
| C_SOURCES	+= $(wildcard $(APP_DIR)/cc1101-workaround/*.c) | BUILD_CC1101 = 1 | ||||||
| CPP_SOURCES	+= $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp) |  | ||||||
| APP_INPUT = 1 |  | ||||||
| APP_GUI = 1 |  | ||||||
| endif | endif | ||||||
| 
 | BUILD_CC1101 ?= 0 | ||||||
| ifeq ($(APP_RELEASE), 1) | ifeq ($(BUILD_CC1101), 1) | ||||||
|  | CFLAGS		+= -DBUILD_CC1101 | ||||||
| C_SOURCES	+= $(wildcard $(APP_DIR)/cc1101-workaround/*.c) | C_SOURCES	+= $(wildcard $(APP_DIR)/cc1101-workaround/*.c) | ||||||
| CPP_SOURCES	+= $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp) | CPP_SOURCES	+= $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp) | ||||||
| APP_INPUT = 1 | APP_INPUT = 1 | ||||||
| @ -100,6 +135,7 @@ APP_GUI = 1 | |||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| # device drivers
 | # device drivers
 | ||||||
|  | 
 | ||||||
| APP_GUI	?= 0 | APP_GUI	?= 0 | ||||||
| ifeq ($(APP_GUI), 1) | ifeq ($(APP_GUI), 1) | ||||||
| CFLAGS		+= -DAPP_GUI | CFLAGS		+= -DAPP_GUI | ||||||
| @ -107,6 +143,7 @@ C_SOURCES	+= $(wildcard $(APP_DIR)/gui/*.c) | |||||||
| C_SOURCES	+= $(wildcard $(APP_DIR)/backlight-control/*.c) | C_SOURCES	+= $(wildcard $(APP_DIR)/backlight-control/*.c) | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
|  | # deprecated
 | ||||||
| ifeq ($(APP_DISPLAY), 1) | ifeq ($(APP_DISPLAY), 1) | ||||||
| CFLAGS		+= -DAPP_DISPLAY | CFLAGS		+= -DAPP_DISPLAY | ||||||
| C_SOURCES	+= $(APP_DIR)/display-u8g2/display-u8g2.c | C_SOURCES	+= $(APP_DIR)/display-u8g2/display-u8g2.c | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ | |||||||
| extern "C" { | extern "C" { | ||||||
| #include "flipper.h" | #include "flipper.h" | ||||||
| #include "log.h" | #include "log.h" | ||||||
| #include "startup.h" | #include "applications.h" | ||||||
| #include "tty_uart.h" | #include "tty_uart.h" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 aanper
						aanper