From db381c14e056fdebc925294ed3b0248a371bd815 Mon Sep 17 00:00:00 2001 From: Master92 Date: Thu, 2 Nov 2023 08:41:54 +0100 Subject: [PATCH] Add cpp guard to all c headers --- src/bmi270/accel_gyro.h | 11 ++++++++++- src/bmi270/common.h | 8 ++++++++ src/core/MadgwickAHRS.h | 8 ++++++++ src/core/app_state.h | 10 +++++++++- src/core/battery.h | 10 +++++++++- src/core/common.hh | 8 ++++++++ src/core/dvr.h | 10 +++++++++- src/core/elrs.h | 10 +++++++++- src/core/esp32_flash.h | 10 +++++++++- src/core/ht.h | 10 +++++++++- src/core/input_device.h | 8 ++++++++ src/core/msp_displayport.h | 8 ++++++++ src/core/osd.h | 10 +++++++++- src/core/self_test.h | 8 ++++++++ src/core/settings.h | 8 ++++++++ src/core/thread.h | 9 +++++++++ src/driver/TP2825.h | 8 ++++++++ src/driver/beep.h | 8 ++++++++ src/driver/dm5680.h | 9 +++++++++ src/driver/dm6302.h | 8 ++++++++ src/driver/esp32.h | 10 +++++++++- src/driver/fans.h | 8 ++++++++ src/driver/fbtools.h | 8 ++++++++ src/driver/gpio.h | 8 ++++++++ src/driver/hardware.h | 8 ++++++++ src/driver/i2c.h | 8 ++++++++ src/driver/it66021.h | 11 ++++++++++- src/driver/it66121.h | 11 ++++++++++- src/driver/mcp3021.h | 8 ++++++++ src/driver/nct75.h | 8 ++++++++ src/driver/oled.h | 9 +++++++++ src/driver/rtc.h | 8 ++++++++ src/driver/uart.h | 9 +++++++++ src/player/adec2ao.h | 8 ++++++++ src/player/media.h | 9 +++++++++ src/record/ai2aenc.h | 8 ++++++++ src/record/ai2ao.h | 8 ++++++++ src/record/avshare.h | 8 ++++++++ src/record/disk.h | 8 ++++++++ src/record/ffmpeg.h | 8 ++++++++ src/record/ffpack.h | 8 ++++++++ src/record/jpegenc.h | 8 ++++++++ src/record/log.h | 8 ++++++++ src/record/record.h | 8 ++++++++ src/record/record_definitions.h | 8 ++++++++ src/record/spspps_patch.h | 8 ++++++++ src/record/vi2venc.h | 8 ++++++++ src/record/vi2venc_live.h | 8 ++++++++ src/rtspLive/stream/avshare.h | 8 ++++++++ src/ui/page_autoscan.h | 8 ++++++++ src/ui/page_clock.h | 8 ++++++++ src/ui/page_common.h | 8 ++++++++ src/ui/page_elrs.h | 8 ++++++++ src/ui/page_fans.h | 8 ++++++++ src/ui/page_focus_chart.h | 10 +++++++++- src/ui/page_headtracker.h | 8 ++++++++ src/ui/page_imagesettings.h | 8 ++++++++ src/ui/page_osd.h | 8 ++++++++ src/ui/page_playback.h | 8 ++++++++ src/ui/page_power.h | 8 ++++++++ src/ui/page_record.h | 8 ++++++++ src/ui/page_scannow.h | 9 +++++++++ src/ui/page_sleep.h | 10 +++++++++- src/ui/page_source.h | 8 ++++++++ src/ui/page_storage.h | 8 ++++++++ src/ui/page_version.h | 9 +++++++++ src/ui/page_wifi.h | 8 ++++++++ src/ui/ui_attribute.h | 9 +++++++++ src/ui/ui_image_setting.h | 10 +++++++++- src/ui/ui_keyboard.h | 8 ++++++++ src/ui/ui_main_menu.h | 8 ++++++++ src/ui/ui_osd_element_pos.h | 10 +++++++++- src/ui/ui_player.h | 10 +++++++++- src/ui/ui_porting.h | 8 ++++++++ src/ui/ui_statusbar.h | 8 ++++++++ src/ui/ui_style.h | 10 ++++++++++ src/util/math.h | 8 ++++++++ src/util/sdcard.h | 10 +++++++++- src/util/system.h | 8 ++++++++ src/util/time.h | 10 +++++++++- 80 files changed, 671 insertions(+), 18 deletions(-) diff --git a/src/bmi270/accel_gyro.h b/src/bmi270/accel_gyro.h index 1044cb24..55242942 100644 --- a/src/bmi270/accel_gyro.h +++ b/src/bmi270/accel_gyro.h @@ -1,5 +1,10 @@ #ifndef _ACCEL_GYRO_H #define _ACCEL_GYRO_H + +#ifdef __cplusplus +extern "C" { +#endif + #include "bmi2_defs.h" void init_bmi270(); @@ -16,4 +21,8 @@ float acc_to_g(int16_t val); float gyr_to_dps(int16_t gyr); -#endif //_ACCEL_GYRO_H \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif //_ACCEL_GYRO_H diff --git a/src/bmi270/common.h b/src/bmi270/common.h index 2dbff337..3b9668b5 100644 --- a/src/bmi270/common.h +++ b/src/bmi270/common.h @@ -1,6 +1,10 @@ #ifndef _COMMON_H #define _COMMON_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "bmi2.h" @@ -103,4 +107,8 @@ void bmi2_error_codes_print_result(int8_t rslt); * @return void. */ +#ifdef __cplusplus +} +#endif + #endif /* _COMMON_H */ diff --git a/src/core/MadgwickAHRS.h b/src/core/MadgwickAHRS.h index e9ae7e72..2f83c9c6 100644 --- a/src/core/MadgwickAHRS.h +++ b/src/core/MadgwickAHRS.h @@ -13,6 +13,10 @@ #ifndef MadgwickAHRS_h #define MadgwickAHRS_h +#ifdef __cplusplus +extern "C" { +#endif + #define AHRS_UPDATE_FREQUENCY 100 //--------------------------------------------------------------------------------------------------- @@ -23,6 +27,10 @@ float getRoll(); float getPitch(); float getYaw(); +#ifdef __cplusplus +} +#endif + #endif //===================================================================================================== // End of file diff --git a/src/core/app_state.h b/src/core/app_state.h index c606ef32..63ea1423 100644 --- a/src/core/app_state.h +++ b/src/core/app_state.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include typedef enum { @@ -35,4 +39,8 @@ void app_switch_to_menu(); void app_exit_menu(); void app_switch_to_analog(bool is_bay); void app_switch_to_hdmi_in(); -void app_switch_to_hdzero(bool is_default); \ No newline at end of file +void app_switch_to_hdzero(bool is_default); + +#ifdef __cplusplus +} +#endif diff --git a/src/core/battery.h b/src/core/battery.h index 3ef4941a..43b717cf 100644 --- a/src/core/battery.h +++ b/src/core/battery.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -19,4 +23,8 @@ void battery_update(); bool battery_is_low(); int battery_get_millivolts(bool per_cell); -void battery_get_voltage_str(char* buf); \ No newline at end of file +void battery_get_voltage_str(char* buf); + +#ifdef __cplusplus +} +#endif diff --git a/src/core/common.hh b/src/core/common.hh index 4fc53dd3..87e4a2c3 100644 --- a/src/core/common.hh +++ b/src/core/common.hh @@ -1,6 +1,10 @@ #ifndef __COMMON_HH__ #define __COMMON_HH__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -31,4 +35,8 @@ extern atomic_int g_key; extern atomic_int g_init_done; extern pthread_mutex_t lvgl_mutex; +#ifdef __cplusplus +} +#endif + #endif //__COMMON_HH__ diff --git a/src/core/dvr.h b/src/core/dvr.h index 2ebd4047..5c4d3ec0 100644 --- a/src/core/dvr.h +++ b/src/core/dvr.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -17,4 +21,8 @@ void dvr_update_status(); void dvr_select_audio_source(uint8_t audio_source); void dvr_enable_line_out(bool enable); void dvr_cmd(osd_dvr_cmd_t cmd); -void dvr_update_vi_conf(video_resolution_t fmt); \ No newline at end of file +void dvr_update_vi_conf(video_resolution_t fmt); + +#ifdef __cplusplus +} +#endif diff --git a/src/core/elrs.h b/src/core/elrs.h index 3ac36dcb..9defe344 100644 --- a/src/core/elrs.h +++ b/src/core/elrs.h @@ -1,6 +1,10 @@ #ifndef __ELRS_H__ #define __ELRS_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -82,4 +86,8 @@ void msp_cancel_await(); void msp_ht_update(uint16_t pan, uint16_t tilt, uint16_t roll); void msp_channel_update(); -#endif //__ELRS_H__ \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif //__ELRS_H__ diff --git a/src/core/esp32_flash.h b/src/core/esp32_flash.h index 0f203a3d..73490e6c 100644 --- a/src/core/esp32_flash.h +++ b/src/core/esp32_flash.h @@ -1,10 +1,18 @@ #ifndef __ESP32_FLASH_H__ #define __ESP32_FLASH_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "serial_io.h" #include esp_loader_error_t loader_port_init(); void loader_port_close(); -#endif //__ESP32_FLASH_H__ \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif //__ESP32_FLASH_H__ diff --git a/src/core/ht.h b/src/core/ht.h index 98200a5d..479329bd 100644 --- a/src/core/ht.h +++ b/src/core/ht.h @@ -1,6 +1,10 @@ #ifndef __HT_C__ #define __HT_C__ +#ifdef __cplusplus +extern "C" { +#endif + #define DEG_TO_RAD 0.017453295199 #define RAD_TO_DEG 57.29577951308 @@ -55,4 +59,8 @@ void ht_set_maxangle(int angle); void ht_set_center_position(); int16_t *ht_get_channels(); -#endif //__HT_C__ \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif //__HT_C__ diff --git a/src/core/input_device.h b/src/core/input_device.h index f1a573f4..16c21960 100644 --- a/src/core/input_device.h +++ b/src/core/input_device.h @@ -1,6 +1,10 @@ #ifndef _INPUT_DEVICE_H #define _INPUT_DEVICE_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef enum { @@ -14,4 +18,8 @@ void tune_channel_timer(); void exit_tune_channel(); void rbtn_click(right_button_t click_type); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/core/msp_displayport.h b/src/core/msp_displayport.h index 5981b263..d66241c2 100644 --- a/src/core/msp_displayport.h +++ b/src/core/msp_displayport.h @@ -1,6 +1,10 @@ #ifndef __MSP_DISPLAYPORT_H #define __MSP_DISPLAYPORT_H +#ifdef __cplusplus +extern "C" { +#endif + #include #define SD_HMAX 30 @@ -76,4 +80,8 @@ extern uint8_t osd_page_buf[HD_VMAX][7]; extern uint16_t last_rcv_seconds0; extern uint16_t last_rcv_seconds1; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/core/osd.h b/src/core/osd.h index eb5c8f2f..e99092ef 100644 --- a/src/core/osd.h +++ b/src/core/osd.h @@ -1,6 +1,10 @@ #ifndef _OSD_H #define _OSD_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -98,4 +102,8 @@ void load_fc_osd_font(uint8_t); void *thread_osd(void *ptr); void osd_resource_path(char *buf, const char *fmt, osd_resource_t osd_resource_type, ...); -#endif \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/core/self_test.h b/src/core/self_test.h index ef203182..dbda2fca 100644 --- a/src/core/self_test.h +++ b/src/core/self_test.h @@ -1,3 +1,11 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + void self_test(); + +#ifdef __cplusplus +} +#endif diff --git a/src/core/settings.h b/src/core/settings.h index 752c6a3e..db1aafce 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -252,3 +256,7 @@ int settings_put_osd_element(const setting_osd_goggle_element_t *element, char * int settings_put_osd_element_pos_y(const setting_osd_goggle_element_positions_t *pos, char *config_name); int settings_put_osd_element_pos_x(const setting_osd_goggle_element_positions_t *pos, char *config_name); int settings_put_osd_element_shown(bool show, char *config_name); + +#ifdef __cplusplus +} +#endif diff --git a/src/core/thread.h b/src/core/thread.h index 9f7a5b02..ecfe0d9f 100644 --- a/src/core/thread.h +++ b/src/core/thread.h @@ -1,6 +1,10 @@ #ifndef _THREAD_H #define _THREAD_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -15,4 +19,9 @@ typedef struct { } threads_obj_t; int create_threads(); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/TP2825.h b/src/driver/TP2825.h index c5821e35..3f6e1cbe 100644 --- a/src/driver/TP2825.h +++ b/src/driver/TP2825.h @@ -1,6 +1,10 @@ #ifndef _TP2825_H #define _TP2825_H +#ifdef __cplusplus +extern "C" { +#endif + #include void TP2825_close(); @@ -11,4 +15,8 @@ void TP2825_Switch_Mode(int is_pal); void TP2825_Switch_CH(uint8_t sel); // 0 = AV in; 1 = Module bay void TP2825_Set_Clamp(int); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/beep.h b/src/driver/beep.h index 821d1acd..d7227612 100644 --- a/src/driver/beep.h +++ b/src/driver/beep.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #define BEEP_VERY_SHORT 1 #define BEEP_SHORT 50 #define BEEP_LONG 200 @@ -8,3 +12,7 @@ void beep_init(void); void beep_dur(int ms); + +#ifdef __cplusplus +} +#endif diff --git a/src/driver/dm5680.h b/src/driver/dm5680.h index dedd71ab..395f75d3 100644 --- a/src/driver/dm5680.h +++ b/src/driver/dm5680.h @@ -1,6 +1,10 @@ #ifndef _DM5680_H #define _DM5680_H +#ifdef __cplusplus +extern "C" { +#endif + #include "dm6302.h" #include #include @@ -56,4 +60,9 @@ void DM5680_get_vldflg(uint8_t sel, uint8_t *payload); void DM5680_get_regval(uint8_t sel, uint8_t *payload); void DM5680_OSD_parse(uint8_t *buf, uint8_t len); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/dm6302.h b/src/driver/dm6302.h index a9653891..8d40d1d0 100644 --- a/src/driver/dm6302.h +++ b/src/driver/dm6302.h @@ -1,6 +1,10 @@ #ifndef __DM6302_H_ #define __DM6302_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -36,4 +40,8 @@ void DM6302_get_gain(uint8_t *gain); void DM6302_Init0(uint8_t sel); void SPI_Read(uint8_t page, uint16_t addr, uint32_t *dat0, uint32_t *dat1); +#ifdef __cplusplus +} +#endif + #endif // __DM6302_H_ diff --git a/src/driver/esp32.h b/src/driver/esp32.h index 9861e107..9d30f707 100644 --- a/src/driver/esp32.h +++ b/src/driver/esp32.h @@ -1,6 +1,10 @@ #ifndef __ESP32_H__ #define __ESP32_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "esp_loader.h" #include @@ -15,4 +19,8 @@ void esp32_handler_set_uart(uint32_t fd_uart); bool esp32_handler_process_byte(uint8_t byte); void esp32_handler_timeout(); // handle a character read timeout -#endif //__ESP32_H__ \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif //__ESP32_H__ diff --git a/src/driver/fans.h b/src/driver/fans.h index b1352817..a2578dd9 100644 --- a/src/driver/fans.h +++ b/src/driver/fans.h @@ -1,6 +1,10 @@ #ifndef _FANS_H #define _FANS_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef struct { @@ -15,4 +19,8 @@ void fans_right_setspeed(uint8_t speed); extern fan_speed_t fan_speed; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/fbtools.h b/src/driver/fbtools.h index e9a4ea77..a9863737 100644 --- a/src/driver/fbtools.h +++ b/src/driver/fbtools.h @@ -4,6 +4,10 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -24,3 +28,7 @@ int fb_close(PFBDEV pFbdev); int get_display_depth(PFBDEV pFbdev); void fb_memset(void *addr, int c, size_t len); void fb_sync(PFBDEV pFbdev); + +#ifdef __cplusplus +} +#endif diff --git a/src/driver/gpio.h b/src/driver/gpio.h index d9ed0167..9533f8d6 100644 --- a/src/driver/gpio.h +++ b/src/driver/gpio.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include void gpio_init(); @@ -7,3 +11,7 @@ void gpio_open(int port_num); void gpio_set(int port_num, bool val); void beep_dur(int ms); + +#ifdef __cplusplus +} +#endif diff --git a/src/driver/hardware.h b/src/driver/hardware.h index 92834b5b..c64dd1dd 100644 --- a/src/driver/hardware.h +++ b/src/driver/hardware.h @@ -1,6 +1,10 @@ #ifndef _HARDWARE_H #define _HARDWARE_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -88,4 +92,8 @@ void HDMI_in_detect(); int Get_VideoLatancy_status(); // ret: 0=unlocked, 1=locked int Get_HAN_status(); // ret: 0=error; 1=ok +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/i2c.h b/src/driver/i2c.h index 9d004120..0cadbd0e 100644 --- a/src/driver/i2c.h +++ b/src/driver/i2c.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include void iic_init(); @@ -49,3 +53,7 @@ int8_t i2c_write_n(int port, uint8_t slave_address, uint8_t addr, uint8_t *val, #define I2C_L_Write(s, a, d) i2c_write(3, s, a, d) #define I2C_L_Read(s, a) i2c_read(3, s, a) + +#ifdef __cplusplus +} +#endif diff --git a/src/driver/it66021.h b/src/driver/it66021.h index d821f7a4..0517d586 100644 --- a/src/driver/it66021.h +++ b/src/driver/it66021.h @@ -1,6 +1,10 @@ #ifndef _IT66021_H #define _IT66021_H +#ifdef __cplusplus +extern "C" { +#endif + void IT66021_srst(); void IT66021_close(); void IT66021_init(); @@ -10,4 +14,9 @@ int IT66021_Get_CS(); void IT66021_Set_CSMatrix(int cs); int IT66021_Get_PCLKFREQ(); void IT66021_edid(); -#endif \ No newline at end of file + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/driver/it66121.h b/src/driver/it66121.h index 9dafdddd..d5aca985 100644 --- a/src/driver/it66121.h +++ b/src/driver/it66121.h @@ -1,6 +1,15 @@ #ifndef _IT66121_H #define _IT66121_H +#ifdef __cplusplus +extern "C" { +#endif + void IT66121_close(); void IT66121_init(); -#endif \ No newline at end of file + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/driver/mcp3021.h b/src/driver/mcp3021.h index b0b829bf..fa66ea61 100644 --- a/src/driver/mcp3021.h +++ b/src/driver/mcp3021.h @@ -1,4 +1,12 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + void mcp3021_init(); int read_voltage(); + +#ifdef __cplusplus +} +#endif diff --git a/src/driver/nct75.h b/src/driver/nct75.h index fd1e9d6d..438ee17f 100644 --- a/src/driver/nct75.h +++ b/src/driver/nct75.h @@ -1,6 +1,10 @@ #ifndef _NCT75_H #define _NCT75_H +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { NCT_RIGHT = 0, NCT_TOP = 1, @@ -19,4 +23,8 @@ extern sys_temperature_t g_temperature; int nct_read_temperature(nct_type_t type); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/oled.h b/src/driver/oled.h index 71af761e..2fd7caf7 100644 --- a/src/driver/oled.h +++ b/src/driver/oled.h @@ -1,5 +1,10 @@ #ifndef _OLED_H #define _OLED_H + +#ifdef __cplusplus +extern "C" { +#endif + #include "defines.h" #include @@ -22,4 +27,8 @@ void MFPGA_Set540P60(); void MFPGA_Set1080P30(); void MFPGA_SetRatio(int ratio); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/driver/rtc.h b/src/driver/rtc.h index 085a0779..d0f1af8b 100644 --- a/src/driver/rtc.h +++ b/src/driver/rtc.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + /** * RTC Driver Interface. * @@ -79,3 +83,7 @@ int rtc_get_clock_log_str(char *buffer, int size); int rtc_get_clock_osd_str(char *date, int dsize, char *time, int tsize, char *format, int fsize); + +#ifdef __cplusplus +} +#endif diff --git a/src/driver/uart.h b/src/driver/uart.h index d9347dda..ba86e2f9 100644 --- a/src/driver/uart.h +++ b/src/driver/uart.h @@ -1,6 +1,10 @@ #ifndef __UART_H_ #define __UART_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #define UART_PORTS 4 @@ -11,4 +15,9 @@ int uart_write_byte(int fd, uint8_t data); void uart_close(int fd); int uart_read(int fd, uint8_t *data, int len); int uart_write(int fd, uint8_t *data, int len); + +#ifdef __cplusplus +} +#endif + #endif // __UART_H_ diff --git a/src/player/adec2ao.h b/src/player/adec2ao.h index 1d51efa9..80fd0cc5 100644 --- a/src/player/adec2ao.h +++ b/src/player/adec2ao.h @@ -1,6 +1,10 @@ #ifndef __ADEC2AO_H_ #define __ADEC2AO_H_ +#ifdef __cplusplus +extern "C" { +#endif + #ifndef EMULATOR_BUILD #include #endif @@ -65,4 +69,8 @@ ERRORTYPE adec2ao_checkEof(Adec2AoContext_t *aa); ERRORTYPE adec2ao_setAdecEof(Adec2AoContext_t *aa); bool adec2ao_isEOF(Adec2AoContext_t *aa); +#ifdef __cplusplus +} +#endif + #endif /* __AI2AENC_H_ */ diff --git a/src/player/media.h b/src/player/media.h index 441ee788..40868afc 100644 --- a/src/player/media.h +++ b/src/player/media.h @@ -1,6 +1,10 @@ #ifndef _MEDIA_H #define _MEDIA_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -36,4 +40,9 @@ typedef struct { media_t *media_instantiate(char *filename, notify_cb_t notify); void media_exit(media_t *media); void media_control(media_t *media, player_cmd_t *cmd); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/record/ai2aenc.h b/src/record/ai2aenc.h index e271ab6d..6599e562 100755 --- a/src/record/ai2aenc.h +++ b/src/record/ai2aenc.h @@ -1,6 +1,10 @@ #ifndef __AI2AENC_H_ #define __AI2AENC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -82,5 +86,9 @@ ERRORTYPE ai2aenc_prepare(Ai2Aenc_t* aa, AiParams_t* aiParams, AencParams_t* aeP ERRORTYPE ai2aenc_start(Ai2Aenc_t* aa); ERRORTYPE ai2aenc_stop(Ai2Aenc_t* aa, bool disableDev); +#ifdef __cplusplus +} +#endif + #endif /* __AI2AENC_H_ */ diff --git a/src/record/ai2ao.h b/src/record/ai2ao.h index 8688809e..edd029d5 100755 --- a/src/record/ai2ao.h +++ b/src/record/ai2ao.h @@ -1,6 +1,10 @@ #ifndef __AI2AO_H_ #define __AI2AO_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -47,5 +51,9 @@ ERRORTYPE ai2ao_start(Ai2Ao_t* aa, AiParams_t* aiParams); ERRORTYPE ai2ao_stop(Ai2Ao_t* aa, bool disableDev); bool ai2ao_playing(Ai2Ao_t* aa); +#ifdef __cplusplus +} +#endif + #endif /* __AI2AENC_H_ */ diff --git a/src/record/avshare.h b/src/record/avshare.h index b42b3de3..9aa29369 100644 --- a/src/record/avshare.h +++ b/src/record/avshare.h @@ -17,6 +17,10 @@ #ifndef _AVSHARE_H_ #define _AVSHARE_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -56,4 +60,8 @@ int avshare_disconnect(MediaType_e streamType); bool avshare_connected(MediaType_e streamType); void avshare_reset(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/record/disk.h b/src/record/disk.h index 7d99c91c..8d2734ac 100644 --- a/src/record/disk.h +++ b/src/record/disk.h @@ -1,6 +1,10 @@ #ifndef __DISK_H_ #define __DISK_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -24,4 +28,8 @@ void disk_sdstat_create(char* sPath, bool bThread); void disk_sdstat_delete(void); bool disk_sdstat(uint32_t mbFull, SdcardStatus_t* sds); +#ifdef __cplusplus +} +#endif + #endif // __DISK_H_ diff --git a/src/record/ffmpeg.h b/src/record/ffmpeg.h index 66de2e72..5b0ecc70 100644 --- a/src/record/ffmpeg.h +++ b/src/record/ffmpeg.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + //#include "libavutil/avutil.h" //#include "libavcodec/avcodec.h" #include "libavformat/avformat.h" @@ -12,3 +16,7 @@ #include #define Sleep(x) usleep(x * 1000) #endif + +#ifdef __cplusplus +} +#endif diff --git a/src/record/ffpack.h b/src/record/ffpack.h index 77030619..ebb8f089 100755 --- a/src/record/ffpack.h +++ b/src/record/ffpack.h @@ -1,6 +1,10 @@ #ifndef __FFPACK_H_ #define __FFPACK_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ffmpeg.h" @@ -65,4 +69,8 @@ int ffpack_inputStream(FFPack_t* ff, int streamIndex, void* stream, void* pkt); void ffpack_setParams(FFPack_t* ff, int streamIndex, void* param); int ffpack_setExtradata(FFPack_t* ff, int streamIndex, void* extradata, int extradataSize); +#ifdef __cplusplus +} +#endif + #endif //__FFPACK_H_ diff --git a/src/record/jpegenc.h b/src/record/jpegenc.h index 2cd0c50e..01cd28c0 100644 --- a/src/record/jpegenc.h +++ b/src/record/jpegenc.h @@ -1,6 +1,10 @@ #ifndef __JPEGENC_H_ #define __JPEGENC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #define PictureThumbQuality_DEFAULT 60 @@ -44,4 +48,8 @@ typedef struct JpegEncIO int jpegenc_encodeFrame(VIDEO_FRAME_INFO_S* frame, JpegEncConfig_t* config, CB_onJpegFrame cbOnFrame, void* context); int jpegenc_takePicture(JpegEncIO_t* io, JpegEncConfig_t* config, int32_t s32Millisec); +#ifdef __cplusplus +} +#endif + #endif /* __JPEGENC_H_ */ diff --git a/src/record/log.h b/src/record/log.h index dfd189ac..89dc4256 100644 --- a/src/record/log.h +++ b/src/record/log.h @@ -3,6 +3,10 @@ #ifndef __LOG_H__ #define __LOG_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -39,4 +43,8 @@ int log_write(LOGLEVEL loglevel,char *fromat, ...); uint32_t log_period(void); void log_close(void); +#ifdef __cplusplus +} +#endif + #endif /* __LOG_H__ */ diff --git a/src/record/record.h b/src/record/record.h index cfd93368..0c49968a 100644 --- a/src/record/record.h +++ b/src/record/record.h @@ -2,6 +2,10 @@ #ifndef __RECORD_H_ #define __RECORD_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "vi2venc.h" #include "ai2aenc.h" #include "ai2ao.h" @@ -96,4 +100,8 @@ typedef struct VencSpspps_t spspps; } RecordContext_t; +#ifdef __cplusplus +} +#endif + #endif /* __RECORD_H_ */ diff --git a/src/record/record_definitions.h b/src/record/record_definitions.h index 16cd0f2f..b46a99b4 100644 --- a/src/record/record_definitions.h +++ b/src/record/record_definitions.h @@ -1,6 +1,10 @@ #ifndef RECORD_DEFINITIONS_H_ #define RECORD_DEFINITIONS_H_ +#ifdef __cplusplus +extern "C" { +#endif + #define MAX_pathLEN 128 #define LOCKFILE "/tmp/record.pid" @@ -90,4 +94,8 @@ #define ZeroMemory(p, size) memset(p, 0, size) +#ifdef __cplusplus +} +#endif + #endif /* RECORD_DEFINITIONS_H_ */ diff --git a/src/record/spspps_patch.h b/src/record/spspps_patch.h index 1e35274b..4e0f349e 100644 --- a/src/record/spspps_patch.h +++ b/src/record/spspps_patch.h @@ -1,7 +1,15 @@ #ifndef __SPSPPS_PATCH_H_ #define __SPSPPS_PATCH_H_ +#ifdef __cplusplus +extern "C" { +#endif + int H264_Modify_SPS(uint8_t* src, int srcSize, int fps); int H265_Modify_SPS(uint8_t* src, int srcSize, int fps); +#ifdef __cplusplus +} +#endif + #endif /* __SPSPPS_PATCH_H_ */ diff --git a/src/record/vi2venc.h b/src/record/vi2venc.h index 774a1c03..abfa6e3c 100644 --- a/src/record/vi2venc.h +++ b/src/record/vi2venc.h @@ -1,6 +1,10 @@ #ifndef __VI2VENC_H_ #define __VI2VENC_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -224,5 +228,9 @@ ERRORTYPE vi2venc_requestIFrame(Vi2Venc_t* vv); char* vi2venc_getRcModeName(VencRateControlMode_e rcMode); char* vi2venc_getProfileName(VencProfile_e profile, bool h265); +#ifdef __cplusplus +} +#endif + #endif /* __VI2VENC_H_ */ diff --git a/src/record/vi2venc_live.h b/src/record/vi2venc_live.h index 8326f844..c041070b 100644 --- a/src/record/vi2venc_live.h +++ b/src/record/vi2venc_live.h @@ -1,11 +1,19 @@ #ifndef __VI2VENC_LIVE_H_ #define __VI2VENC_LIVE_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "vi2venc.h" Vi2Venc_t* vi2live_initSys(CB_onFrame cbOnFrame, void* context); void vi2live_deinitSys(Vi2Venc_t* vv); bool vi2live_started(Vi2Venc_t* vv); +#ifdef __cplusplus +} +#endif + #endif /* __VI2VENC_LIVE_H_ */ diff --git a/src/rtspLive/stream/avshare.h b/src/rtspLive/stream/avshare.h index 54704b06..272d681b 100644 --- a/src/rtspLive/stream/avshare.h +++ b/src/rtspLive/stream/avshare.h @@ -17,6 +17,10 @@ #ifndef _AVSHARE_H_ #define _AVSHARE_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -58,4 +62,8 @@ int avshare_readPipe(uint8_t* sFrameBuf, int nLen); bool avshare_start(void); void avshare_stop(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_autoscan.h b/src/ui/page_autoscan.h index 1ae6c322..a253767f 100644 --- a/src/ui/page_autoscan.h +++ b/src/ui/page_autoscan.h @@ -1,10 +1,18 @@ #ifndef _PAGE_AUTOSCAN_H #define _PAGE_AUTOSCAN_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" extern page_pack_t pp_autoscan; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_clock.h b/src/ui/page_clock.h index c595c6f0..e9d83799 100644 --- a/src/ui/page_clock.h +++ b/src/ui/page_clock.h @@ -1,5 +1,13 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include "ui/ui_main_menu.h" extern page_pack_t pp_clock; + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/page_common.h b/src/ui/page_common.h index 1136602f..7c105194 100644 --- a/src/ui/page_common.h +++ b/src/ui/page_common.h @@ -1,6 +1,10 @@ #ifndef _PAGE_COMMON_H #define _PAGE_COMMON_H +#ifdef __cplusplus +extern "C" { +#endif + #include "defines.h" #include "ui/ui_style.h" @@ -170,4 +174,8 @@ void set_select_item(const panel_arr_t *arr, int row); void slider_show(slider_group_t *slider_group, bool visible); void btn_group_show(btn_group_t *btn_group, bool visible); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_elrs.h b/src/ui/page_elrs.h index 03282dc9..54d46191 100644 --- a/src/ui/page_elrs.h +++ b/src/ui/page_elrs.h @@ -1,7 +1,15 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" extern page_pack_t pp_elrs; + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/page_fans.h b/src/ui/page_fans.h index 37038f8d..f27934bd 100644 --- a/src/ui/page_fans.h +++ b/src/ui/page_fans.h @@ -1,6 +1,10 @@ #ifndef _PAGE_FANS_H #define _PAGE_FANS_H +#ifdef __cplusplus +extern "C" { +#endif + #define MIN_FAN_TOP 1 #define MAX_FAN_TOP 5 #define MIN_FAN_SIDE 2 @@ -23,4 +27,8 @@ extern page_pack_t pp_fans; void step_topfan(); void fans_auto_ctrl(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_focus_chart.h b/src/ui/page_focus_chart.h index 7ceb8c87..631f52f3 100644 --- a/src/ui/page_focus_chart.h +++ b/src/ui/page_focus_chart.h @@ -1,7 +1,15 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" -extern page_pack_t pp_focus_chart; \ No newline at end of file +extern page_pack_t pp_focus_chart; + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/page_headtracker.h b/src/ui/page_headtracker.h index e158023a..0f4e2d99 100644 --- a/src/ui/page_headtracker.h +++ b/src/ui/page_headtracker.h @@ -1,10 +1,18 @@ #ifndef _PAGE_HEADTRACKER_H #define _PAGE_HEADTRACKER_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" extern page_pack_t pp_headtracker; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_imagesettings.h b/src/ui/page_imagesettings.h index 0b72e570..2c1cfe38 100644 --- a/src/ui/page_imagesettings.h +++ b/src/ui/page_imagesettings.h @@ -1,6 +1,10 @@ #ifndef _PAGE_IMAGESETTINGS_H #define _PAGE_IMAGESETTINGS_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" @@ -9,4 +13,8 @@ extern page_pack_t pp_imagesettings; void set_slider_value(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_osd.h b/src/ui/page_osd.h index 76c886cd..b6c1f9ad 100644 --- a/src/ui/page_osd.h +++ b/src/ui/page_osd.h @@ -1,9 +1,17 @@ #ifndef _PAGE_OSD_H #define _PAGE_OSD_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ui/ui_main_menu.h" extern page_pack_t pp_osd; void page_osd_update_ui_elements(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_playback.h b/src/ui/page_playback.h index 219c6c6c..af2b3bed 100644 --- a/src/ui/page_playback.h +++ b/src/ui/page_playback.h @@ -1,6 +1,10 @@ #ifndef _PAGE_PLAYBACK_H #define _PAGE_PLAYBACK_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" @@ -51,4 +55,8 @@ void pb_key(uint8_t key); int get_videofile_cnt(); void clear_videofile_cnt(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_power.h b/src/ui/page_power.h index 576b2e36..9379c3f5 100644 --- a/src/ui/page_power.h +++ b/src/ui/page_power.h @@ -1,8 +1,16 @@ #ifndef _PAGE_POWER_H #define _PAGE_POWER_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ui/ui_main_menu.h" extern page_pack_t pp_power; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_record.h b/src/ui/page_record.h index d1d0badd..261800cc 100644 --- a/src/ui/page_record.h +++ b/src/ui/page_record.h @@ -1,10 +1,18 @@ #ifndef _PAGE_RECORD_H #define _PAGE_RECORD_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" extern page_pack_t pp_record; +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_scannow.h b/src/ui/page_scannow.h index 5f35be8c..e59dba5d 100644 --- a/src/ui/page_scannow.h +++ b/src/ui/page_scannow.h @@ -1,6 +1,10 @@ #ifndef _PAGE_SCANNOW_H #define _PAGE_SCANNOW_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ui/ui_main_menu.h" #include @@ -17,4 +21,9 @@ void autoscan_exit(void); void page_scannow_set_channel_label(void); extern page_pack_t pp_scannow; + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_sleep.h b/src/ui/page_sleep.h index 8d974096..445339bd 100644 --- a/src/ui/page_sleep.h +++ b/src/ui/page_sleep.h @@ -1,7 +1,15 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" -extern page_pack_t pp_sleep; \ No newline at end of file +extern page_pack_t pp_sleep; + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/page_source.h b/src/ui/page_source.h index ce1fcfaa..0ac50c8a 100644 --- a/src/ui/page_source.h +++ b/src/ui/page_source.h @@ -1,6 +1,10 @@ #ifndef _PAGE_SOURCE_H #define _PAGE_SOURCE_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" @@ -9,4 +13,8 @@ extern page_pack_t pp_source; void source_status_timer(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_storage.h b/src/ui/page_storage.h index 99fa08d8..74a4f477 100644 --- a/src/ui/page_storage.h +++ b/src/ui/page_storage.h @@ -1,8 +1,16 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include "ui/ui_main_menu.h" extern page_pack_t pp_storage; bool page_storage_is_sd_repair_active(); void page_storage_init_auto_sd_repair(); + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/page_version.h b/src/ui/page_version.h index 9661de0f..366617c6 100644 --- a/src/ui/page_version.h +++ b/src/ui/page_version.h @@ -1,6 +1,10 @@ #ifndef _PAGE_VERSION_H #define _PAGE_VERSION_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include "ui/ui_main_menu.h" @@ -29,4 +33,9 @@ int generate_current_version(sys_version_t *sys_ver); void *thread_version(void *ptr); uint8_t command_monitor(char *cmd); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/page_wifi.h b/src/ui/page_wifi.h index ff8a5c57..69cad202 100644 --- a/src/ui/page_wifi.h +++ b/src/ui/page_wifi.h @@ -1,7 +1,15 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include "ui/ui_main_menu.h" extern page_pack_t pp_wifi; extern void page_wifi_get_statusbar_text(char *buffer, int size); + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/ui_attribute.h b/src/ui/ui_attribute.h index 58e16a99..2a166fee 100644 --- a/src/ui/ui_attribute.h +++ b/src/ui/ui_attribute.h @@ -1,6 +1,10 @@ #ifndef _UI_ATTRIBUTE_H #define _UI_ATTRIBUTE_H +#ifdef __cplusplus +extern "C" { +#endif + // #define TEST_STATUSBAR // #define TEST_SCANNOW @@ -205,4 +209,9 @@ /*menu->cont_version->cont*/ #define CONT_VERSION_WIDTH (PAGE_VERSION_WIDTH) #define CONT_VERSION_HEIGHT PAGE_VERSION_HEIGHT + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/ui_image_setting.h b/src/ui/ui_image_setting.h index 17b3a03e..f4590383 100644 --- a/src/ui/ui_image_setting.h +++ b/src/ui/ui_image_setting.h @@ -1,6 +1,10 @@ #ifndef __IMAGESETTING_H__ #define __IMAGESETTING_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -42,4 +46,8 @@ uint8_t ims_key(uint8_t key); void ims_update(); void ims_save(); -#endif \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/ui/ui_keyboard.h b/src/ui/ui_keyboard.h index fd97d6ae..117f44e7 100644 --- a/src/ui/ui_keyboard.h +++ b/src/ui/ui_keyboard.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -49,3 +53,7 @@ void keyboard_set_text(const char *text); * the number of characters written into buffer. */ int keyboard_get_text(char *buffer, const uint32_t size); + +#ifdef __cplusplus +} +#endif diff --git a/src/ui/ui_main_menu.h b/src/ui/ui_main_menu.h index 966edfd4..f1f058d4 100644 --- a/src/ui/ui_main_menu.h +++ b/src/ui/ui_main_menu.h @@ -1,6 +1,10 @@ #ifndef __MAIN_MENU_H__ #define __MAIN_MENU_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -49,4 +53,8 @@ void submenu_click(void); void submenu_right_button(bool is_short); void progress_bar_update(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/ui_osd_element_pos.h b/src/ui/ui_osd_element_pos.h index 3a8c22c7..b2ec1584 100644 --- a/src/ui/ui_osd_element_pos.h +++ b/src/ui/ui_osd_element_pos.h @@ -1,6 +1,10 @@ #ifndef __OSDELEMENTPOS_H__ #define __OSDELEMENTPOS_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -12,4 +16,8 @@ void ui_osd_element_pos_on_enter(); void ui_osd_element_pos_cancel_and_hide(); int ui_osd_element_pos_handle_input(int key); -#endif \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/ui/ui_player.h b/src/ui/ui_player.h index cfeee6c5..6dff0f97 100644 --- a/src/ui/ui_player.h +++ b/src/ui/ui_player.h @@ -1,6 +1,10 @@ #ifndef __MPLAYER_H__ #define __MPLAYER_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -39,4 +43,8 @@ uint8_t mplayer_on_key(uint8_t key); void mplayer_set_time(uint32_t now, uint32_t duration); void mplayer_file(char *fname); -#endif \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/ui/ui_porting.h b/src/ui/ui_porting.h index 7fab70a9..85b1d745 100644 --- a/src/ui/ui_porting.h +++ b/src/ui/ui_porting.h @@ -1,6 +1,10 @@ #ifndef _PORTING_H #define _PORTING_H +#ifdef __cplusplus +extern "C" { +#endif + #include #define DISP_OVERSCAN 8 @@ -18,4 +22,8 @@ int lvgl_switch_to_720p(); int lvgl_switch_to_1080p(); void lvgl_screen_orbit(bool enable); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/ui_statusbar.h b/src/ui/ui_statusbar.h index addb224d..0909ebb5 100644 --- a/src/ui/ui_statusbar.h +++ b/src/ui/ui_statusbar.h @@ -1,7 +1,15 @@ #ifndef __STATUSBAR_H__ #define __STATUSBAR_H__ +#ifdef __cplusplus +extern "C" { +#endif + int statusbar_init(void); void statubar_update(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/ui/ui_style.h b/src/ui/ui_style.h index 92bffd88..d928f8ee 100644 --- a/src/ui/ui_style.h +++ b/src/ui/ui_style.h @@ -1,5 +1,10 @@ #ifndef _STYLE_H #define _STYLE_H + +#ifdef __cplusplus +extern "C" { +#endif + #include "lvgl/lvgl.h" enum KB_STYLE { @@ -28,4 +33,9 @@ extern lv_style_t style_keyboard[KB_STYLE_COUNT]; extern lv_style_t style_pb, style_pb_dark; int style_init(void); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/util/math.h b/src/util/math.h index b2426376..a98e00c1 100644 --- a/src/util/math.h +++ b/src/util/math.h @@ -1,6 +1,10 @@ #ifndef __UTIL_MATH_H__ #define __UTIL_MATH_H__ +#ifdef __cplusplus +extern "C" { +#endif + #define constrain(value, min, max) \ (value < min ? min : (value > max ? max : value)) @@ -11,4 +15,8 @@ float normalize(float value, float start, float end); void rotate(float pn[3], const float rot[3]); void safe_update_value(int min, int max, int *val, int delta); +#ifdef __cplusplus +} +#endif + #endif // __UTIL_MATH_H__ \ No newline at end of file diff --git a/src/util/sdcard.h b/src/util/sdcard.h index 0c497675..e094e86f 100644 --- a/src/util/sdcard.h +++ b/src/util/sdcard.h @@ -1,9 +1,17 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #define SD_BLOCK_DEVICE "/dev/mmcblk0" bool sdcard_mounted(); -bool sdcard_inserted(); \ No newline at end of file +bool sdcard_inserted(); + +#ifdef __cplusplus +} +#endif diff --git a/src/util/system.h b/src/util/system.h index b333b4c2..e6f7823e 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -1,4 +1,12 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + int system_exec(const char *command); int system_script(const char *script); + +#ifdef __cplusplus +} +#endif diff --git a/src/util/time.h b/src/util/time.h index 246fb97a..bc547787 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -1,6 +1,14 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include uint32_t time_ms(); -uint32_t time_s(); \ No newline at end of file +uint32_t time_s(); + +#ifdef __cplusplus +} +#endif