Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSDK-1022: Fix C++ build issue #350

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Libraries/MAXUSB/include/core/arm/usb_hwopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@
*
*
******************************************************************************/

#ifndef _USBIO_HWOPT_H_
#define _USBIO_HWOPT_H_

#include "mxc_device.h"
#include "usb_regs.h"

#ifdef __cplusplus
extern "C" {
#endif

/* There are no configuration options for this target */
typedef void maxusb_cfg_options_t;

Expand Down Expand Up @@ -68,4 +72,8 @@ static inline void MXC_USB_RemoteWakeup(void)
MXC_USB->dev_cn |= MXC_F_USB_DEV_CN_SIGRWU;
}

#ifdef __cplusplus
}
#endif

#endif /* _USBIO_HWOPT_H_ */
7 changes: 7 additions & 0 deletions Libraries/MAXUSB/include/core/maxq/usb_hwopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#ifndef _USBIO_HWOPT_H_
#define _USBIO_HWOPT_H_

#ifdef __cplusplus
extern "C" {
#endif

/* There are no configuration options for this target */
typedef void maxusb_cfg_options_t;

Expand All @@ -46,5 +50,8 @@ typedef void maxusb_cfg_options_t;
#define MAXUSB_EXIT_CRITICAL() __enable_interrupt()
#endif

#ifdef __cplusplus
}
#endif

#endif /* _USBIO_HWOPT_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/core/maxq/usbio_maxq.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@
*
******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

int usbio_writereg(unsigned int reg, uint16_t data);
int usbio_readreg(unsigned int reg, uint16_t *data);
void usbio_blind_writereg(unsigned int reg, uint16_t data);
int usbio_readfifo(unsigned int reg, uint8_t *data, unsigned int num);
int usbio_writefifo(unsigned int reg, uint8_t *data, unsigned int num);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/core/musbhsfc/usb_hwopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#include "mxc_device.h"
#include "usbhs_regs.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Configuration options for MUSBHSFC */
typedef struct {
unsigned int enable_hs; /* 0 = full-speed only, otherwise high-speed if negotiated */
Expand Down Expand Up @@ -71,4 +75,8 @@ void MXC_USB_RemoteWakeup(void);
*/
void MXC_USB_DmaIsr(void);

#ifdef __cplusplus
}
#endif

#endif /* _USBIO_HWOPT_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/core/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#include "usb_hwopt.h"
#include "usb_protocol.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @file usb.h
* @brief Defines the API used to abstract USB hardware away from upper layers.
Expand Down Expand Up @@ -404,4 +408,8 @@ int MXC_USB_ReadEndpoint(MXC_USB_Req_t *req);
*/
int MXC_USB_TestMode(unsigned int value);

#ifdef __cplusplus
}
#endif

#endif /* _USB_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/core/usb_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@

#include "usb.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @file MXC_USB_event.h
* @brief Defines the API used for USB event handling
Expand Down Expand Up @@ -88,4 +92,8 @@ int MXC_USB_EventClear(maxusb_event_t event);
*/
void MXC_USB_EventHandler(void);

#ifdef __cplusplus
}
#endif

#endif /* _USB_EVENT_H_ */
7 changes: 7 additions & 0 deletions Libraries/MAXUSB/include/core/usb_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/* SETUP message byte offsets */
#define SETUP_bmRequestType 0
#define SETUP_bRequest 1
Expand Down Expand Up @@ -205,5 +209,8 @@ typedef __packed struct {
uint8_t bMaxPower;
} MXC_USB_other_speed_configuration_descriptor_t;

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/dbg_log/dbg_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#ifndef _LOGGER_H_
#define _LOGGER_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
DBG_EVT_START = 0,
DBG_EVT_RESET,
Expand Down Expand Up @@ -77,4 +81,8 @@ int dbg_log_init(void);
int dbg_log_add(uint32_t t, dbg_evt_type_t e, uint32_t e_p, char *txt);
void dbg_log_print(int num);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/devclass/cdc_acm.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

#include "usb_protocol.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @file cdc_acm.h
* @brief Communications Device Class ACM (Serial Port) over USB.
Expand Down Expand Up @@ -165,4 +169,8 @@ int acm_read(uint8_t *buf, unsigned int len);
*/
int acm_write(uint8_t *buf, unsigned int len);

