From 1abc98086edc21985d1b08fcde9d83189d82e440 Mon Sep 17 00:00:00 2001 From: DrZlo13 Date: Tue, 17 Nov 2020 07:39:48 +1000 Subject: [PATCH] split resources, fix format --- applications/ibutton/ibutton_mode_dallas_emulate.h | 2 +- applications/ibutton/ibutton_mode_dallas_read.h | 2 +- applications/music-player/music-player.c | 5 +++++ firmware/targets/f2/api-hal/api-hal-resources.c | 1 + firmware/targets/f2/api-hal/api-hal-resources.h | 1 + firmware/targets/f3/api-hal/api-hal-resources.c | 1 + firmware/targets/f3/api-hal/api-hal-resources.h | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/applications/ibutton/ibutton_mode_dallas_emulate.h b/applications/ibutton/ibutton_mode_dallas_emulate.h index 871a00fb..391c9530 100644 --- a/applications/ibutton/ibutton_mode_dallas_emulate.h +++ b/applications/ibutton/ibutton_mode_dallas_emulate.h @@ -17,7 +17,7 @@ public: app = parent_app; // TODO open record - GpioPin one_wire_pin = {iBTN_GPIO_Port, iBTN_Pin}; + GpioPin one_wire_pin = ibutton_gpio; GpioPin* one_wire_pin_record = &one_wire_pin; onewire_slave = new OneWireGpioSlave(one_wire_pin_record); }; diff --git a/applications/ibutton/ibutton_mode_dallas_read.h b/applications/ibutton/ibutton_mode_dallas_read.h index 8b6d5f2f..f22fa134 100644 --- a/applications/ibutton/ibutton_mode_dallas_read.h +++ b/applications/ibutton/ibutton_mode_dallas_read.h @@ -17,7 +17,7 @@ public: app = parent_app; // TODO open record - GpioPin one_wire_pin = {iBTN_GPIO_Port, iBTN_Pin}; + GpioPin one_wire_pin = ibutton_gpio; GpioPin* one_wire_pin_record = &one_wire_pin; onewire = new OneWireGpio(one_wire_pin_record); }; diff --git a/applications/music-player/music-player.c b/applications/music-player/music-player.c index 09e3ae47..fd37df28 100644 --- a/applications/music-player/music-player.c +++ b/applications/music-player/music-player.c @@ -394,6 +394,11 @@ void music_player(void* p) { MusicDemoContext context = {.state_mutex = &state_mutex, .event_queue = event_queue}; osThreadId_t player = osThreadNew(music_player_thread, &context, &player_attr); + if(player == NULL) { + printf("cannot create player thread\n"); + furiac_exit(NULL); + } + MusicDemoEvent event; while(1) { osStatus_t event_status = osMessageQueueGet(event_queue, &event, NULL, 100); diff --git a/firmware/targets/f2/api-hal/api-hal-resources.c b/firmware/targets/f2/api-hal/api-hal-resources.c index 70e4279b..aae3c4df 100644 --- a/firmware/targets/f2/api-hal/api-hal-resources.c +++ b/firmware/targets/f2/api-hal/api-hal-resources.c @@ -29,3 +29,4 @@ const GpioPin led_gpio[3] = { const GpioPin backlight_gpio = {DISPLAY_BACKLIGHT_GPIO_Port, DISPLAY_BACKLIGHT_Pin}; const GpioPin vibro_gpio = {VIBRO_GPIO_Port, VIBRO_Pin}; +const GpioPin ibutton_gpio = {iButton_GPIO_Port, iButton_Pin}; diff --git a/firmware/targets/f2/api-hal/api-hal-resources.h b/firmware/targets/f2/api-hal/api-hal-resources.h index c829f355..44ca6afe 100644 --- a/firmware/targets/f2/api-hal/api-hal-resources.h +++ b/firmware/targets/f2/api-hal/api-hal-resources.h @@ -11,3 +11,4 @@ extern const bool input_invert[GPIO_INPUT_PINS_COUNT]; extern const GpioPin led_gpio[3]; extern const GpioPin backlight_gpio; extern const GpioPin vibro_gpio; +extern const GpioPin ibutton_gpio; \ No newline at end of file diff --git a/firmware/targets/f3/api-hal/api-hal-resources.c b/firmware/targets/f3/api-hal/api-hal-resources.c index 4bb80dd4..50893111 100644 --- a/firmware/targets/f3/api-hal/api-hal-resources.c +++ b/firmware/targets/f3/api-hal/api-hal-resources.c @@ -27,3 +27,4 @@ const GpioPin led_gpio[3] = { const GpioPin backlight_gpio = {DISPLAY_BACKLIGHT_GPIO_Port, DISPLAY_BACKLIGHT_Pin}; const GpioPin sd_cs_gpio = {SD_CS_GPIO_Port, SD_CS_Pin}; const GpioPin vibro_gpio = {VIBRO_GPIO_Port, VIBRO_Pin}; +const GpioPin ibutton_gpio = {iBTN_GPIO_Port, iBTN_Pin}; diff --git a/firmware/targets/f3/api-hal/api-hal-resources.h b/firmware/targets/f3/api-hal/api-hal-resources.h index ccbfe6e9..ed78a5aa 100644 --- a/firmware/targets/f3/api-hal/api-hal-resources.h +++ b/firmware/targets/f3/api-hal/api-hal-resources.h @@ -12,3 +12,4 @@ extern const GpioPin led_gpio[3]; extern const GpioPin backlight_gpio; extern const GpioPin sd_cs_gpio; extern const GpioPin vibro_gpio; +extern const GpioPin ibutton_gpio;