From 683cf43f4b117b09080efad5a1716d50ba80b232 Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Fri, 22 Nov 2019 15:24:36 +0100 Subject: [PATCH] c++ "guards" to all includes, configuring c++ include paths --- consolehandler.h | 14 +++++++++++--- crcscheduler.h | 8 ++++++++ dmahelper.h | 8 ++++++++ memcpydma.h | 8 ++++++++ packetusart.h | 8 ++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/consolehandler.h b/consolehandler.h index c9a0167..1d839b0 100644 --- a/consolehandler.h +++ b/consolehandler.h @@ -5,16 +5,24 @@ * Author: abody */ -#ifndef INTERRUPT_HANDLERS_H_ -#define INTERRUPT_HANDLERS_H_ +#ifndef CONSOLEHANDLER_H_ +#define CONSOLEHANDLER_H_ #include "usart.h" #include "f4ll_c/dmahelper.h" #include "f4ll_c/packetusart.h" +#ifdef __cplusplus +extern "C" { +#endif + void Con_HandleTxDmaIrq(struct dmainfo_t *info, USART_TypeDef *usart); void Con_HandleUsartIrq(USART_TypeDef *usart); void Con_PrintStats(char *buffer, uint8_t id, struct usart_stats *stats, USART_TypeDef *usart, struct dmainfo_t *dmaInfo); -#endif /* INTERRUPT_HANDLERS_H_ */ +#ifdef __cplusplus +} +#endif + +#endif /* CONSOLEHANDLER_H_ */ diff --git a/crcscheduler.h b/crcscheduler.h index 6bfa84c..3b117da 100644 --- a/crcscheduler.h +++ b/crcscheduler.h @@ -17,6 +17,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct crcslottask_t { void * volatile address; uint16_t wordCount; @@ -61,4 +65,8 @@ void Crc_ComputeAsync(struct crcstatus_t *status, uint8_t slot, void (*callback)(void*, uint32_t, uint8_t), void* callbackParam); void Crc_HandleDmaIrq(struct crcstatus_t *status); +#ifdef __cplusplus +} +#endif + #endif /* CRC_HANDLER_H_ */ diff --git a/dmahelper.h b/dmahelper.h index 221a4f2..ed7fb26 100644 --- a/dmahelper.h +++ b/dmahelper.h @@ -10,6 +10,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct dmainfo_t { DMA_TypeDef *dma; uint32_t stream; @@ -32,4 +36,8 @@ uint32_t Dma_GetFeMask(uint32_t stream); void Dma_Init(struct dmainfo_t *info, DMA_TypeDef *dma, uint32_t stream); +#ifdef __cplusplus +} +#endif + #endif /* DMA_HELPER_H_ */ diff --git a/memcpydma.h b/memcpydma.h index b67573e..8859d63 100644 --- a/memcpydma.h +++ b/memcpydma.h @@ -11,8 +11,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + void Mcd_Init(DMA_TypeDef *dma, uint32_t stream); void * Mcd_Copy(void *dst, void const *src, size_t length); void Mcd_HandleDmaIrq(); +#ifdef __cplusplus +} +#endif + #endif /* MEMCPY_DMA_H_ */ diff --git a/packetusart.h b/packetusart.h index 8c4f202..fc168ea 100644 --- a/packetusart.h +++ b/packetusart.h @@ -12,6 +12,10 @@ #include "f4ll_c/dmahelper.h" +#ifdef __cplusplus +extern "C" { +#endif + struct usart_buffer_t; struct usartstatus_t; @@ -139,4 +143,8 @@ static inline void StatsAddSkiped(struct usart_stats *s, uint8_t cnt) { #define StatsAddSkiped(x) #endif // USART_STATS_DISABLED +#ifdef __cplusplus +} +#endif + #endif /* UART_HANDLER_H_ */