#ifdef __cplusplus
}
#endif

#endif /* _CDC_ACM_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/devclass/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/***** Definitions *****/

/// Structure used for FIFO management
Expand Down Expand Up @@ -139,4 +143,8 @@ unsigned int fifo_level(fifo_t * fifo);
*/
unsigned int fifo_remaining(fifo_t * fifo);

#ifdef __cplusplus
}
#endif

#endif /* _FIFO_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/devclass/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @file hid.h
* @brief Human Interface Device Class
Expand Down Expand Up @@ -69,4 +73,8 @@ typedef __packed struct {
uint16_t wDescriptorLength;
} hid_descriptor_t;

#ifdef __cplusplus
}
#endif

#endif /* _HID_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/devclass/hid_kbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
#include "usb_protocol.h"
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* \brief Initialize the class driver
* \details Initialize the class driver.
Expand Down Expand Up @@ -87,4 +91,8 @@ int hidkbd_keypress(uint8_t key);
*/
int hidkbd_encode_report(uint8_t *rpt, uint8_t *ascii, int num);

#ifdef __cplusplus
}
#endif

#endif /* _HID_KBD_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/devclass/hid_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#ifndef _HID_RAW_H_
#define _HID_RAW_H_

#ifdef __cplusplus
extern "C" {
#endif

/**
* @file hid_raw.h
* @brief Raw Human Interface Device Class over USB
Expand Down Expand Up @@ -111,4 +115,8 @@ int hidraw_read(uint8_t *data, unsigned int len);
*/
int hidraw_write(const uint8_t *data, unsigned int len);

#ifdef __cplusplus
}
#endif

#endif /* _HID_RAW_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/devclass/msc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#ifndef _MSC_H_
#define _MSC_H_

#ifdef __cplusplus
extern "C" {
#endif

/**
* @file MSC.h
* @brief Mass Storage Class over USB.
Expand Down Expand Up @@ -112,4 +116,8 @@ int msc_configure(const msc_cfg_t *cfg);
*/
int msc_deconfigure(void);

#ifdef __cplusplus
}
#endif

#endif /* _MSC_H_ */
8 changes: 8 additions & 0 deletions Libraries/MAXUSB/include/enumerate/enumerate.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

#include <usb_protocol.h>

#ifdef __cplusplus
extern "C" {
#endif

/// User can register callbacks for various control endpoint requests
typedef enum {
ENUM_CLASS_REQ,
Expand Down Expand Up @@ -132,4 +136,8 @@ uint8_t enum_getconfig(void);
*/
void enum_clearconfig(void);

#ifdef __cplusplus
}
#endif

#endif
8 changes: 8 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32520/mxc_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @ingroup devicelibs
* @defgroup MXC_delay Delay Utility Functions
Expand Down Expand Up @@ -129,4 +133,8 @@ void MXC_DelayHandler(void);

/**@} end of group MXC_delay */

#ifdef __cplusplus
}
#endif

#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32520_MXC_DELAY_H_
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32520/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#include "mxc_pins.h"
#include "mxc_lock.h"

#ifdef __cplusplus
extern "C" {
#endif

/***** Definitions *****/

/**
Expand Down
8 changes: 8 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32570/mxc_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @ingroup devicelibs
* @defgroup MXC_delay Delay Utility Functions
Expand Down Expand Up @@ -129,4 +133,8 @@ void MXC_DelayHandler(void);

/**@} end of group MXC_delay */

#ifdef __cplusplus
}
#endif

#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32570_MXC_DELAY_H_
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32570/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#include "mxc_pins.h"
#include "mxc_lock.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @defgroup spi Serial Peripheral Interface (SPI)
* @ingroup periphlibs
Expand Down
8 changes: 8 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32572/mxc_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @ingroup devicelibs
* @defgroup MXC_delay Delay Utility Functions
Expand Down Expand Up @@ -129,4 +133,8 @@ void MXC_DelayHandler(void);

/**@} end of group MXC_delay */

#ifdef __cplusplus
}
#endif

#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32572_MXC_DELAY_H_
4 changes: 4 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32572/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#include "mxc_pins.h"
#include "mxc_lock.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @defgroup spi Serial Peripheral Interface (SPI)
* @ingroup periphlibs
Expand Down
Loading