mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
This can just be made global at this point lol
This commit is contained in:
@@ -214,16 +214,15 @@ bool subghz_device_cc1101_ext_alloc(SubGhzDeviceConf* conf) {
|
|||||||
subghz_device_cc1101_ext->async_rx.capture_delta_duration = 0;
|
subghz_device_cc1101_ext->async_rx.capture_delta_duration = 0;
|
||||||
|
|
||||||
subghz_device_cc1101_ext->spi_bus_handle =
|
subghz_device_cc1101_ext->spi_bus_handle =
|
||||||
(XTREME_SETTINGS()->spi_cc1101_handle == SpiDefault ?
|
(xtreme_settings.spi_cc1101_handle == SpiDefault ?
|
||||||
&furi_hal_spi_bus_handle_external :
|
&furi_hal_spi_bus_handle_external :
|
||||||
&furi_hal_spi_bus_handle_external_extra);
|
&furi_hal_spi_bus_handle_external_extra);
|
||||||
|
|
||||||
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
||||||
if(XTREME_SETTINGS()->spi_cc1101_handle == SpiDefault &&
|
if(xtreme_settings.spi_cc1101_handle == SpiDefault && !furi_hal_subghz_get_ext_power_amp()) {
|
||||||
!furi_hal_subghz_get_ext_power_amp()) {
|
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
||||||
} else if(XTREME_SETTINGS()->spi_cc1101_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_cc1101_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
||||||
}
|
}
|
||||||
@@ -245,9 +244,9 @@ void subghz_device_cc1101_ext_free() {
|
|||||||
free(subghz_device_cc1101_ext);
|
free(subghz_device_cc1101_ext);
|
||||||
|
|
||||||
// resetting the CS pins to floating
|
// resetting the CS pins to floating
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault || subghz_device_cc1101_ext->power_amp) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault || subghz_device_cc1101_ext->power_amp) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,11 @@
|
|||||||
#define MAX_SSID_LENGTH 32
|
#define MAX_SSID_LENGTH 32
|
||||||
#define MAX_BSSID_LENGTH 18
|
#define MAX_BSSID_LENGTH 18
|
||||||
|
|
||||||
#define UART_CH_ESP \
|
#define UART_CH_ESP \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define UART_CH_GPS \
|
#define UART_CH_GPS \
|
||||||
(XTREME_SETTINGS()->uart_nmea_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_nmea_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
|
#define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,8 @@
|
|||||||
|
|
||||||
#include "FlipperZeroWiFiDeauthModuleDefines.h"
|
#include "FlipperZeroWiFiDeauthModuleDefines.h"
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define DEAUTH_APP_DEBUG 0
|
#define DEAUTH_APP_DEBUG 0
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
#include "esp_flasher_uart.h"
|
#include "esp_flasher_uart.h"
|
||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
#define BAUDRATE (115200)
|
#define BAUDRATE (115200)
|
||||||
|
|
||||||
struct EspFlasherUart {
|
struct EspFlasherUart {
|
||||||
|
|||||||
@@ -22,9 +22,8 @@
|
|||||||
#define NUM_MENU_ITEMS (6)
|
#define NUM_MENU_ITEMS (6)
|
||||||
|
|
||||||
#define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
|
#define EVIL_PORTAL_TEXT_BOX_STORE_SIZE (4096)
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define SET_HTML_CMD "sethtml"
|
#define SET_HTML_CMD "sethtml"
|
||||||
#define SET_AP_CMD "setap"
|
#define SET_AP_CMD "setap"
|
||||||
|
|||||||
@@ -4,9 +4,8 @@
|
|||||||
#include <notification/notification_messages.h>
|
#include <notification/notification_messages.h>
|
||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_nmea_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_nmea_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define RX_BUF_SIZE 1024
|
#define RX_BUF_SIZE 1024
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
void nrf24_init() {
|
void nrf24_init() {
|
||||||
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
||||||
}
|
}
|
||||||
@@ -30,9 +30,9 @@ void nrf24_deinit() {
|
|||||||
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
|
|
||||||
// resetting the CS pins to floating
|
// resetting the CS pins to floating
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ extern "C" {
|
|||||||
#define nrf24_TIMEOUT 500
|
#define nrf24_TIMEOUT 500
|
||||||
#define nrf24_CE_PIN &gpio_ext_pb2
|
#define nrf24_CE_PIN &gpio_ext_pb2
|
||||||
#define nrf24_HANDLE \
|
#define nrf24_HANDLE \
|
||||||
(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
(xtreme_settings.spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
||||||
&furi_hal_spi_bus_handle_external_extra)
|
&furi_hal_spi_bus_handle_external_extra)
|
||||||
|
|
||||||
/* Low level API */
|
/* Low level API */
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
void nrf24_init() {
|
void nrf24_init() {
|
||||||
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
||||||
}
|
}
|
||||||
@@ -28,9 +28,9 @@ void nrf24_deinit() {
|
|||||||
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
|
|
||||||
// resetting the CS pins to floating
|
// resetting the CS pins to floating
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ extern "C" {
|
|||||||
#define nrf24_TIMEOUT 500
|
#define nrf24_TIMEOUT 500
|
||||||
#define nrf24_CE_PIN &gpio_ext_pb2
|
#define nrf24_CE_PIN &gpio_ext_pb2
|
||||||
#define nrf24_HANDLE \
|
#define nrf24_HANDLE \
|
||||||
(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
(xtreme_settings.spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
||||||
&furi_hal_spi_bus_handle_external_extra)
|
&furi_hal_spi_bus_handle_external_extra)
|
||||||
|
|
||||||
/* Low level API */
|
/* Low level API */
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
void nrf24_init() {
|
void nrf24_init() {
|
||||||
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
||||||
}
|
}
|
||||||
@@ -28,9 +28,9 @@ void nrf24_deinit() {
|
|||||||
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
|
|
||||||
// resetting the CS pins to floating
|
// resetting the CS pins to floating
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ extern "C" {
|
|||||||
#define nrf24_TIMEOUT 500
|
#define nrf24_TIMEOUT 500
|
||||||
#define nrf24_CE_PIN &gpio_ext_pb2
|
#define nrf24_CE_PIN &gpio_ext_pb2
|
||||||
#define nrf24_HANDLE \
|
#define nrf24_HANDLE \
|
||||||
(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
(xtreme_settings.spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
||||||
&furi_hal_spi_bus_handle_external_extra)
|
&furi_hal_spi_bus_handle_external_extra)
|
||||||
|
|
||||||
/* Low level API */
|
/* Low level API */
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
void nrf24_init() {
|
void nrf24_init() {
|
||||||
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
||||||
}
|
}
|
||||||
@@ -30,9 +30,9 @@ void nrf24_deinit() {
|
|||||||
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
|
|
||||||
// resetting the CS pins to floating
|
// resetting the CS pins to floating
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ extern "C" {
|
|||||||
#define nrf24_TIMEOUT 500
|
#define nrf24_TIMEOUT 500
|
||||||
#define nrf24_CE_PIN &gpio_ext_pb2
|
#define nrf24_CE_PIN &gpio_ext_pb2
|
||||||
#define nrf24_HANDLE \
|
#define nrf24_HANDLE \
|
||||||
(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
(xtreme_settings.spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
||||||
&furi_hal_spi_bus_handle_external_extra)
|
&furi_hal_spi_bus_handle_external_extra)
|
||||||
|
|
||||||
/* Low level API */
|
/* Low level API */
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
void nrf24_init() {
|
void nrf24_init() {
|
||||||
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
// this is needed if multiple SPI devices are connected to the same bus but with different CS pins
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
furi_hal_gpio_write(&gpio_ext_pc3, true);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeOutputPushPull);
|
||||||
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
furi_hal_gpio_write(&gpio_ext_pa4, true);
|
||||||
}
|
}
|
||||||
@@ -28,9 +28,9 @@ void nrf24_deinit() {
|
|||||||
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
|
|
||||||
// resetting the CS pins to floating
|
// resetting the CS pins to floating
|
||||||
if(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault) {
|
if(xtreme_settings.spi_nrf24_handle == SpiDefault) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pc3, GpioModeAnalog);
|
||||||
} else if(XTREME_SETTINGS()->spi_nrf24_handle == SpiExtra) {
|
} else if(xtreme_settings.spi_nrf24_handle == SpiExtra) {
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
furi_hal_gpio_init_simple(&gpio_ext_pa4, GpioModeAnalog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ extern "C" {
|
|||||||
#define nrf24_TIMEOUT 500
|
#define nrf24_TIMEOUT 500
|
||||||
#define nrf24_CE_PIN &gpio_ext_pb2
|
#define nrf24_CE_PIN &gpio_ext_pb2
|
||||||
#define nrf24_HANDLE \
|
#define nrf24_HANDLE \
|
||||||
(XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
(xtreme_settings.spi_nrf24_handle == SpiDefault ? &furi_hal_spi_bus_handle_external : \
|
||||||
&furi_hal_spi_bus_handle_external_extra)
|
&furi_hal_spi_bus_handle_external_extra)
|
||||||
|
|
||||||
/* Low level API */
|
/* Low level API */
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
#define UART_TERMINAL_TEXT_BOX_STORE_SIZE (4096)
|
#define UART_TERMINAL_TEXT_BOX_STORE_SIZE (4096)
|
||||||
#define UART_TERMINAL_TEXT_INPUT_STORE_SIZE (512)
|
#define UART_TERMINAL_TEXT_INPUT_STORE_SIZE (512)
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_general_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_general_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
||||||
FuriHalUartIdLPUART1)
|
FuriHalUartIdLPUART1)
|
||||||
|
|
||||||
struct UART_TerminalApp {
|
struct UART_TerminalApp {
|
||||||
Gui* gui;
|
Gui* gui;
|
||||||
|
|||||||
@@ -14,9 +14,8 @@
|
|||||||
|
|
||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define NUM_MENU_ITEMS (11)
|
#define NUM_MENU_ITEMS (11)
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,8 @@
|
|||||||
#include <dialogs/dialogs.h>
|
#include <dialogs/dialogs.h>
|
||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
|
|
||||||
#define XTREME_UART_CH \
|
#define XTREME_UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define US_ART_CH (FuriHalUartIdUSART1)
|
#define US_ART_CH (FuriHalUartIdUSART1)
|
||||||
#define LP_UART_CH (FuriHalUartIdLPUART1)
|
#define LP_UART_CH (FuriHalUartIdLPUART1)
|
||||||
|
|||||||
@@ -18,6 +18,5 @@
|
|||||||
|
|
||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_esp_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
|
|||||||
} else {
|
} else {
|
||||||
tab = (tab + 1) % ArchiveTabTotal;
|
tab = (tab + 1) % ArchiveTabTotal;
|
||||||
}
|
}
|
||||||
if(tab == ArchiveTabInternal && !XTREME_SETTINGS()->show_internal_tab) continue;
|
if(tab == ArchiveTabInternal && !xtreme_settings.show_internal_tab) continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,10 +579,9 @@ void archive_switch_tab(ArchiveBrowserView* browser, InputKey key) {
|
|||||||
bool is_browser = !strcmp(archive_get_tab_ext(tab), "*");
|
bool is_browser = !strcmp(archive_get_tab_ext(tab), "*");
|
||||||
bool skip_assets = !is_browser;
|
bool skip_assets = !is_browser;
|
||||||
// Hide dot files everywhere except Browser if in debug mode
|
// Hide dot files everywhere except Browser if in debug mode
|
||||||
bool hide_dot_files = !is_browser ? true :
|
bool hide_dot_files = !is_browser ? true :
|
||||||
tab == ArchiveTabInternal ?
|
tab == ArchiveTabInternal ? false :
|
||||||
false :
|
!xtreme_settings.show_hidden_files;
|
||||||
!XTREME_SETTINGS()->show_hidden_files;
|
|
||||||
archive_file_browser_set_path(
|
archive_file_browser_set_path(
|
||||||
browser, browser->path, archive_get_tab_ext(tab), skip_assets, hide_dot_files);
|
browser, browser->path, archive_get_tab_ext(tab), skip_assets, hide_dot_files);
|
||||||
tab_empty = false; // Empty check will be performed later
|
tab_empty = false; // Empty check will be performed later
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ static void ArchiveFile_t_clear(ArchiveFile_t* obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int ArchiveFile_t_cmp(const ArchiveFile_t* a, const ArchiveFile_t* b) {
|
static int ArchiveFile_t_cmp(const ArchiveFile_t* a, const ArchiveFile_t* b) {
|
||||||
if(XTREME_SETTINGS()->sort_dirs_first) {
|
if(xtreme_settings.sort_dirs_first) {
|
||||||
if(a->type == ArchiveFileTypeFolder && b->type != ArchiveFileTypeFolder) {
|
if(a->type == ArchiveFileTypeFolder && b->type != ArchiveFileTypeFolder) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ void favorite_timeout_callback(void* _ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void favorite_timeout_run(ViewDispatcher* view_dispatcher, SceneManager* scene_manager) {
|
void favorite_timeout_run(ViewDispatcher* view_dispatcher, SceneManager* scene_manager) {
|
||||||
uint32_t timeout = XTREME_SETTINGS()->favorite_timeout;
|
uint32_t timeout = xtreme_settings.favorite_timeout;
|
||||||
if(timeout == 0) {
|
if(timeout == 0) {
|
||||||
view_dispatcher_run(view_dispatcher);
|
view_dispatcher_run(view_dispatcher);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ BadKbApp* bad_kb_app_alloc(char* arg) {
|
|||||||
Bt* bt = furi_record_open(RECORD_BT);
|
Bt* bt = furi_record_open(RECORD_BT);
|
||||||
app->bt = bt;
|
app->bt = bt;
|
||||||
app->bt->suppress_pin_screen = true;
|
app->bt->suppress_pin_screen = true;
|
||||||
app->is_bt = XTREME_SETTINGS()->bad_bt;
|
app->is_bt = xtreme_settings.bad_bt;
|
||||||
app->bt_remember = XTREME_SETTINGS()->bad_bt_remember;
|
app->bt_remember = xtreme_settings.bad_bt_remember;
|
||||||
bad_kb_config_adjust(&app->config);
|
bad_kb_config_adjust(&app->config);
|
||||||
|
|
||||||
// Save prev config
|
// Save prev config
|
||||||
|
|||||||
@@ -687,11 +687,10 @@ void bad_kb_config_refresh(BadKbApp* app) {
|
|||||||
scene_manager_previous_scene(app->scene_manager);
|
scene_manager_previous_scene(app->scene_manager);
|
||||||
|
|
||||||
// Update settings
|
// Update settings
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
if(xtreme_settings.bad_bt != app->is_bt ||
|
||||||
if(xtreme_settings->bad_bt != app->is_bt ||
|
xtreme_settings.bad_bt_remember != app->bt_remember) {
|
||||||
xtreme_settings->bad_bt_remember != app->bt_remember) {
|
xtreme_settings.bad_bt = app->is_bt;
|
||||||
xtreme_settings->bad_bt = app->is_bt;
|
xtreme_settings.bad_bt_remember = app->bt_remember;
|
||||||
xtreme_settings->bad_bt_remember = app->bt_remember;
|
|
||||||
XTREME_SETTINGS_SAVE();
|
XTREME_SETTINGS_SAVE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ static void bad_kb_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
|
|
||||||
if((state == BadKbStateIdle) || (state == BadKbStateDone) ||
|
if((state == BadKbStateIdle) || (state == BadKbStateDone) ||
|
||||||
(state == BadKbStateNotConnected)) {
|
(state == BadKbStateNotConnected)) {
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
elements_button_center(canvas, "Cum");
|
elements_button_center(canvas, "Cum");
|
||||||
} else {
|
} else {
|
||||||
elements_button_center(canvas, "Run");
|
elements_button_center(canvas, "Run");
|
||||||
@@ -73,7 +73,7 @@ static void bad_kb_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
if(state == BadKbStateNotConnected) {
|
if(state == BadKbStateNotConnected) {
|
||||||
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
|
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Plug me");
|
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Plug me");
|
||||||
canvas_draw_str_aligned(canvas, 127, 43, AlignRight, AlignBottom, "in, Daddy");
|
canvas_draw_str_aligned(canvas, 127, 43, AlignRight, AlignBottom, "in, Daddy");
|
||||||
} else {
|
} else {
|
||||||
@@ -83,7 +83,7 @@ static void bad_kb_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
} else if(state == BadKbStateWillRun) {
|
} else if(state == BadKbStateWillRun) {
|
||||||
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
|
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will cum");
|
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will cum");
|
||||||
} else {
|
} else {
|
||||||
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will run");
|
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will run");
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
#include <xtreme.h>
|
#include <xtreme.h>
|
||||||
#include "minmea.h"
|
#include "minmea.h"
|
||||||
|
|
||||||
#define UART_CH \
|
#define UART_CH \
|
||||||
(XTREME_SETTINGS()->uart_nmea_channel == UARTDefault ? FuriHalUartIdUSART1 : \
|
(xtreme_settings.uart_nmea_channel == UARTDefault ? FuriHalUartIdUSART1 : FuriHalUartIdLPUART1)
|
||||||
FuriHalUartIdLPUART1)
|
|
||||||
|
|
||||||
#define RX_BUF_SIZE 1024
|
#define RX_BUF_SIZE 1024
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ void subghz_scene_transmitter_on_enter(void* context) {
|
|||||||
subghz->fav_timer = furi_timer_alloc(fav_timer_callback, FuriTimerTypeOnce, subghz);
|
subghz->fav_timer = furi_timer_alloc(fav_timer_callback, FuriTimerTypeOnce, subghz);
|
||||||
furi_timer_start(
|
furi_timer_start(
|
||||||
subghz->fav_timer,
|
subghz->fav_timer,
|
||||||
XTREME_SETTINGS()->favorite_timeout * furi_kernel_get_tick_frequency());
|
xtreme_settings.favorite_timeout * furi_kernel_get_tick_frequency());
|
||||||
// subghz->state_notifications = SubGhzNotificationStateTx;
|
// subghz->state_notifications = SubGhzNotificationStateTx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ int32_t subghz_app(char* p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check argument and run corresponding scene
|
// Check argument and run corresponding scene
|
||||||
bool is_favorite = process_favorite_launch(&p) && XTREME_SETTINGS()->favorite_timeout;
|
bool is_favorite = process_favorite_launch(&p) && xtreme_settings.favorite_timeout;
|
||||||
if(p && strlen(p)) {
|
if(p && strlen(p)) {
|
||||||
uint32_t rpc_ctx = 0;
|
uint32_t rpc_ctx = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
|
|
||||||
if(model->display_msg == U2fMsgNotConnected) {
|
if(model->display_msg == U2fMsgNotConnected) {
|
||||||
canvas_draw_icon(canvas, 22, 15, &I_Connect_me_62x31);
|
canvas_draw_icon(canvas, 22, 15, &I_Connect_me_62x31);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
canvas, 128 / 2, 3, AlignCenter, AlignTop, "Plug me in d-daddy");
|
canvas, 128 / 2, 3, AlignCenter, AlignTop, "Plug me in d-daddy");
|
||||||
} else {
|
} else {
|
||||||
@@ -32,7 +32,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
canvas_draw_icon(canvas, 22, 15, &I_Connected_62x31);
|
canvas_draw_icon(canvas, 22, 15, &I_Connected_62x31);
|
||||||
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Connected!");
|
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Connected!");
|
||||||
} else if(model->display_msg == U2fMsgRegister) {
|
} else if(model->display_msg == U2fMsgRegister) {
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
elements_button_center(canvas, "CUM");
|
elements_button_center(canvas, "CUM");
|
||||||
canvas_draw_icon(canvas, 22, 15, &I_Auth_62x31);
|
canvas_draw_icon(canvas, 22, 15, &I_Auth_62x31);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
@@ -44,7 +44,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
canvas, 128 / 2, 3, AlignCenter, AlignTop, "Press OK to register");
|
canvas, 128 / 2, 3, AlignCenter, AlignTop, "Press OK to register");
|
||||||
}
|
}
|
||||||
} else if(model->display_msg == U2fMsgAuth) {
|
} else if(model->display_msg == U2fMsgAuth) {
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
elements_button_center(canvas, "CUM");
|
elements_button_center(canvas, "CUM");
|
||||||
canvas_draw_icon(canvas, 22, 15, &I_Auth_62x31);
|
canvas_draw_icon(canvas, 22, 15, &I_Auth_62x31);
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
@@ -57,7 +57,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
}
|
}
|
||||||
} else if(model->display_msg == U2fMsgSuccess) {
|
} else if(model->display_msg == U2fMsgSuccess) {
|
||||||
canvas_draw_icon(canvas, 22, 15, &I_Connected_62x31);
|
canvas_draw_icon(canvas, 22, 15, &I_Connected_62x31);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Cum released~");
|
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Cum released~");
|
||||||
} else {
|
} else {
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
@@ -65,7 +65,7 @@ static void u2f_view_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
}
|
}
|
||||||
} else if(model->display_msg == U2fMsgError) {
|
} else if(model->display_msg == U2fMsgError) {
|
||||||
canvas_draw_icon(canvas, 22, 15, &I_Error_62x31);
|
canvas_draw_icon(canvas, 22, 15, &I_Error_62x31);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Unable to cum");
|
canvas_draw_str_aligned(canvas, 128 / 2, 3, AlignCenter, AlignTop, "Unable to cum");
|
||||||
} else {
|
} else {
|
||||||
canvas_draw_str_aligned(
|
canvas_draw_str_aligned(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ static void xtreme_app_scene_interface_filebrowser_sort_dirs_first_changed(Varia
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->sort_dirs_first = value;
|
xtreme_settings.sort_dirs_first = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ static void xtreme_app_scene_interface_filebrowser_show_hidden_files_changed(Var
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->show_hidden_files = value;
|
xtreme_settings.show_hidden_files = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ static void xtreme_app_scene_interface_filebrowser_show_internal_tab_changed(Var
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->show_internal_tab = value;
|
xtreme_settings.show_internal_tab = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,13 +42,12 @@ static void xtreme_app_scene_interface_filebrowser_favorite_timeout_changed(Vari
|
|||||||
char text[6];
|
char text[6];
|
||||||
snprintf(text, sizeof(text), "%lu S", value);
|
snprintf(text, sizeof(text), "%lu S", value);
|
||||||
variable_item_set_current_value_text(item, value ? text : "OFF");
|
variable_item_set_current_value_text(item, value ? text : "OFF");
|
||||||
XTREME_SETTINGS()->favorite_timeout = value;
|
xtreme_settings.favorite_timeout = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_interface_filebrowser_on_enter(void* context) {
|
void xtreme_app_scene_interface_filebrowser_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
|
|
||||||
@@ -58,8 +57,8 @@ void xtreme_app_scene_interface_filebrowser_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_filebrowser_sort_dirs_first_changed,
|
xtreme_app_scene_interface_filebrowser_sort_dirs_first_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->sort_dirs_first);
|
variable_item_set_current_value_index(item, xtreme_settings.sort_dirs_first);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->sort_dirs_first ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.sort_dirs_first ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -67,8 +66,8 @@ void xtreme_app_scene_interface_filebrowser_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_filebrowser_show_hidden_files_changed,
|
xtreme_app_scene_interface_filebrowser_show_hidden_files_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->show_hidden_files);
|
variable_item_set_current_value_index(item, xtreme_settings.show_hidden_files);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->show_hidden_files ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.show_hidden_files ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -76,8 +75,8 @@ void xtreme_app_scene_interface_filebrowser_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_filebrowser_show_internal_tab_changed,
|
xtreme_app_scene_interface_filebrowser_show_internal_tab_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->show_internal_tab);
|
variable_item_set_current_value_index(item, xtreme_settings.show_internal_tab);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->show_internal_tab ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.show_internal_tab ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -85,10 +84,10 @@ void xtreme_app_scene_interface_filebrowser_on_enter(void* context) {
|
|||||||
61,
|
61,
|
||||||
xtreme_app_scene_interface_filebrowser_favorite_timeout_changed,
|
xtreme_app_scene_interface_filebrowser_favorite_timeout_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->favorite_timeout);
|
variable_item_set_current_value_index(item, xtreme_settings.favorite_timeout);
|
||||||
char text[4];
|
char text[4];
|
||||||
snprintf(text, sizeof(text), "%lu S", xtreme_settings->favorite_timeout);
|
snprintf(text, sizeof(text), "%lu S", xtreme_settings.favorite_timeout);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->favorite_timeout ? text : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.favorite_timeout ? text : "OFF");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_interface_filebrowser_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_interface_filebrowser_var_item_list_callback, app);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ static void xtreme_app_scene_interface_graphics_asset_pack_changed(VariableItem*
|
|||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, index == 0 ? "Default" : *CharList_get(app->asset_pack_names, index - 1));
|
item, index == 0 ? "Default" : *CharList_get(app->asset_pack_names, index - 1));
|
||||||
strlcpy(
|
strlcpy(
|
||||||
XTREME_SETTINGS()->asset_pack,
|
xtreme_settings.asset_pack,
|
||||||
index == 0 ? "" : *CharList_get(app->asset_pack_names, index - 1),
|
index == 0 ? "" : *CharList_get(app->asset_pack_names, index - 1),
|
||||||
XTREME_ASSETS_PACK_NAME_LEN);
|
XTREME_ASSETS_PACK_NAME_LEN);
|
||||||
app->asset_pack_index = index;
|
app->asset_pack_index = index;
|
||||||
@@ -59,7 +59,7 @@ static void xtreme_app_scene_interface_graphics_anim_speed_changed(VariableItem*
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
uint8_t index = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, anim_speed_names[index]);
|
variable_item_set_current_value_text(item, anim_speed_names[index]);
|
||||||
XTREME_SETTINGS()->anim_speed = anim_speed_values[index];
|
xtreme_settings.anim_speed = anim_speed_values[index];
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ static void xtreme_app_scene_interface_graphics_cycle_anims_changed(VariableItem
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
uint8_t index = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, cycle_anims_names[index]);
|
variable_item_set_current_value_text(item, cycle_anims_names[index]);
|
||||||
XTREME_SETTINGS()->cycle_anims = cycle_anims_values[index];
|
xtreme_settings.cycle_anims = cycle_anims_values[index];
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ static void xtreme_app_scene_interface_graphics_unlock_anims_changed(VariableIte
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->unlock_anims = value;
|
xtreme_settings.unlock_anims = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,13 +113,12 @@ static void xtreme_app_scene_interface_graphics_fallback_anim_changed(VariableIt
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->fallback_anim = value;
|
xtreme_settings.fallback_anim = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_interface_graphics_on_enter(void* context) {
|
void xtreme_app_scene_interface_graphics_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
uint8_t value_index;
|
uint8_t value_index;
|
||||||
@@ -144,7 +143,7 @@ void xtreme_app_scene_interface_graphics_on_enter(void* context) {
|
|||||||
xtreme_app_scene_interface_graphics_anim_speed_changed,
|
xtreme_app_scene_interface_graphics_anim_speed_changed,
|
||||||
app);
|
app);
|
||||||
value_index = value_index_uint32(
|
value_index = value_index_uint32(
|
||||||
xtreme_settings->anim_speed, anim_speed_values, COUNT_OF(anim_speed_values));
|
xtreme_settings.anim_speed, anim_speed_values, COUNT_OF(anim_speed_values));
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
variable_item_set_current_value_text(item, anim_speed_names[value_index]);
|
variable_item_set_current_value_text(item, anim_speed_names[value_index]);
|
||||||
|
|
||||||
@@ -155,7 +154,7 @@ void xtreme_app_scene_interface_graphics_on_enter(void* context) {
|
|||||||
xtreme_app_scene_interface_graphics_cycle_anims_changed,
|
xtreme_app_scene_interface_graphics_cycle_anims_changed,
|
||||||
app);
|
app);
|
||||||
value_index = value_index_int32(
|
value_index = value_index_int32(
|
||||||
xtreme_settings->cycle_anims, cycle_anims_values, COUNT_OF(cycle_anims_values));
|
xtreme_settings.cycle_anims, cycle_anims_values, COUNT_OF(cycle_anims_values));
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
variable_item_set_current_value_text(item, cycle_anims_names[value_index]);
|
variable_item_set_current_value_text(item, cycle_anims_names[value_index]);
|
||||||
|
|
||||||
@@ -165,8 +164,8 @@ void xtreme_app_scene_interface_graphics_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_graphics_unlock_anims_changed,
|
xtreme_app_scene_interface_graphics_unlock_anims_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->unlock_anims);
|
variable_item_set_current_value_index(item, xtreme_settings.unlock_anims);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->unlock_anims ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.unlock_anims ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -174,8 +173,8 @@ void xtreme_app_scene_interface_graphics_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_graphics_fallback_anim_changed,
|
xtreme_app_scene_interface_graphics_fallback_anim_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->fallback_anim);
|
variable_item_set_current_value_index(item, xtreme_settings.fallback_anim);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->fallback_anim ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.fallback_anim ? "ON" : "OFF");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_interface_graphics_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_interface_graphics_var_item_list_callback, app);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ static void xtreme_app_scene_interface_lockscreen_lock_on_boot_changed(VariableI
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lock_on_boot = value;
|
xtreme_settings.lock_on_boot = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ static void xtreme_app_scene_interface_lockscreen_bad_pins_format_changed(Variab
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->bad_pins_format = value;
|
xtreme_settings.bad_pins_format = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ static void
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->allow_locked_rpc_commands = value;
|
xtreme_settings.allow_locked_rpc_commands = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ static void xtreme_app_scene_interface_lockscreen_lockscreen_time_changed(Variab
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lockscreen_time = value;
|
xtreme_settings.lockscreen_time = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ static void xtreme_app_scene_interface_lockscreen_lockscreen_seconds_changed(Var
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lockscreen_seconds = value;
|
xtreme_settings.lockscreen_seconds = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ static void xtreme_app_scene_interface_lockscreen_lockscreen_date_changed(Variab
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lockscreen_date = value;
|
xtreme_settings.lockscreen_date = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ static void
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lockscreen_statusbar = value;
|
xtreme_settings.lockscreen_statusbar = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ static void xtreme_app_scene_interface_lockscreen_lockscreen_prompt_changed(Vari
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lockscreen_prompt = value;
|
xtreme_settings.lockscreen_prompt = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,13 +87,12 @@ static void
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->lockscreen_transparent = value;
|
xtreme_settings.lockscreen_transparent = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
|
|
||||||
@@ -103,8 +102,8 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lock_on_boot_changed,
|
xtreme_app_scene_interface_lockscreen_lock_on_boot_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lock_on_boot);
|
variable_item_set_current_value_index(item, xtreme_settings.lock_on_boot);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->lock_on_boot ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.lock_on_boot ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -112,8 +111,8 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_bad_pins_format_changed,
|
xtreme_app_scene_interface_lockscreen_bad_pins_format_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->bad_pins_format);
|
variable_item_set_current_value_index(item, xtreme_settings.bad_pins_format);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->bad_pins_format ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.bad_pins_format ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -121,9 +120,9 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_allow_locked_rpc_commands_changed,
|
xtreme_app_scene_interface_lockscreen_allow_locked_rpc_commands_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->allow_locked_rpc_commands);
|
variable_item_set_current_value_index(item, xtreme_settings.allow_locked_rpc_commands);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->allow_locked_rpc_commands ? "ON" : "OFF");
|
item, xtreme_settings.allow_locked_rpc_commands ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -131,8 +130,8 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lockscreen_time_changed,
|
xtreme_app_scene_interface_lockscreen_lockscreen_time_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lockscreen_time);
|
variable_item_set_current_value_index(item, xtreme_settings.lockscreen_time);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->lockscreen_time ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.lockscreen_time ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -140,8 +139,8 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lockscreen_seconds_changed,
|
xtreme_app_scene_interface_lockscreen_lockscreen_seconds_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lockscreen_seconds);
|
variable_item_set_current_value_index(item, xtreme_settings.lockscreen_seconds);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->lockscreen_seconds ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.lockscreen_seconds ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -149,8 +148,8 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lockscreen_date_changed,
|
xtreme_app_scene_interface_lockscreen_lockscreen_date_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lockscreen_date);
|
variable_item_set_current_value_index(item, xtreme_settings.lockscreen_date);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->lockscreen_date ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.lockscreen_date ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -158,9 +157,9 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lockscreen_statusbar_changed,
|
xtreme_app_scene_interface_lockscreen_lockscreen_statusbar_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lockscreen_statusbar);
|
variable_item_set_current_value_index(item, xtreme_settings.lockscreen_statusbar);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->lockscreen_statusbar ? "ON" : "OFF");
|
item, xtreme_settings.lockscreen_statusbar ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -168,8 +167,8 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lockscreen_prompt_changed,
|
xtreme_app_scene_interface_lockscreen_lockscreen_prompt_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lockscreen_prompt);
|
variable_item_set_current_value_index(item, xtreme_settings.lockscreen_prompt);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->lockscreen_prompt ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.lockscreen_prompt ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -177,9 +176,9 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_lockscreen_lockscreen_transparent_changed,
|
xtreme_app_scene_interface_lockscreen_lockscreen_transparent_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->lockscreen_transparent);
|
variable_item_set_current_value_index(item, xtreme_settings.lockscreen_transparent);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->lockscreen_transparent ? "ON" : "OFF");
|
item, xtreme_settings.lockscreen_transparent ? "ON" : "OFF");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_interface_lockscreen_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_interface_lockscreen_var_item_list_callback, app);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ static void xtreme_app_scene_interface_mainmenu_menu_style_changed(VariableItem*
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
uint8_t index = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, menu_style_names[index]);
|
variable_item_set_current_value_text(item, menu_style_names[index]);
|
||||||
XTREME_SETTINGS()->menu_style = index;
|
xtreme_settings.menu_style = index;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +68,6 @@ static void xtreme_app_scene_interface_mainmenu_move_app_changed(VariableItem* i
|
|||||||
|
|
||||||
void xtreme_app_scene_interface_mainmenu_on_enter(void* context) {
|
void xtreme_app_scene_interface_mainmenu_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
|
|
||||||
@@ -78,8 +77,8 @@ void xtreme_app_scene_interface_mainmenu_on_enter(void* context) {
|
|||||||
MenuStyleCount,
|
MenuStyleCount,
|
||||||
xtreme_app_scene_interface_mainmenu_menu_style_changed,
|
xtreme_app_scene_interface_mainmenu_menu_style_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->menu_style);
|
variable_item_set_current_value_index(item, xtreme_settings.menu_style);
|
||||||
variable_item_set_current_value_text(item, menu_style_names[xtreme_settings->menu_style]);
|
variable_item_set_current_value_text(item, menu_style_names[xtreme_settings.menu_style]);
|
||||||
|
|
||||||
variable_item_list_add(var_item_list, "Reset Menu", 0, NULL, app);
|
variable_item_list_add(var_item_list, "Reset Menu", 0, NULL, app);
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ static void xtreme_app_scene_interface_statusbar_battery_icon_changed(VariableIt
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
uint8_t index = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, battery_icon_names[index]);
|
variable_item_set_current_value_text(item, battery_icon_names[index]);
|
||||||
XTREME_SETTINGS()->battery_icon = index;
|
xtreme_settings.battery_icon = index;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
power_set_battery_icon_enabled(furi_record_open(RECORD_POWER), index != BatteryIconOff);
|
power_set_battery_icon_enabled(furi_record_open(RECORD_POWER), index != BatteryIconOff);
|
||||||
furi_record_close(RECORD_POWER);
|
furi_record_close(RECORD_POWER);
|
||||||
@@ -36,7 +36,7 @@ static void xtreme_app_scene_interface_statusbar_statusbar_clock_changed(Variabl
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->statusbar_clock = value;
|
xtreme_settings.statusbar_clock = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ static void xtreme_app_scene_interface_statusbar_status_icons_changed(VariableIt
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->status_icons = value;
|
xtreme_settings.status_icons = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ static void xtreme_app_scene_interface_statusbar_bar_borders_changed(VariableIte
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->bar_borders = value;
|
xtreme_settings.bar_borders = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,13 +60,12 @@ static void xtreme_app_scene_interface_statusbar_bar_background_changed(Variable
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->bar_background = value;
|
xtreme_settings.bar_background = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
|
|
||||||
@@ -76,8 +75,8 @@ void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
|||||||
BatteryIconCount,
|
BatteryIconCount,
|
||||||
xtreme_app_scene_interface_statusbar_battery_icon_changed,
|
xtreme_app_scene_interface_statusbar_battery_icon_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->battery_icon);
|
variable_item_set_current_value_index(item, xtreme_settings.battery_icon);
|
||||||
variable_item_set_current_value_text(item, battery_icon_names[xtreme_settings->battery_icon]);
|
variable_item_set_current_value_text(item, battery_icon_names[xtreme_settings.battery_icon]);
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -85,8 +84,8 @@ void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_statusbar_statusbar_clock_changed,
|
xtreme_app_scene_interface_statusbar_statusbar_clock_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->statusbar_clock);
|
variable_item_set_current_value_index(item, xtreme_settings.statusbar_clock);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->statusbar_clock ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.statusbar_clock ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -94,8 +93,8 @@ void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_statusbar_status_icons_changed,
|
xtreme_app_scene_interface_statusbar_status_icons_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->status_icons);
|
variable_item_set_current_value_index(item, xtreme_settings.status_icons);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->status_icons ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.status_icons ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -103,8 +102,8 @@ void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_statusbar_bar_borders_changed,
|
xtreme_app_scene_interface_statusbar_bar_borders_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->bar_borders);
|
variable_item_set_current_value_index(item, xtreme_settings.bar_borders);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->bar_borders ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.bar_borders ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -112,8 +111,8 @@ void xtreme_app_scene_interface_statusbar_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_interface_statusbar_bar_background_changed,
|
xtreme_app_scene_interface_statusbar_bar_background_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->bar_background);
|
variable_item_set_current_value_index(item, xtreme_settings.bar_background);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->bar_background ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.bar_background ? "ON" : "OFF");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_interface_statusbar_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_interface_statusbar_var_item_list_callback, app);
|
||||||
|
|||||||
@@ -20,13 +20,12 @@ static void xtreme_app_scene_misc_charge_cap_changed(VariableItem* item) {
|
|||||||
uint32_t value = (variable_item_get_current_value_index(item) + 1) * CHARGE_CAP_INTV;
|
uint32_t value = (variable_item_get_current_value_index(item) + 1) * CHARGE_CAP_INTV;
|
||||||
snprintf(cap_str, 6, "%lu%%", value);
|
snprintf(cap_str, 6, "%lu%%", value);
|
||||||
variable_item_set_current_value_text(item, cap_str);
|
variable_item_set_current_value_text(item, cap_str);
|
||||||
XTREME_SETTINGS()->charge_cap = value;
|
xtreme_settings.charge_cap = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_misc_on_enter(void* context) {
|
void xtreme_app_scene_misc_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
uint8_t value_index;
|
uint8_t value_index;
|
||||||
@@ -40,7 +39,7 @@ void xtreme_app_scene_misc_on_enter(void* context) {
|
|||||||
variable_item_list_add(var_item_list, "Change Device Name", 0, NULL, app);
|
variable_item_list_add(var_item_list, "Change Device Name", 0, NULL, app);
|
||||||
|
|
||||||
char cap_str[6];
|
char cap_str[6];
|
||||||
value_index = xtreme_settings->charge_cap / CHARGE_CAP_INTV;
|
value_index = xtreme_settings.charge_cap / CHARGE_CAP_INTV;
|
||||||
snprintf(cap_str, 6, "%lu%%", (uint32_t)value_index * CHARGE_CAP_INTV);
|
snprintf(cap_str, 6, "%lu%%", (uint32_t)value_index * CHARGE_CAP_INTV);
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
|
|||||||
@@ -57,14 +57,13 @@ static void xtreme_app_scene_misc_dolphin_butthurt_timer_changed(VariableItem* i
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
uint8_t index = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, butthurt_timer_names[index]);
|
variable_item_set_current_value_text(item, butthurt_timer_names[index]);
|
||||||
XTREME_SETTINGS()->butthurt_timer = butthurt_timer_values[index];
|
xtreme_settings.butthurt_timer = butthurt_timer_values[index];
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
app->require_reboot = true;
|
app->require_reboot = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_misc_dolphin_on_enter(void* context) {
|
void xtreme_app_scene_misc_dolphin_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
uint8_t value_index;
|
uint8_t value_index;
|
||||||
@@ -98,7 +97,7 @@ void xtreme_app_scene_misc_dolphin_on_enter(void* context) {
|
|||||||
xtreme_app_scene_misc_dolphin_butthurt_timer_changed,
|
xtreme_app_scene_misc_dolphin_butthurt_timer_changed,
|
||||||
app);
|
app);
|
||||||
value_index = value_index_uint32(
|
value_index = value_index_uint32(
|
||||||
xtreme_settings->butthurt_timer, butthurt_timer_values, COUNT_OF(butthurt_timer_values));
|
xtreme_settings.butthurt_timer, butthurt_timer_values, COUNT_OF(butthurt_timer_values));
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
variable_item_set_current_value_text(item, butthurt_timer_names[value_index]);
|
variable_item_set_current_value_text(item, butthurt_timer_names[value_index]);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ static void xtreme_app_scene_misc_screen_dark_mode_changed(VariableItem* item) {
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->dark_mode = value;
|
xtreme_settings.dark_mode = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,15 +140,14 @@ static void xtreme_app_scene_misc_screen_rainbow_saturation_changed(VariableItem
|
|||||||
|
|
||||||
void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
uint8_t value_index;
|
uint8_t value_index;
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list, "Dark Mode", 2, xtreme_app_scene_misc_screen_dark_mode_changed, app);
|
var_item_list, "Dark Mode", 2, xtreme_app_scene_misc_screen_dark_mode_changed, app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->dark_mode);
|
variable_item_set_current_value_index(item, xtreme_settings.dark_mode);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->dark_mode ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.dark_mode ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list, "Left Handed", 2, xtreme_app_scene_misc_screen_hand_orient_changed, app);
|
var_item_list, "Left Handed", 2, xtreme_app_scene_misc_screen_hand_orient_changed, app);
|
||||||
@@ -157,7 +156,7 @@ void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
|||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(var_item_list, "RGB Backlight", 1, NULL, app);
|
item = variable_item_list_add(var_item_list, "RGB Backlight", 1, NULL, app);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->rgb_backlight ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.rgb_backlight ? "ON" : "OFF");
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint8_t led;
|
uint8_t led;
|
||||||
@@ -190,7 +189,7 @@ void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
|||||||
snprintf(str, sizeof(str), "%02X%02X%02X", color.r, color.g, color.b);
|
snprintf(str, sizeof(str), "%02X%02X%02X", color.r, color.g, color.b);
|
||||||
variable_item_set_current_value_text(item, str);
|
variable_item_set_current_value_text(item, str);
|
||||||
}
|
}
|
||||||
variable_item_set_locked(item, !xtreme_settings->rgb_backlight, "Needs RGB\nBacklight!");
|
variable_item_set_locked(item, !xtreme_settings.rgb_backlight, "Needs RGB\nBacklight!");
|
||||||
}
|
}
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
@@ -202,7 +201,7 @@ void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
|||||||
value_index = rgb_backlight_get_rainbow_mode();
|
value_index = rgb_backlight_get_rainbow_mode();
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
variable_item_set_current_value_text(item, rainbow_lcd_names[value_index]);
|
variable_item_set_current_value_text(item, rainbow_lcd_names[value_index]);
|
||||||
variable_item_set_locked(item, !xtreme_settings->rgb_backlight, "Needs RGB\nBacklight!");
|
variable_item_set_locked(item, !xtreme_settings.rgb_backlight, "Needs RGB\nBacklight!");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -215,7 +214,7 @@ void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
|||||||
char speed_str[4];
|
char speed_str[4];
|
||||||
snprintf(speed_str, sizeof(speed_str), "%d", value_index);
|
snprintf(speed_str, sizeof(speed_str), "%d", value_index);
|
||||||
variable_item_set_current_value_text(item, speed_str);
|
variable_item_set_current_value_text(item, speed_str);
|
||||||
variable_item_set_locked(item, !xtreme_settings->rgb_backlight, "Needs RGB\nBacklight!");
|
variable_item_set_locked(item, !xtreme_settings.rgb_backlight, "Needs RGB\nBacklight!");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -229,7 +228,7 @@ void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
|||||||
COUNT_OF(rainbow_interval_values));
|
COUNT_OF(rainbow_interval_values));
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
variable_item_set_current_value_text(item, rainbow_interval_names[value_index]);
|
variable_item_set_current_value_text(item, rainbow_interval_names[value_index]);
|
||||||
variable_item_set_locked(item, !xtreme_settings->rgb_backlight, "Needs RGB\nBacklight!");
|
variable_item_set_locked(item, !xtreme_settings.rgb_backlight, "Needs RGB\nBacklight!");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -242,7 +241,7 @@ void xtreme_app_scene_misc_screen_on_enter(void* context) {
|
|||||||
char saturation_str[4];
|
char saturation_str[4];
|
||||||
snprintf(saturation_str, sizeof(saturation_str), "%d", value_index);
|
snprintf(saturation_str, sizeof(saturation_str), "%d", value_index);
|
||||||
variable_item_set_current_value_text(item, saturation_str);
|
variable_item_set_current_value_text(item, saturation_str);
|
||||||
variable_item_set_locked(item, !xtreme_settings->rgb_backlight, "Needs RGB\nBacklight!");
|
variable_item_set_locked(item, !xtreme_settings.rgb_backlight, "Needs RGB\nBacklight!");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_misc_screen_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_misc_screen_var_item_list_callback, app);
|
||||||
@@ -263,7 +262,7 @@ bool xtreme_app_scene_misc_screen_on_event(void* context, SceneManagerEvent even
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
switch(event.event) {
|
switch(event.event) {
|
||||||
case VarItemListIndexRgbBacklight: {
|
case VarItemListIndexRgbBacklight: {
|
||||||
bool change = XTREME_SETTINGS()->rgb_backlight;
|
bool change = xtreme_settings.rgb_backlight;
|
||||||
if(!change) {
|
if(!change) {
|
||||||
DialogMessage* msg = dialog_message_alloc();
|
DialogMessage* msg = dialog_message_alloc();
|
||||||
dialog_message_set_header(msg, "RGB Backlight", 64, 0, AlignCenter, AlignTop);
|
dialog_message_set_header(msg, "RGB Backlight", 64, 0, AlignCenter, AlignTop);
|
||||||
@@ -281,11 +280,11 @@ bool xtreme_app_scene_misc_screen_on_event(void* context, SceneManagerEvent even
|
|||||||
dialog_message_free(msg);
|
dialog_message_free(msg);
|
||||||
}
|
}
|
||||||
if(change) {
|
if(change) {
|
||||||
XTREME_SETTINGS()->rgb_backlight = !XTREME_SETTINGS()->rgb_backlight;
|
xtreme_settings.rgb_backlight = !xtreme_settings.rgb_backlight;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
app->save_backlight = true;
|
app->save_backlight = true;
|
||||||
notification_message(app->notification, &sequence_display_backlight_on);
|
notification_message(app->notification, &sequence_display_backlight_on);
|
||||||
rgb_backlight_reconfigure(XTREME_SETTINGS()->rgb_backlight);
|
rgb_backlight_reconfigure(xtreme_settings.rgb_backlight);
|
||||||
scene_manager_previous_scene(app->scene_manager);
|
scene_manager_previous_scene(app->scene_manager);
|
||||||
scene_manager_next_scene(app->scene_manager, XtremeAppSceneMiscScreen);
|
scene_manager_next_scene(app->scene_manager, XtremeAppSceneMiscScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ static void xtreme_app_scene_protocols_bad_bt_changed(VariableItem* item) {
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "BT" : "USB");
|
variable_item_set_current_value_text(item, value ? "BT" : "USB");
|
||||||
XTREME_SETTINGS()->bad_bt = value;
|
xtreme_settings.bad_bt = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ static void xtreme_app_scene_protocols_bad_bt_remember_changed(VariableItem* ite
|
|||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
bool value = variable_item_get_current_value_index(item);
|
bool value = variable_item_get_current_value_index(item);
|
||||||
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
|
||||||
XTREME_SETTINGS()->bad_bt_remember = value;
|
xtreme_settings.bad_bt_remember = value;
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,14 +38,13 @@ static void xtreme_app_scene_protocols_subghz_extend_changed(VariableItem* item)
|
|||||||
|
|
||||||
void xtreme_app_scene_protocols_on_enter(void* context) {
|
void xtreme_app_scene_protocols_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list, "BadKB Mode", 2, xtreme_app_scene_protocols_bad_bt_changed, app);
|
var_item_list, "BadKB Mode", 2, xtreme_app_scene_protocols_bad_bt_changed, app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->bad_bt);
|
variable_item_set_current_value_index(item, xtreme_settings.bad_bt);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->bad_bt ? "BT" : "USB");
|
variable_item_set_current_value_text(item, xtreme_settings.bad_bt ? "BT" : "USB");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -53,8 +52,8 @@ void xtreme_app_scene_protocols_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_protocols_bad_bt_remember_changed,
|
xtreme_app_scene_protocols_bad_bt_remember_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->bad_bt_remember);
|
variable_item_set_current_value_index(item, xtreme_settings.bad_bt_remember);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->bad_bt_remember ? "ON" : "OFF");
|
variable_item_set_current_value_text(item, xtreme_settings.bad_bt_remember ? "ON" : "OFF");
|
||||||
|
|
||||||
item = variable_item_list_add(var_item_list, "SubGHz Freqs", 0, NULL, app);
|
item = variable_item_list_add(var_item_list, "SubGHz Freqs", 0, NULL, app);
|
||||||
variable_item_set_current_value_text(item, ">");
|
variable_item_set_current_value_text(item, ">");
|
||||||
|
|||||||
@@ -15,52 +15,51 @@ void xtreme_app_scene_protocols_gpio_var_item_list_callback(void* context, uint3
|
|||||||
|
|
||||||
static void xtreme_app_scene_protocols_gpio_cc1101_handle_changed(VariableItem* item) {
|
static void xtreme_app_scene_protocols_gpio_cc1101_handle_changed(VariableItem* item) {
|
||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
XTREME_SETTINGS()->spi_cc1101_handle =
|
xtreme_settings.spi_cc1101_handle =
|
||||||
variable_item_get_current_value_index(item) == 0 ? SpiDefault : SpiExtra;
|
variable_item_get_current_value_index(item) == 0 ? SpiDefault : SpiExtra;
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, XTREME_SETTINGS()->spi_cc1101_handle == SpiDefault ? "Default" : "Extra");
|
item, xtreme_settings.spi_cc1101_handle == SpiDefault ? "Default" : "Extra");
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xtreme_app_scene_protocols_gpio_nrf24_handle_changed(VariableItem* item) {
|
static void xtreme_app_scene_protocols_gpio_nrf24_handle_changed(VariableItem* item) {
|
||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
XTREME_SETTINGS()->spi_nrf24_handle =
|
xtreme_settings.spi_nrf24_handle =
|
||||||
variable_item_get_current_value_index(item) == 0 ? SpiDefault : SpiExtra;
|
variable_item_get_current_value_index(item) == 0 ? SpiDefault : SpiExtra;
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, XTREME_SETTINGS()->spi_nrf24_handle == SpiDefault ? "Default" : "Extra");
|
item, xtreme_settings.spi_nrf24_handle == SpiDefault ? "Default" : "Extra");
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xtreme_app_scene_protocols_gpio_esp32_channel_changed(VariableItem* item) {
|
static void xtreme_app_scene_protocols_gpio_esp32_channel_changed(VariableItem* item) {
|
||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
XTREME_SETTINGS()->uart_esp_channel =
|
xtreme_settings.uart_esp_channel =
|
||||||
variable_item_get_current_value_index(item) == 0 ? UARTDefault : UARTExtra;
|
variable_item_get_current_value_index(item) == 0 ? UARTDefault : UARTExtra;
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, XTREME_SETTINGS()->uart_esp_channel == UARTDefault ? "13,14" : "15,16");
|
item, xtreme_settings.uart_esp_channel == UARTDefault ? "13,14" : "15,16");
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xtreme_app_scene_protocols_gpio_nmea_channel_changed(VariableItem* item) {
|
static void xtreme_app_scene_protocols_gpio_nmea_channel_changed(VariableItem* item) {
|
||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
XTREME_SETTINGS()->uart_nmea_channel =
|
xtreme_settings.uart_nmea_channel =
|
||||||
variable_item_get_current_value_index(item) == 0 ? UARTDefault : UARTExtra;
|
variable_item_get_current_value_index(item) == 0 ? UARTDefault : UARTExtra;
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, XTREME_SETTINGS()->uart_nmea_channel == UARTDefault ? "13,14" : "15,16");
|
item, xtreme_settings.uart_nmea_channel == UARTDefault ? "13,14" : "15,16");
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xtreme_app_scene_protocols_gpio_general_channel_changed(VariableItem* item) {
|
static void xtreme_app_scene_protocols_gpio_general_channel_changed(VariableItem* item) {
|
||||||
XtremeApp* app = variable_item_get_context(item);
|
XtremeApp* app = variable_item_get_context(item);
|
||||||
XTREME_SETTINGS()->uart_general_channel =
|
xtreme_settings.uart_general_channel =
|
||||||
variable_item_get_current_value_index(item) == 0 ? UARTDefault : UARTExtra;
|
variable_item_get_current_value_index(item) == 0 ? UARTDefault : UARTExtra;
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, XTREME_SETTINGS()->uart_general_channel == UARTDefault ? "13,14" : "15,16");
|
item, xtreme_settings.uart_general_channel == UARTDefault ? "13,14" : "15,16");
|
||||||
app->save_settings = true;
|
app->save_settings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
VariableItemList* var_item_list = app->var_item_list;
|
VariableItemList* var_item_list = app->var_item_list;
|
||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
|
|
||||||
@@ -70,9 +69,9 @@ void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_protocols_gpio_cc1101_handle_changed,
|
xtreme_app_scene_protocols_gpio_cc1101_handle_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->spi_cc1101_handle);
|
variable_item_set_current_value_index(item, xtreme_settings.spi_cc1101_handle);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->spi_cc1101_handle == SpiDefault ? "Default" : "Extra");
|
item, xtreme_settings.spi_cc1101_handle == SpiDefault ? "Default" : "Extra");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -80,9 +79,9 @@ void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_protocols_gpio_nrf24_handle_changed,
|
xtreme_app_scene_protocols_gpio_nrf24_handle_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->spi_nrf24_handle);
|
variable_item_set_current_value_index(item, xtreme_settings.spi_nrf24_handle);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->spi_nrf24_handle == SpiDefault ? "Default" : "Extra");
|
item, xtreme_settings.spi_nrf24_handle == SpiDefault ? "Default" : "Extra");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -90,9 +89,9 @@ void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_protocols_gpio_esp32_channel_changed,
|
xtreme_app_scene_protocols_gpio_esp32_channel_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->uart_esp_channel);
|
variable_item_set_current_value_index(item, xtreme_settings.uart_esp_channel);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->uart_esp_channel == UARTDefault ? "13,14" : "15,16");
|
item, xtreme_settings.uart_esp_channel == UARTDefault ? "13,14" : "15,16");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -100,9 +99,9 @@ void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_protocols_gpio_nmea_channel_changed,
|
xtreme_app_scene_protocols_gpio_nmea_channel_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->uart_nmea_channel);
|
variable_item_set_current_value_index(item, xtreme_settings.uart_nmea_channel);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->uart_nmea_channel == UARTDefault ? "13,14" : "15,16");
|
item, xtreme_settings.uart_nmea_channel == UARTDefault ? "13,14" : "15,16");
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
var_item_list,
|
var_item_list,
|
||||||
@@ -110,9 +109,9 @@ void xtreme_app_scene_protocols_gpio_on_enter(void* context) {
|
|||||||
2,
|
2,
|
||||||
xtreme_app_scene_protocols_gpio_general_channel_changed,
|
xtreme_app_scene_protocols_gpio_general_channel_changed,
|
||||||
app);
|
app);
|
||||||
variable_item_set_current_value_index(item, xtreme_settings->uart_general_channel);
|
variable_item_set_current_value_index(item, xtreme_settings.uart_general_channel);
|
||||||
variable_item_set_current_value_text(
|
variable_item_set_current_value_text(
|
||||||
item, xtreme_settings->uart_general_channel == UARTDefault ? "13,14" : "15,16");
|
item, xtreme_settings.uart_general_channel == UARTDefault ? "13,14" : "15,16");
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_protocols_gpio_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_protocols_gpio_var_item_list_callback, app);
|
||||||
|
|||||||
@@ -206,8 +206,6 @@ XtremeApp* xtreme_app_alloc() {
|
|||||||
|
|
||||||
// Settings init
|
// Settings init
|
||||||
|
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
|
|
||||||
app->asset_pack_index = 0;
|
app->asset_pack_index = 0;
|
||||||
CharList_init(app->asset_pack_names);
|
CharList_init(app->asset_pack_names);
|
||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
@@ -229,7 +227,7 @@ XtremeApp* xtreme_app_alloc() {
|
|||||||
if(app->asset_pack_index != 0) {
|
if(app->asset_pack_index != 0) {
|
||||||
if(idx < app->asset_pack_index) app->asset_pack_index++;
|
if(idx < app->asset_pack_index) app->asset_pack_index++;
|
||||||
} else {
|
} else {
|
||||||
if(strcmp(copy, xtreme_settings->asset_pack) == 0)
|
if(strcmp(copy, xtreme_settings.asset_pack) == 0)
|
||||||
app->asset_pack_index = idx + 1;
|
app->asset_pack_index = idx + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ void animation_manager_check_blocking_process(AnimationManager* animation_manage
|
|||||||
const StorageAnimationManifestInfo* manifest_info =
|
const StorageAnimationManifestInfo* manifest_info =
|
||||||
animation_storage_get_meta(animation_manager->current_animation);
|
animation_storage_get_meta(animation_manager->current_animation);
|
||||||
bool valid = animation_manager_is_valid_idle_animation(
|
bool valid = animation_manager_is_valid_idle_animation(
|
||||||
manifest_info, &stats, XTREME_SETTINGS()->unlock_anims);
|
manifest_info, &stats, xtreme_settings.unlock_anims);
|
||||||
|
|
||||||
if(!valid) {
|
if(!valid) {
|
||||||
animation_manager_start_new_idle(animation_manager);
|
animation_manager_start_new_idle(animation_manager);
|
||||||
@@ -203,9 +203,8 @@ static void animation_manager_start_new_idle(AnimationManager* animation_manager
|
|||||||
const BubbleAnimation* bubble_animation =
|
const BubbleAnimation* bubble_animation =
|
||||||
animation_storage_get_bubble_animation(animation_manager->current_animation);
|
animation_storage_get_bubble_animation(animation_manager->current_animation);
|
||||||
animation_manager->state = AnimationManagerStateIdle;
|
animation_manager->state = AnimationManagerStateIdle;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
int32_t duration = (xtreme_settings.cycle_anims == 0) ? (bubble_animation->duration) :
|
||||||
int32_t duration = (xtreme_settings->cycle_anims == 0) ? (bubble_animation->duration) :
|
(xtreme_settings.cycle_anims);
|
||||||
(xtreme_settings->cycle_anims);
|
|
||||||
furi_timer_start(
|
furi_timer_start(
|
||||||
animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0);
|
animation_manager->idle_animation_timer, (duration > 0) ? (duration * 1000) : 0);
|
||||||
}
|
}
|
||||||
@@ -389,14 +388,14 @@ static StorageAnimation*
|
|||||||
furi_record_close(RECORD_DOLPHIN);
|
furi_record_close(RECORD_DOLPHIN);
|
||||||
uint32_t whole_weight = 0;
|
uint32_t whole_weight = 0;
|
||||||
|
|
||||||
bool fallback = XTREME_SETTINGS()->fallback_anim;
|
bool fallback = xtreme_settings.fallback_anim;
|
||||||
if(StorageAnimationList_size(animation_list) == dolphin_internal_size + 1 && !fallback) {
|
if(StorageAnimationList_size(animation_list) == dolphin_internal_size + 1 && !fallback) {
|
||||||
// One ext anim and fallback disabled, dont skip current anim (current = only ext one)
|
// One ext anim and fallback disabled, dont skip current anim (current = only ext one)
|
||||||
avoid_animation = NULL;
|
avoid_animation = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
StorageAnimationList_it_t it;
|
StorageAnimationList_it_t it;
|
||||||
bool unlock = XTREME_SETTINGS()->unlock_anims;
|
bool unlock = xtreme_settings.unlock_anims;
|
||||||
for(StorageAnimationList_it(it, animation_list); !StorageAnimationList_end_p(it);) {
|
for(StorageAnimationList_it(it, animation_list); !StorageAnimationList_end_p(it);) {
|
||||||
StorageAnimation* storage_animation = *StorageAnimationList_ref(it);
|
StorageAnimation* storage_animation = *StorageAnimationList_ref(it);
|
||||||
const StorageAnimationManifestInfo* manifest_info =
|
const StorageAnimationManifestInfo* manifest_info =
|
||||||
@@ -531,7 +530,7 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
|
|||||||
const StorageAnimationManifestInfo* manifest_info =
|
const StorageAnimationManifestInfo* manifest_info =
|
||||||
animation_storage_get_meta(restore_animation);
|
animation_storage_get_meta(restore_animation);
|
||||||
bool valid = animation_manager_is_valid_idle_animation(
|
bool valid = animation_manager_is_valid_idle_animation(
|
||||||
manifest_info, &stats, XTREME_SETTINGS()->unlock_anims);
|
manifest_info, &stats, xtreme_settings.unlock_anims);
|
||||||
if(valid) {
|
if(valid) {
|
||||||
animation_manager_replace_current_animation(
|
animation_manager_replace_current_animation(
|
||||||
animation_manager, restore_animation);
|
animation_manager, restore_animation);
|
||||||
@@ -545,10 +544,9 @@ void animation_manager_load_and_continue_animation(AnimationManager* animation_m
|
|||||||
const BubbleAnimation* bubble_animation =
|
const BubbleAnimation* bubble_animation =
|
||||||
animation_storage_get_bubble_animation(
|
animation_storage_get_bubble_animation(
|
||||||
animation_manager->current_animation);
|
animation_manager->current_animation);
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
int32_t duration = (xtreme_settings.cycle_anims == 0) ?
|
||||||
int32_t duration = (xtreme_settings->cycle_anims == 0) ?
|
|
||||||
(bubble_animation->duration) :
|
(bubble_animation->duration) :
|
||||||
(xtreme_settings->cycle_anims);
|
(xtreme_settings.cycle_anims);
|
||||||
furi_timer_start(
|
furi_timer_start(
|
||||||
animation_manager->idle_animation_timer,
|
animation_manager->idle_animation_timer,
|
||||||
(duration > 0) ? (duration * 1000) : 0);
|
(duration > 0) ? (duration * 1000) : 0);
|
||||||
|
|||||||
@@ -23,13 +23,12 @@ static void animation_storage_free_animation(BubbleAnimation** storage_animation
|
|||||||
static BubbleAnimation* animation_storage_load_animation(const char* name);
|
static BubbleAnimation* animation_storage_load_animation(const char* name);
|
||||||
|
|
||||||
void animation_handler_select_manifest() {
|
void animation_handler_select_manifest() {
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
FuriString* anim_dir = furi_string_alloc();
|
FuriString* anim_dir = furi_string_alloc();
|
||||||
FuriString* manifest = furi_string_alloc();
|
FuriString* manifest = furi_string_alloc();
|
||||||
bool use_asset_pack = xtreme_settings->asset_pack[0] != '\0';
|
bool use_asset_pack = xtreme_settings.asset_pack[0] != '\0';
|
||||||
if(use_asset_pack) {
|
if(use_asset_pack) {
|
||||||
furi_string_printf(
|
furi_string_printf(
|
||||||
anim_dir, "%s/%s/Anims", XTREME_ASSETS_PATH, xtreme_settings->asset_pack);
|
anim_dir, "%s/%s/Anims", XTREME_ASSETS_PATH, xtreme_settings.asset_pack);
|
||||||
furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir));
|
furi_string_printf(manifest, "%s/manifest.txt", furi_string_get_cstr(anim_dir));
|
||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
if(storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) {
|
if(storage_common_stat(storage, furi_string_get_cstr(manifest), NULL) == FSE_OK) {
|
||||||
@@ -514,7 +513,7 @@ static BubbleAnimation* animation_storage_load_animation(const char* name) {
|
|||||||
if(!flipper_format_read_uint32(ff, "Active cycles", &u32value, 1)) break; //-V779
|
if(!flipper_format_read_uint32(ff, "Active cycles", &u32value, 1)) break; //-V779
|
||||||
animation->active_cycles = u32value;
|
animation->active_cycles = u32value;
|
||||||
if(!flipper_format_read_uint32(ff, "Frame rate", &u32value, 1)) break;
|
if(!flipper_format_read_uint32(ff, "Frame rate", &u32value, 1)) break;
|
||||||
uint32_t anim_speed = XTREME_SETTINGS()->anim_speed;
|
uint32_t anim_speed = xtreme_settings.anim_speed;
|
||||||
u32value = (u32value * anim_speed) / 100;
|
u32value = (u32value * anim_speed) / 100;
|
||||||
FURI_CONST_ASSIGN(animation->icon_animation.frame_rate, u32value < 1 ? 1 : u32value);
|
FURI_CONST_ASSIGN(animation->icon_animation.frame_rate, u32value < 1 ? 1 : u32value);
|
||||||
if(!flipper_format_read_uint32(ff, "Duration", &u32value, 1)) break;
|
if(!flipper_format_read_uint32(ff, "Duration", &u32value, 1)) break;
|
||||||
|
|||||||
@@ -66,13 +66,13 @@ static void desktop_clock_reconfigure(Desktop* desktop) {
|
|||||||
|
|
||||||
desktop_clock_update(desktop);
|
desktop_clock_update(desktop);
|
||||||
|
|
||||||
if(XTREME_SETTINGS()->statusbar_clock) {
|
if(xtreme_settings.statusbar_clock) {
|
||||||
furi_timer_start(desktop->update_clock_timer, furi_ms_to_ticks(1000));
|
furi_timer_start(desktop->update_clock_timer, furi_ms_to_ticks(1000));
|
||||||
} else {
|
} else {
|
||||||
furi_timer_stop(desktop->update_clock_timer);
|
furi_timer_stop(desktop->update_clock_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
view_port_enabled_set(desktop->clock_viewport, XTREME_SETTINGS()->statusbar_clock);
|
view_port_enabled_set(desktop->clock_viewport, xtreme_settings.statusbar_clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void desktop_clock_draw_callback(Canvas* canvas, void* context) {
|
static void desktop_clock_draw_callback(Canvas* canvas, void* context) {
|
||||||
@@ -209,7 +209,7 @@ void desktop_lock(Desktop* desktop, bool pin_lock) {
|
|||||||
Cli* cli = furi_record_open(RECORD_CLI);
|
Cli* cli = furi_record_open(RECORD_CLI);
|
||||||
cli_session_close(cli);
|
cli_session_close(cli);
|
||||||
furi_record_close(RECORD_CLI);
|
furi_record_close(RECORD_CLI);
|
||||||
if(!XTREME_SETTINGS()->allow_locked_rpc_commands) {
|
if(!xtreme_settings.allow_locked_rpc_commands) {
|
||||||
Bt* bt = furi_record_open(RECORD_BT);
|
Bt* bt = furi_record_open(RECORD_BT);
|
||||||
bt_close_rpc_connection(bt);
|
bt_close_rpc_connection(bt);
|
||||||
furi_record_close(RECORD_BT);
|
furi_record_close(RECORD_BT);
|
||||||
@@ -484,7 +484,7 @@ int32_t desktop_srv(void* p) {
|
|||||||
|
|
||||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
scene_manager_next_scene(desktop->scene_manager, DesktopSceneMain);
|
||||||
|
|
||||||
if(XTREME_SETTINGS()->lock_on_boot || furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
if(xtreme_settings.lock_on_boot || furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||||
desktop_lock(desktop, true);
|
desktop_lock(desktop, true);
|
||||||
} else {
|
} else {
|
||||||
if(!loader_is_locked(desktop->loader)) {
|
if(!loader_is_locked(desktop->loader)) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ void desktop_scene_fault_on_enter(void* context) {
|
|||||||
|
|
||||||
Popup* popup = desktop->hw_mismatch_popup;
|
Popup* popup = desktop->hw_mismatch_popup;
|
||||||
popup_set_context(popup, desktop);
|
popup_set_context(popup, desktop);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
popup_set_header(
|
popup_set_header(
|
||||||
popup,
|
popup,
|
||||||
"Slut passed out\n but is now back",
|
"Slut passed out\n but is now back",
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ static void desktop_scene_pin_input_done_callback(const PinCode* pin_code, void*
|
|||||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopPinInputEventUnlocked);
|
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopPinInputEventUnlocked);
|
||||||
} else {
|
} else {
|
||||||
uint32_t pin_fails = furi_hal_rtc_get_pin_fails() + 1;
|
uint32_t pin_fails = furi_hal_rtc_get_pin_fails() + 1;
|
||||||
if(pin_fails >= 10 && XTREME_SETTINGS()->bad_pins_format) {
|
if(pin_fails >= 10 && xtreme_settings.bad_pins_format) {
|
||||||
furi_hal_rtc_set_pin_fails(0);
|
furi_hal_rtc_set_pin_fails(0);
|
||||||
furi_hal_rtc_set_flag(FuriHalRtcFlagFactoryReset);
|
furi_hal_rtc_set_flag(FuriHalRtcFlagFactoryReset);
|
||||||
storage_sd_format(furi_record_open(RECORD_STORAGE));
|
storage_sd_format(furi_record_open(RECORD_STORAGE));
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ void desktop_lock_menu_draw_callback(Canvas* canvas, void* model) {
|
|||||||
break;
|
break;
|
||||||
case DesktopLockMenuIndexDarkMode:
|
case DesktopLockMenuIndexDarkMode:
|
||||||
icon = &I_CC_DarkMode_16x16;
|
icon = &I_CC_DarkMode_16x16;
|
||||||
enabled = XTREME_SETTINGS()->dark_mode;
|
enabled = xtreme_settings.dark_mode;
|
||||||
break;
|
break;
|
||||||
case DesktopLockMenuIndexLock:
|
case DesktopLockMenuIndexLock:
|
||||||
icon = &I_CC_Lock_16x16;
|
icon = &I_CC_Lock_16x16;
|
||||||
@@ -287,7 +287,7 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
|
|||||||
desktop_event = DesktopLockMenuEventSettings;
|
desktop_event = DesktopLockMenuEventSettings;
|
||||||
break;
|
break;
|
||||||
case DesktopLockMenuIndexDarkMode:
|
case DesktopLockMenuIndexDarkMode:
|
||||||
XTREME_SETTINGS()->dark_mode = !XTREME_SETTINGS()->dark_mode;
|
xtreme_settings.dark_mode = !xtreme_settings.dark_mode;
|
||||||
lock_menu->save_xtreme = true;
|
lock_menu->save_xtreme = true;
|
||||||
break;
|
break;
|
||||||
case DesktopLockMenuIndexBluetooth:
|
case DesktopLockMenuIndexBluetooth:
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) {
|
|||||||
furi_hal_rtc_get_datetime(&datetime);
|
furi_hal_rtc_get_datetime(&datetime);
|
||||||
LocaleTimeFormat time_format = locale_get_time_format();
|
LocaleTimeFormat time_format = locale_get_time_format();
|
||||||
LocaleDateFormat date_format = locale_get_date_format();
|
LocaleDateFormat date_format = locale_get_date_format();
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
|
|
||||||
bool pm;
|
bool pm;
|
||||||
if(time_format == LocaleTimeFormat24h) {
|
if(time_format == LocaleTimeFormat24h) {
|
||||||
@@ -94,14 +93,14 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) {
|
|||||||
snprintf(date_str, 14, "%.2d-%.2d-%.4d", datetime.day, datetime.month, datetime.year);
|
snprintf(date_str, 14, "%.2d-%.2d-%.4d", datetime.day, datetime.month, datetime.year);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!xtreme_settings->lockscreen_transparent) {
|
if(!xtreme_settings.lockscreen_transparent) {
|
||||||
canvas_draw_icon(canvas, 0, 0 + y, &I_Lockscreen);
|
canvas_draw_icon(canvas, 0, 0 + y, &I_Lockscreen);
|
||||||
}
|
}
|
||||||
if(xtreme_settings->lockscreen_time) {
|
if(xtreme_settings.lockscreen_time) {
|
||||||
canvas_set_font(canvas, FontBigNumbers);
|
canvas_set_font(canvas, FontBigNumbers);
|
||||||
canvas_draw_str(canvas, 0, 64 + y, time_str);
|
canvas_draw_str(canvas, 0, 64 + y, time_str);
|
||||||
int offset = canvas_string_width(canvas, time_str) + 2;
|
int offset = canvas_string_width(canvas, time_str) + 2;
|
||||||
if(xtreme_settings->lockscreen_seconds) {
|
if(xtreme_settings.lockscreen_seconds) {
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
canvas_draw_str(canvas, 0 + offset, 64 + y, second_str);
|
canvas_draw_str(canvas, 0 + offset, 64 + y, second_str);
|
||||||
offset += canvas_string_width(canvas, ":00") + 2;
|
offset += canvas_string_width(canvas, ":00") + 2;
|
||||||
@@ -111,12 +110,12 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) {
|
|||||||
canvas_draw_str(canvas, 0 + offset, 64 + y, meridian_str);
|
canvas_draw_str(canvas, 0 + offset, 64 + y, meridian_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(xtreme_settings->lockscreen_date) {
|
if(xtreme_settings.lockscreen_date) {
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
canvas_draw_str(canvas, 0, 48 + y + 16 * !xtreme_settings->lockscreen_time, date_str);
|
canvas_draw_str(canvas, 0, 48 + y + 16 * !xtreme_settings.lockscreen_time, date_str);
|
||||||
}
|
}
|
||||||
if(model->view_state == DesktopViewLockedStateLockedHintShown &&
|
if(model->view_state == DesktopViewLockedStateLockedHintShown &&
|
||||||
xtreme_settings->lockscreen_prompt) {
|
xtreme_settings.lockscreen_prompt) {
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
if(model->pin_locked) {
|
if(model->pin_locked) {
|
||||||
elements_bubble_str(
|
elements_bubble_str(
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Dolphin* dolphin_alloc() {
|
|||||||
dolphin->state = dolphin_state_alloc();
|
dolphin->state = dolphin_state_alloc();
|
||||||
dolphin->event_queue = furi_message_queue_alloc(8, sizeof(DolphinEvent));
|
dolphin->event_queue = furi_message_queue_alloc(8, sizeof(DolphinEvent));
|
||||||
dolphin->pubsub = furi_pubsub_alloc();
|
dolphin->pubsub = furi_pubsub_alloc();
|
||||||
uint32_t butthurt_timer = XTREME_SETTINGS()->butthurt_timer;
|
uint32_t butthurt_timer = xtreme_settings.butthurt_timer;
|
||||||
dolphin->butthurt_timer = xTimerCreate(
|
dolphin->butthurt_timer = xTimerCreate(
|
||||||
NULL,
|
NULL,
|
||||||
butthurt_timer ? ((int32_t)butthurt_timer * 1000) : -1,
|
butthurt_timer ? ((int32_t)butthurt_timer * 1000) : -1,
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ const CanvasFontParameters* canvas_get_font_params(const Canvas* canvas, Font fo
|
|||||||
|
|
||||||
void canvas_clear(Canvas* canvas) {
|
void canvas_clear(Canvas* canvas) {
|
||||||
furi_assert(canvas);
|
furi_assert(canvas);
|
||||||
if(XTREME_SETTINGS()->dark_mode) {
|
if(xtreme_settings.dark_mode) {
|
||||||
u8g2_FillBuffer(&canvas->fb);
|
u8g2_FillBuffer(&canvas->fb);
|
||||||
} else {
|
} else {
|
||||||
u8g2_ClearBuffer(&canvas->fb);
|
u8g2_ClearBuffer(&canvas->fb);
|
||||||
@@ -126,7 +126,7 @@ void canvas_clear(Canvas* canvas) {
|
|||||||
|
|
||||||
void canvas_set_color(Canvas* canvas, Color color) {
|
void canvas_set_color(Canvas* canvas, Color color) {
|
||||||
furi_assert(canvas);
|
furi_assert(canvas);
|
||||||
if(XTREME_SETTINGS()->dark_mode) {
|
if(xtreme_settings.dark_mode) {
|
||||||
if(color == ColorBlack) {
|
if(color == ColorBlack) {
|
||||||
color = ColorWhite;
|
color = ColorWhite;
|
||||||
} else if(color == ColorWhite) {
|
} else if(color == ColorWhite) {
|
||||||
|
|||||||
@@ -84,12 +84,10 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
canvas_frame_set(
|
canvas_frame_set(
|
||||||
gui->canvas, GUI_STATUS_BAR_X, GUI_STATUS_BAR_Y, GUI_DISPLAY_WIDTH, GUI_STATUS_BAR_HEIGHT);
|
gui->canvas, GUI_STATUS_BAR_X, GUI_STATUS_BAR_Y, GUI_DISPLAY_WIDTH, GUI_STATUS_BAR_HEIGHT);
|
||||||
|
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
|
||||||
|
|
||||||
/* for support black theme - paint white area and
|
/* for support black theme - paint white area and
|
||||||
* draw icon with transparent white color
|
* draw icon with transparent white color
|
||||||
*/
|
*/
|
||||||
if(xtreme_settings->bar_background) {
|
if(xtreme_settings.bar_background) {
|
||||||
canvas_set_color(gui->canvas, ColorWhite);
|
canvas_set_color(gui->canvas, ColorWhite);
|
||||||
canvas_draw_box(gui->canvas, 1, 1, 9, 7);
|
canvas_draw_box(gui->canvas, 1, 1, 9, 7);
|
||||||
canvas_draw_box(gui->canvas, 7, 3, 58, 6);
|
canvas_draw_box(gui->canvas, 7, 3, 58, 6);
|
||||||
@@ -122,7 +120,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
width + 2,
|
width + 2,
|
||||||
GUI_STATUS_BAR_WORKAREA_HEIGHT + 2);
|
GUI_STATUS_BAR_WORKAREA_HEIGHT + 2);
|
||||||
// Hide battery background
|
// Hide battery background
|
||||||
if(xtreme_settings->bar_borders) {
|
if(xtreme_settings.bar_borders) {
|
||||||
canvas_set_color(gui->canvas, ColorWhite);
|
canvas_set_color(gui->canvas, ColorWhite);
|
||||||
canvas_draw_box(
|
canvas_draw_box(
|
||||||
gui->canvas, -1, 0, canvas_width(gui->canvas) + 1, canvas_height(gui->canvas));
|
gui->canvas, -1, 0, canvas_width(gui->canvas) + 1, canvas_height(gui->canvas));
|
||||||
@@ -131,7 +129,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
// ViewPort draw
|
// ViewPort draw
|
||||||
canvas_frame_set(
|
canvas_frame_set(
|
||||||
gui->canvas,
|
gui->canvas,
|
||||||
x - xtreme_settings->bar_borders,
|
x - xtreme_settings.bar_borders,
|
||||||
GUI_STATUS_BAR_Y + 2,
|
GUI_STATUS_BAR_Y + 2,
|
||||||
width,
|
width,
|
||||||
GUI_STATUS_BAR_WORKAREA_HEIGHT);
|
GUI_STATUS_BAR_WORKAREA_HEIGHT);
|
||||||
@@ -148,7 +146,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
right_used + 4,
|
right_used + 4,
|
||||||
GUI_STATUS_BAR_HEIGHT);
|
GUI_STATUS_BAR_HEIGHT);
|
||||||
// Disable battery border
|
// Disable battery border
|
||||||
if(xtreme_settings->bar_borders) {
|
if(xtreme_settings.bar_borders) {
|
||||||
canvas_set_color(gui->canvas, ColorBlack);
|
canvas_set_color(gui->canvas, ColorBlack);
|
||||||
canvas_draw_rframe(
|
canvas_draw_rframe(
|
||||||
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas), 1);
|
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas), 1);
|
||||||
@@ -168,7 +166,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Left side
|
// Left side
|
||||||
if(xtreme_settings->status_icons) {
|
if(xtreme_settings.status_icons) {
|
||||||
x = 2;
|
x = 2;
|
||||||
ViewPortArray_it(it, gui->layers[GuiLayerStatusBarLeft]);
|
ViewPortArray_it(it, gui->layers[GuiLayerStatusBarLeft]);
|
||||||
while(!ViewPortArray_end_p(it) && (right_used + left_used) < GUI_STATUS_BAR_WIDTH) {
|
while(!ViewPortArray_end_p(it) && (right_used + left_used) < GUI_STATUS_BAR_WIDTH) {
|
||||||
@@ -183,7 +181,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
GUI_STATUS_BAR_Y + 1,
|
GUI_STATUS_BAR_Y + 1,
|
||||||
width + 2,
|
width + 2,
|
||||||
GUI_STATUS_BAR_WORKAREA_HEIGHT + 2);
|
GUI_STATUS_BAR_WORKAREA_HEIGHT + 2);
|
||||||
if(xtreme_settings->bar_borders) {
|
if(xtreme_settings.bar_borders) {
|
||||||
canvas_set_color(gui->canvas, ColorWhite);
|
canvas_set_color(gui->canvas, ColorWhite);
|
||||||
canvas_draw_box(
|
canvas_draw_box(
|
||||||
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas));
|
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas));
|
||||||
@@ -209,7 +207,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
GUI_STATUS_BAR_Y + 1,
|
GUI_STATUS_BAR_Y + 1,
|
||||||
width + 2,
|
width + 2,
|
||||||
GUI_STATUS_BAR_WORKAREA_HEIGHT + 2);
|
GUI_STATUS_BAR_WORKAREA_HEIGHT + 2);
|
||||||
if(xtreme_settings->bar_borders) {
|
if(xtreme_settings.bar_borders) {
|
||||||
canvas_set_color(gui->canvas, ColorWhite);
|
canvas_set_color(gui->canvas, ColorWhite);
|
||||||
canvas_draw_box(
|
canvas_draw_box(
|
||||||
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas));
|
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas));
|
||||||
@@ -226,7 +224,7 @@ static void gui_redraw_status_bar(Gui* gui, bool need_attention) {
|
|||||||
// Draw frame around icons on the left
|
// Draw frame around icons on the left
|
||||||
if(left_used) {
|
if(left_used) {
|
||||||
canvas_frame_set(gui->canvas, 0, 0, left_used + 3, GUI_STATUS_BAR_HEIGHT);
|
canvas_frame_set(gui->canvas, 0, 0, left_used + 3, GUI_STATUS_BAR_HEIGHT);
|
||||||
if(xtreme_settings->bar_borders) {
|
if(xtreme_settings.bar_borders) {
|
||||||
canvas_draw_rframe(
|
canvas_draw_rframe(
|
||||||
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas), 1);
|
gui->canvas, 0, 0, canvas_width(gui->canvas), canvas_height(gui->canvas), 1);
|
||||||
canvas_draw_line(
|
canvas_draw_line(
|
||||||
@@ -283,7 +281,7 @@ static void gui_redraw(Gui* gui) {
|
|||||||
bool need_attention =
|
bool need_attention =
|
||||||
(gui_view_port_find_enabled(gui->layers[GuiLayerWindow]) != 0 ||
|
(gui_view_port_find_enabled(gui->layers[GuiLayerWindow]) != 0 ||
|
||||||
gui_view_port_find_enabled(gui->layers[GuiLayerFullscreen]) != 0);
|
gui_view_port_find_enabled(gui->layers[GuiLayerFullscreen]) != 0);
|
||||||
if(XTREME_SETTINGS()->lockscreen_statusbar) {
|
if(xtreme_settings.lockscreen_statusbar) {
|
||||||
gui_redraw_status_bar(gui, need_attention);
|
gui_redraw_status_bar(gui, need_attention);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ static int BrowserItem_t_cmp(const BrowserItem_t* a, const BrowserItem_t* b) {
|
|||||||
if(b->type == BrowserItemTypeBack) {
|
if(b->type == BrowserItemTypeBack) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(XTREME_SETTINGS()->sort_dirs_first) {
|
if(xtreme_settings.sort_dirs_first) {
|
||||||
if(a->type == BrowserItemTypeFolder && b->type != BrowserItemTypeFolder) {
|
if(a->type == BrowserItemTypeFolder && b->type != BrowserItemTypeFolder) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
MenuItem* item;
|
MenuItem* item;
|
||||||
size_t shift_position;
|
size_t shift_position;
|
||||||
FuriString* name = furi_string_alloc();
|
FuriString* name = furi_string_alloc();
|
||||||
switch(XTREME_SETTINGS()->menu_style) {
|
switch(xtreme_settings.menu_style) {
|
||||||
case MenuStyleList: {
|
case MenuStyleList: {
|
||||||
for(uint8_t i = 0; i < 3; i++) {
|
for(uint8_t i = 0; i < 3; i++) {
|
||||||
canvas_set_font(canvas, i == 1 ? FontPrimary : FontSecondary);
|
canvas_set_font(canvas, i == 1 ? FontPrimary : FontSecondary);
|
||||||
@@ -442,7 +442,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) {
|
|||||||
static bool menu_input_callback(InputEvent* event, void* context) {
|
static bool menu_input_callback(InputEvent* event, void* context) {
|
||||||
Menu* menu = context;
|
Menu* menu = context;
|
||||||
bool consumed = true;
|
bool consumed = true;
|
||||||
if(XTREME_SETTINGS()->menu_style == MenuStyleVertical &&
|
if(xtreme_settings.menu_style == MenuStyleVertical &&
|
||||||
furi_hal_rtc_is_flag_set(FuriHalRtcFlagHandOrient)) {
|
furi_hal_rtc_is_flag_set(FuriHalRtcFlagHandOrient)) {
|
||||||
if(event->key == InputKeyLeft) {
|
if(event->key == InputKeyLeft) {
|
||||||
event->key = InputKeyRight;
|
event->key = InputKeyRight;
|
||||||
@@ -651,7 +651,7 @@ static void menu_process_up(Menu* menu) {
|
|||||||
size_t count = MenuItemArray_size(model->items);
|
size_t count = MenuItemArray_size(model->items);
|
||||||
size_t vertical_offset = model->vertical_offset;
|
size_t vertical_offset = model->vertical_offset;
|
||||||
|
|
||||||
switch(XTREME_SETTINGS()->menu_style) {
|
switch(xtreme_settings.menu_style) {
|
||||||
case MenuStyleList:
|
case MenuStyleList:
|
||||||
case MenuStyleEurocorp:
|
case MenuStyleEurocorp:
|
||||||
case MenuStyleTerminal:
|
case MenuStyleTerminal:
|
||||||
@@ -703,7 +703,7 @@ static void menu_process_down(Menu* menu) {
|
|||||||
size_t count = MenuItemArray_size(model->items);
|
size_t count = MenuItemArray_size(model->items);
|
||||||
size_t vertical_offset = model->vertical_offset;
|
size_t vertical_offset = model->vertical_offset;
|
||||||
|
|
||||||
switch(XTREME_SETTINGS()->menu_style) {
|
switch(xtreme_settings.menu_style) {
|
||||||
case MenuStyleList:
|
case MenuStyleList:
|
||||||
case MenuStyleEurocorp:
|
case MenuStyleEurocorp:
|
||||||
case MenuStyleTerminal:
|
case MenuStyleTerminal:
|
||||||
@@ -755,7 +755,7 @@ static void menu_process_left(Menu* menu) {
|
|||||||
size_t count = MenuItemArray_size(model->items);
|
size_t count = MenuItemArray_size(model->items);
|
||||||
size_t vertical_offset = model->vertical_offset;
|
size_t vertical_offset = model->vertical_offset;
|
||||||
|
|
||||||
switch(XTREME_SETTINGS()->menu_style) {
|
switch(xtreme_settings.menu_style) {
|
||||||
case MenuStyleWii:
|
case MenuStyleWii:
|
||||||
if(position < 2) {
|
if(position < 2) {
|
||||||
if(count % 2) {
|
if(count % 2) {
|
||||||
@@ -818,7 +818,7 @@ static void menu_process_right(Menu* menu) {
|
|||||||
size_t count = MenuItemArray_size(model->items);
|
size_t count = MenuItemArray_size(model->items);
|
||||||
size_t vertical_offset = model->vertical_offset;
|
size_t vertical_offset = model->vertical_offset;
|
||||||
|
|
||||||
switch(XTREME_SETTINGS()->menu_style) {
|
switch(xtreme_settings.menu_style) {
|
||||||
case MenuStyleWii:
|
case MenuStyleWii:
|
||||||
if(count % 2) {
|
if(count % 2) {
|
||||||
if(position == count - 1) {
|
if(position == count - 1) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void power_set_battery_icon_enabled(Power* power, bool is_enabled) {
|
|||||||
void power_draw_battery_callback(Canvas* canvas, void* context) {
|
void power_draw_battery_callback(Canvas* canvas, void* context) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
Power* power = context;
|
Power* power = context;
|
||||||
BatteryIcon battery_icon = XTREME_SETTINGS()->battery_icon;
|
BatteryIcon battery_icon = xtreme_settings.battery_icon;
|
||||||
if(battery_icon == BatteryIconOff) return;
|
if(battery_icon == BatteryIconOff) return;
|
||||||
|
|
||||||
canvas_draw_icon(canvas, 0, 0, &I_Battery_25x8);
|
canvas_draw_icon(canvas, 0, 0, &I_Battery_25x8);
|
||||||
@@ -359,7 +359,7 @@ Power* power_alloc() {
|
|||||||
|
|
||||||
// Battery view port
|
// Battery view port
|
||||||
power->battery_view_port = power_battery_view_port_alloc(power);
|
power->battery_view_port = power_battery_view_port_alloc(power);
|
||||||
power_set_battery_icon_enabled(power, XTREME_SETTINGS()->battery_icon != BatteryIconOff);
|
power_set_battery_icon_enabled(power, xtreme_settings.battery_icon != BatteryIconOff);
|
||||||
power->show_low_bat_level_message = true;
|
power->show_low_bat_level_message = true;
|
||||||
|
|
||||||
//Auto shutdown timer
|
//Auto shutdown timer
|
||||||
@@ -478,7 +478,7 @@ static void power_check_battery_level_change(Power* power) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void power_check_charge_cap(Power* power) {
|
static void power_check_charge_cap(Power* power) {
|
||||||
uint32_t cap = XTREME_SETTINGS()->charge_cap;
|
uint32_t cap = xtreme_settings.charge_cap;
|
||||||
if(power->info.charge >= cap && cap < 100) {
|
if(power->info.charge >= cap && cap < 100) {
|
||||||
if(!power->info.is_charge_capped) { // Suppress charging if charge reaches custom cap
|
if(!power->info.is_charge_capped) { // Suppress charging if charge reaches custom cap
|
||||||
power->info.is_charge_capped = true;
|
power->info.is_charge_capped = true;
|
||||||
|
|||||||
@@ -376,8 +376,7 @@ static void rpc_session_thread_state_callback(FuriThreadState thread_state, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
RpcSession* rpc_session_open(Rpc* rpc, RpcOwner owner) {
|
RpcSession* rpc_session_open(Rpc* rpc, RpcOwner owner) {
|
||||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock) &&
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock) && !xtreme_settings.allow_locked_rpc_commands)
|
||||||
!XTREME_SETTINGS()->allow_locked_rpc_commands)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
furi_assert(rpc);
|
furi_assert(rpc);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ static void
|
|||||||
const DialogsFileBrowserOptions browser_options = {
|
const DialogsFileBrowserOptions browser_options = {
|
||||||
.extension = extension,
|
.extension = extension,
|
||||||
.icon = &I_unknown_10px,
|
.icon = &I_unknown_10px,
|
||||||
.hide_dot_files = !XTREME_SETTINGS()->show_hidden_files,
|
.hide_dot_files = !xtreme_settings.show_hidden_files,
|
||||||
.skip_assets = true,
|
.skip_assets = true,
|
||||||
.hide_ext = hide_ext,
|
.hide_ext = hide_ext,
|
||||||
.item_loader_callback = keybinds_fap_selector_item_callback,
|
.item_loader_callback = keybinds_fap_selector_item_callback,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ static void render_callback(Canvas* canvas, void* _ctx) {
|
|||||||
const char* mood_str = NULL;
|
const char* mood_str = NULL;
|
||||||
const Icon* portrait = NULL;
|
const Icon* portrait = NULL;
|
||||||
|
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
if(stats->butthurt <= 4) {
|
if(stats->butthurt <= 4) {
|
||||||
portrait = &I_passport_happy_46x49;
|
portrait = &I_passport_happy_46x49;
|
||||||
mood_str = "Status: Wet";
|
mood_str = "Status: Wet";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ void power_settings_scene_power_off_on_enter(void* context) {
|
|||||||
DialogEx* dialog = app->dialog;
|
DialogEx* dialog = app->dialog;
|
||||||
|
|
||||||
dialog_ex_set_header(dialog, "Turn Off Device?", 64, 2, AlignCenter, AlignTop);
|
dialog_ex_set_header(dialog, "Turn Off Device?", 64, 2, AlignCenter, AlignTop);
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
if(xtreme_settings.is_nsfw) {
|
||||||
dialog_ex_set_text(
|
dialog_ex_set_text(
|
||||||
dialog, " I will be\nwaiting for\n you master", 78, 16, AlignLeft, AlignTop);
|
dialog, " I will be\nwaiting for\n you master", 78, 16, AlignLeft, AlignTop);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -341,7 +341,6 @@ Function,-,SystemCoreClockUpdate,void,
|
|||||||
Function,-,SystemInit,void,
|
Function,-,SystemInit,void,
|
||||||
Function,+,XTREME_ASSETS_FREE,void,
|
Function,+,XTREME_ASSETS_FREE,void,
|
||||||
Function,+,XTREME_ASSETS_LOAD,void,
|
Function,+,XTREME_ASSETS_LOAD,void,
|
||||||
Function,+,XTREME_SETTINGS,XtremeSettings*,
|
|
||||||
Function,-,XTREME_SETTINGS_LOAD,void,
|
Function,-,XTREME_SETTINGS_LOAD,void,
|
||||||
Function,+,XTREME_SETTINGS_SAVE,void,
|
Function,+,XTREME_SETTINGS_SAVE,void,
|
||||||
Function,-,_Exit,void,int
|
Function,-,_Exit,void,int
|
||||||
@@ -3894,3 +3893,4 @@ Variable,+,usb_cdc_single,FuriHalUsbInterface,
|
|||||||
Variable,+,usb_hid,FuriHalUsbInterface,
|
Variable,+,usb_hid,FuriHalUsbInterface,
|
||||||
Variable,+,usb_hid_u2f,FuriHalUsbInterface,
|
Variable,+,usb_hid_u2f,FuriHalUsbInterface,
|
||||||
Variable,+,usbd_devfs,const usbd_driver,
|
Variable,+,usbd_devfs,const usbd_driver,
|
||||||
|
Variable,+,xtreme_settings,XtremeSettings,
|
||||||
|
|||||||
|
@@ -44,7 +44,7 @@ void furi_hal_light_set(Light light, uint8_t value) {
|
|||||||
lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value);
|
lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value);
|
||||||
}
|
}
|
||||||
if(light & LightBacklight) {
|
if(light & LightBacklight) {
|
||||||
if(XTREME_SETTINGS()->rgb_backlight) {
|
if(xtreme_settings.rgb_backlight) {
|
||||||
rgb_backlight_update(value, false);
|
rgb_backlight_update(value, false);
|
||||||
} else {
|
} else {
|
||||||
uint8_t prev =
|
uint8_t prev =
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#define ICONS_FMT XTREME_ASSETS_PATH "/%s/Icons/%s"
|
#define ICONS_FMT XTREME_ASSETS_PATH "/%s/Icons/%s"
|
||||||
|
|
||||||
void load_icon_animated(const Icon* replace, const char* name, FuriString* path, File* file) {
|
void load_icon_animated(const Icon* replace, const char* name, FuriString* path, File* file) {
|
||||||
const char* pack = XTREME_SETTINGS()->asset_pack;
|
const char* pack = xtreme_settings.asset_pack;
|
||||||
furi_string_printf(path, ICONS_FMT "/meta", pack, name);
|
furi_string_printf(path, ICONS_FMT "/meta", pack, name);
|
||||||
if(storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
|
if(storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
|
||||||
int32_t icon_width, icon_height, frame_rate, frame_count;
|
int32_t icon_width, icon_height, frame_rate, frame_count;
|
||||||
@@ -61,7 +61,7 @@ void load_icon_animated(const Icon* replace, const char* name, FuriString* path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void load_icon_static(const Icon* replace, const char* name, FuriString* path, File* file) {
|
void load_icon_static(const Icon* replace, const char* name, FuriString* path, File* file) {
|
||||||
furi_string_printf(path, ICONS_FMT ".bmx", XTREME_SETTINGS()->asset_pack, name);
|
furi_string_printf(path, ICONS_FMT ".bmx", xtreme_settings.asset_pack, name);
|
||||||
if(storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
|
if(storage_file_open(file, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) {
|
||||||
uint64_t size = storage_file_size(file) - 8;
|
uint64_t size = storage_file_size(file) - 8;
|
||||||
uint8_t* frame = malloc(size);
|
uint8_t* frame = malloc(size);
|
||||||
@@ -102,8 +102,8 @@ void free_icon(const Icon* icon) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void XTREME_ASSETS_LOAD() {
|
void XTREME_ASSETS_LOAD() {
|
||||||
const char* pack = XTREME_SETTINGS()->asset_pack;
|
const char* pack = xtreme_settings.asset_pack;
|
||||||
XTREME_SETTINGS()->is_nsfw = !strncmp(pack, "NSFW", strlen("NSFW"));
|
xtreme_settings.is_nsfw = !strncmp(pack, "NSFW", strlen("NSFW"));
|
||||||
if(pack[0] == '\0') return;
|
if(pack[0] == '\0') return;
|
||||||
|
|
||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
|
|||||||
@@ -252,7 +252,3 @@ void XTREME_SETTINGS_SAVE() {
|
|||||||
flipper_format_free(file);
|
flipper_format_free(file);
|
||||||
furi_record_close(RECORD_STORAGE);
|
furi_record_close(RECORD_STORAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
XtremeSettings* XTREME_SETTINGS() {
|
|
||||||
return &xtreme_settings;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ typedef struct {
|
|||||||
|
|
||||||
void XTREME_SETTINGS_LOAD();
|
void XTREME_SETTINGS_LOAD();
|
||||||
void XTREME_SETTINGS_SAVE();
|
void XTREME_SETTINGS_SAVE();
|
||||||
XtremeSettings* XTREME_SETTINGS();
|
extern XtremeSettings xtreme_settings;
|
||||||
|
|
||||||
void XTREME_ASSETS_LOAD();
|
void XTREME_ASSETS_LOAD();
|
||||||
void XTREME_ASSETS_FREE();
|
void XTREME_ASSETS_FREE();
|
||||||
|
|||||||
Reference in New Issue
Block a user