7 #include "common/crc.h"
8 #include "common/maths.h"
9 #include "common/streambuf.h"
10 #include "common/utils.h"
12 #include "build/build_config.h"
14 #include "config/parameter_group.h"
15 #include "config/parameter_group_ids.h"
16 #include "fc/settings.h"
17 #include "fc/runtime_config.h"
19 #include "drivers/time.h"
20 #include "drivers/light_ws2811strip.h"
22 #include "io/serial.h"
23 #include "io/rcdevice.h"
25 #include "osd_joystick.h"
31 PG_REGISTER_WITH_RESET_TEMPLATE(osdJoystickConfig_t
, osdJoystickConfig
, PG_OSD_JOYSTICK_CONFIG
, 0);
33 PG_RESET_TEMPLATE(osdJoystickConfig_t
, osdJoystickConfig
,
34 .osd_joystick_enabled
= SETTING_OSD_JOYSTICK_ENABLED_DEFAULT
,
35 .osd_joystick_down
= SETTING_OSD_JOYSTICK_DOWN_DEFAULT
,
36 .osd_joystick_up
= SETTING_OSD_JOYSTICK_UP_DEFAULT
,
37 .osd_joystick_left
= SETTING_OSD_JOYSTICK_LEFT_DEFAULT
,
38 .osd_joystick_right
= SETTING_OSD_JOYSTICK_RIGHT_DEFAULT
,
39 .osd_joystick_enter
= SETTING_OSD_JOYSTICK_ENTER_DEFAULT
42 bool osdJoystickEnabled(void) {
43 return osdJoystickConfig()->osd_joystick_enabled
;
47 void osdJoystickSimulate5KeyButtonPress(uint8_t operation
) {
49 case RCDEVICE_CAM_KEY_ENTER
:
50 ledPinStartPWM( osdJoystickConfig()->osd_joystick_enter
);
52 case RCDEVICE_CAM_KEY_LEFT
:
53 ledPinStartPWM( osdJoystickConfig()->osd_joystick_left
);
55 case RCDEVICE_CAM_KEY_UP
:
56 ledPinStartPWM( osdJoystickConfig()->osd_joystick_up
);
58 case RCDEVICE_CAM_KEY_RIGHT
:
59 ledPinStartPWM( osdJoystickConfig()->osd_joystick_right
);
61 case RCDEVICE_CAM_KEY_DOWN
:
62 ledPinStartPWM( osdJoystickConfig()->osd_joystick_down
);
68 void osdJoystickSimulate5KeyButtonRelease(void) {