mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 06:11:24 +03:00
added wrcrooks SOS
This commit is contained in:
parent
daa3d298cd
commit
07315c8b97
28
app/action.c
28
app/action.c
@ -39,20 +39,34 @@
|
|||||||
#include "ui/inputbox.h"
|
#include "ui/inputbox.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||||
|
|
||||||
static void ACTION_FlashLight(void)
|
static void ACTION_FlashLight(void)
|
||||||
{
|
{
|
||||||
switch (g_flash_light_state)
|
switch (g_flash_light_state)
|
||||||
{
|
{
|
||||||
case 0:
|
case FLASHLIGHT_OFF:
|
||||||
g_flash_light_state++;
|
g_flash_light_state = FLASHLIGHT_ON;
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
break;
|
break;
|
||||||
case 1:
|
|
||||||
g_flash_light_state++;
|
case FLASHLIGHT_ON:
|
||||||
|
g_flash_light_state = FLASHLIGHT_BLINK;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
g_flash_light_state = 0;
|
case FLASHLIGHT_BLINK:
|
||||||
|
g_flash_light_blink_tick_10ms = 0;
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
|
g_flash_light_state = FLASHLIGHT_SOS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FLASHLIGHT_SOS:
|
||||||
|
|
||||||
|
default:
|
||||||
|
g_flash_light_state = FLASHLIGHT_OFF;
|
||||||
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,3 +428,5 @@ void ACTION_process(const key_code_t Key, const bool key_pressed, const bool key
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
@ -58,10 +58,10 @@ enum GPIOC_PINS {
|
|||||||
GPIOC_PIN_PTT = 5
|
GPIOC_PIN_PTT = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
void GPIO_ClearBit(volatile uint32_t *pReg, uint8_t Bit);
|
|
||||||
uint8_t GPIO_CheckBit(volatile uint32_t *pReg, uint8_t Bit);
|
uint8_t GPIO_CheckBit(volatile uint32_t *pReg, uint8_t Bit);
|
||||||
void GPIO_FlipBit( volatile uint32_t *pReg, uint8_t Bit);
|
void GPIO_ClearBit(volatile uint32_t *pReg, uint8_t Bit);
|
||||||
void GPIO_SetBit( volatile uint32_t *pReg, uint8_t Bit);
|
void GPIO_SetBit( volatile uint32_t *pReg, uint8_t Bit);
|
||||||
|
void GPIO_FlipBit( volatile uint32_t *pReg, uint8_t Bit);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
2
misc.c
2
misc.c
@ -216,7 +216,7 @@ bool g_cxcss_tail_found;
|
|||||||
bool g_squelch_open;
|
bool g_squelch_open;
|
||||||
|
|
||||||
uint8_t g_flash_light_state;
|
uint8_t g_flash_light_state;
|
||||||
volatile uint16_t g_flash_light_blink_counter;
|
uint16_t g_flash_light_blink_tick_10ms;
|
||||||
|
|
||||||
bool g_flag_end_tx;
|
bool g_flag_end_tx;
|
||||||
uint16_t g_low_batteryCountdown;
|
uint16_t g_low_batteryCountdown;
|
||||||
|
8
misc.h
8
misc.h
@ -60,7 +60,9 @@ enum {
|
|||||||
enum {
|
enum {
|
||||||
FLASHLIGHT_OFF = 0,
|
FLASHLIGHT_OFF = 0,
|
||||||
FLASHLIGHT_ON,
|
FLASHLIGHT_ON,
|
||||||
FLASHLIGHT_BLINK
|
FLASHLIGHT_BLINK,
|
||||||
|
FLASHLIGHT_SOS,
|
||||||
|
FLASHLIGHT_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -300,8 +302,10 @@ extern bool g_cxcss_tail_found;
|
|||||||
extern uint16_t g_vox_pause_count_down;
|
extern uint16_t g_vox_pause_count_down;
|
||||||
#endif
|
#endif
|
||||||
extern bool g_squelch_open;
|
extern bool g_squelch_open;
|
||||||
|
|
||||||
extern uint8_t g_flash_light_state;
|
extern uint8_t g_flash_light_state;
|
||||||
extern volatile uint16_t g_flash_light_blink_counter;
|
extern uint16_t g_flash_light_blink_tick_10ms;
|
||||||
|
|
||||||
extern bool g_flag_end_tx;
|
extern bool g_flag_end_tx;
|
||||||
extern uint16_t g_low_batteryCountdown;
|
extern uint16_t g_low_batteryCountdown;
|
||||||
extern reception_mode_t g_rx_reception_mode;
|
extern reception_mode_t g_rx_reception_mode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user