[WIP] Add syntax check for rust and C\C++ code (#108)
* proof of concept * fix syntax for rust and add auto fix syntax * fix syntax for C * fix bug with files owner * add information to wiki * try to add ci * format code from master * even more format fixes * change docker to docker-compose * Exclude ./target_*/build directories from format check * Run rustfmt only on project files * add ulimit setup for long clang list * merge * fix rustfmt, exclude target Inc directory * sync with master * abspath Co-authored-by: aanper <mail@s3f.ru> Co-authored-by: Vadim Kaushan <admin@disasm.info>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
void application_blink(void* p) {
|
||||
// create pin
|
||||
GpioPin led = {.pin = GPIO_PIN_8, .port = GPIOA};
|
||||
|
||||
|
||||
// configure pin
|
||||
pinMode(led, GpioModeOpenDrain);
|
||||
|
||||
|
@@ -25,7 +25,7 @@ static void handle_fb_change(const void* fb, size_t fb_size, void* raw_ctx) {
|
||||
|
||||
static void print_fb(char* fb, FuriRecordSubscriber* log) {
|
||||
if(fb == NULL) return;
|
||||
|
||||
|
||||
/* draw framebuffer like this:
|
||||
+==========+
|
||||
| |
|
||||
@@ -78,57 +78,53 @@ void application_ipc_display(void* p) {
|
||||
IpcCtx ctx = {.events = events, .log = log};
|
||||
|
||||
// subscribe to record. ctx will be passed to handle_fb_change
|
||||
FuriRecordSubscriber* fb_record = furi_open(
|
||||
"test_fb", false, false, handle_fb_change, NULL, &ctx
|
||||
);
|
||||
FuriRecordSubscriber* fb_record =
|
||||
furi_open("test_fb", false, false, handle_fb_change, NULL, &ctx);
|
||||
|
||||
if(fb_record == NULL) {
|
||||
fuprintf(log, "[display] cannot open fb record\n");
|
||||
furiac_exit(NULL);
|
||||
}
|
||||
|
||||
#ifdef HW_DISPLAY
|
||||
#ifdef HW_DISPLAY
|
||||
// on Flipper target -- open screen
|
||||
|
||||
// draw border
|
||||
|
||||
#else
|
||||
#else
|
||||
// on Local target -- print "blank screen"
|
||||
{
|
||||
void* fb = furi_take(fb_record);
|
||||
print_fb((char*)fb, log);
|
||||
furi_give(fb_record);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
while(1) {
|
||||
// wait for event
|
||||
if(xSemaphoreTake(events, portMAX_DELAY) == pdTRUE) {
|
||||
fuprintf(log, "[display] get fb update\n\n");
|
||||
|
||||
#ifdef HW_DISPLAY
|
||||
// on Flipper target draw the screen
|
||||
#else
|
||||
#ifdef HW_DISPLAY
|
||||
// on Flipper target draw the screen
|
||||
#else
|
||||
// on local target just print
|
||||
{
|
||||
void* fb = furi_take(fb_record);
|
||||
print_fb((char*)fb, log);
|
||||
furi_give(fb_record);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Widget application
|
||||
void application_ipc_widget(void* p) {
|
||||
FuriRecordSubscriber* log = get_default_log();
|
||||
|
||||
// open record
|
||||
FuriRecordSubscriber* fb_record = furi_open(
|
||||
"test_fb", false, false, NULL, NULL, NULL
|
||||
);
|
||||
FuriRecordSubscriber* fb_record = furi_open("test_fb", false, false, NULL, NULL, NULL);
|
||||
|
||||
if(fb_record == NULL) {
|
||||
fuprintf(log, "[widget] cannot create fb record\n");
|
||||
|
@@ -6,11 +6,9 @@ void u8g2_example(void* p) {
|
||||
|
||||
// TODO try open record and retry on timeout (needs FURI behaviour change)
|
||||
delay(1000);
|
||||
|
||||
|
||||
// open record
|
||||
FuriRecordSubscriber* fb_record = furi_open(
|
||||
"u8g2_fb", false, false, NULL, NULL, NULL
|
||||
);
|
||||
FuriRecordSubscriber* fb_record = furi_open("u8g2_fb", false, false, NULL, NULL, NULL);
|
||||
|
||||
if(fb_record == NULL) {
|
||||
fuprintf(log, "[widget] cannot create fb record\n");
|
||||
|
Reference in New Issue
Block a user