add workaround app
This commit is contained in:
		@@ -67,6 +67,14 @@ APP_INPUT = 1
 | 
			
		||||
APP_DISPLAY = 1
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
APP_CC1101 ?= 0
 | 
			
		||||
ifeq ($(APP_CC1101), 1)
 | 
			
		||||
CFLAGS		+= -DAPP_CC1101
 | 
			
		||||
C_SOURCES	+= $(APP_DIR)/cc1101-workaround/cc1101-workaround.c
 | 
			
		||||
APP_INPUT = 1
 | 
			
		||||
APP_DISPLAY = 1
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# device drivers
 | 
			
		||||
 | 
			
		||||
ifeq ($(APP_DISPLAY), 1)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								applications/cc1101-workaround/cc1101-workaround.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								applications/cc1101-workaround/cc1101-workaround.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
#include "flipper.h"
 | 
			
		||||
#include "u8g2.h"
 | 
			
		||||
 | 
			
		||||
void cc1101_workaround(void* p) {
 | 
			
		||||
    FuriRecordSubscriber* fb_record = furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
    if(fb_record == NULL) {
 | 
			
		||||
        printf("[cc1101] cannot create fb record\n");
 | 
			
		||||
        furiac_exit(NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    while(1) {
 | 
			
		||||
        u8g2_t* fb = furi_take(fb_record);
 | 
			
		||||
        if(fb != NULL) {
 | 
			
		||||
            u8g2_SetFont(fb, u8g2_font_6x10_mf);
 | 
			
		||||
            u8g2_SetDrawColor(fb, 1);
 | 
			
		||||
            u8g2_SetFontMode(fb, 1);
 | 
			
		||||
            u8g2_DrawStr(fb, 2, 12, "cc1101 workaround");
 | 
			
		||||
        }
 | 
			
		||||
        furi_commit(fb_record);
 | 
			
		||||
 | 
			
		||||
        delay(1000);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -22,6 +22,7 @@ void input_task(void* p);
 | 
			
		||||
void menu_task(void* p);
 | 
			
		||||
 | 
			
		||||
void coreglitch_demo_0(void* p);
 | 
			
		||||
void cc1101_workaround(void* p);
 | 
			
		||||
 | 
			
		||||
void u8g2_qrcode(void* p);
 | 
			
		||||
void fatfs_list(void* p);
 | 
			
		||||
@@ -70,4 +71,8 @@ const FlipperStartupApp FLIPPER_STARTUP[] = {
 | 
			
		||||
    {.app = u8g2_example, .name = "u8g2_example", .libs = {1, FURI_LIB{"display_u8g2"}}},
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef APP_CC1101
 | 
			
		||||
    {.app = cc1101_workaround, .name = "cc1101_workaround", .libs = {2, FURI_LIB{"display_u8g2", "input_task"}}},
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user