diff options
Diffstat (limited to '')
-rw-r--r-- | mcc_generated_files/interrupt_manager.c (renamed from mcc_generated_files/interrupt_manager.cpp) | 7 | ||||
-rw-r--r-- | mcc_generated_files/interrupt_manager.h (renamed from mcc_generated_files/interrupt_manager.hpp) | 8 | ||||
-rw-r--r-- | mcc_generated_files/mcc.c (renamed from mcc_generated_files/mcc.cpp) | 18 | ||||
-rw-r--r-- | mcc_generated_files/mcc.h (renamed from mcc_generated_files/mcc.hpp) | 15 | ||||
-rw-r--r-- | mcc_generated_files/pin_manager.c (renamed from mcc_generated_files/pin_manager.cpp) | 11 | ||||
-rw-r--r-- | mcc_generated_files/pin_manager.h (renamed from mcc_generated_files/pin_manager.hpp) | 9 | ||||
-rw-r--r-- | mcc_generated_files/uart1.c (renamed from mcc_generated_files/uart1.cpp) | 22 | ||||
-rw-r--r-- | mcc_generated_files/uart1.h (renamed from mcc_generated_files/uart1.hpp) | 11 |
8 files changed, 76 insertions, 25 deletions
diff --git a/mcc_generated_files/interrupt_manager.cpp b/mcc_generated_files/interrupt_manager.c index 32ca3f4..67c5d29 100644 --- a/mcc_generated_files/interrupt_manager.cpp +++ b/mcc_generated_files/interrupt_manager.c @@ -42,6 +42,9 @@ MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
TERMS.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
Section: Includes
@@ -65,3 +68,7 @@ void INTERRUPT_Initialize (void) __builtin_mtc0(12,0,(__builtin_mfc0(12,0) | 0x0001));
}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/mcc_generated_files/interrupt_manager.hpp b/mcc_generated_files/interrupt_manager.h index a01aacd..83dac16 100644 --- a/mcc_generated_files/interrupt_manager.hpp +++ b/mcc_generated_files/interrupt_manager.h @@ -46,6 +46,10 @@ #ifndef _INTERRUPT_MANAGER_H
#define _INTERRUPT_MANAGER_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
@Summary
Initializes the interrupt priorities of the PIC32MX470F512H
@@ -75,4 +79,8 @@ */
void INTERRUPT_Initialize(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif
\ No newline at end of file diff --git a/mcc_generated_files/mcc.cpp b/mcc_generated_files/mcc.c index 3d34379..7f3a675 100644 --- a/mcc_generated_files/mcc.cpp +++ b/mcc_generated_files/mcc.c @@ -80,7 +80,11 @@ #pragma config BWP = OFF // Boot Flash Write Protect bit->Protection Disabled
#pragma config CP = OFF // Code Protect->Protection Disabled
-#include "mcc.hpp"
+#include "mcc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
@Summary
@@ -90,7 +94,7 @@ This array identifies the cause for exception.
*/
-static char *cause[] =
+static const char *cause[] =
{
"Interrupt", "Undefined", "Undefined", "Undefined",
"Load/fetch address error", "Store address error",
@@ -140,17 +144,17 @@ void _general_exception_handler () Refer to the MIPs Software User's manual */
uint8_t _excep_code;
uint8_t _excep_addr;
- uint8_t *_cause_str;
+ const uint8_t *_cause_str;
_excep_code = (_CP0_GET_CAUSE() & 0x0000007C) >> 2;
_excep_addr = _CP0_GET_EPC();
- _cause_str = reinterpret_cast<uint8_t*>(cause[_excep_code]);
+ _cause_str = cause[_excep_code];
while(1) {
}
}
-/**
- End of File
-*/
\ No newline at end of file +#ifdef __cplusplus
+}
+#endif
\ No newline at end of file diff --git a/mcc_generated_files/mcc.hpp b/mcc_generated_files/mcc.h index fe747b5..8fc44bf 100644 --- a/mcc_generated_files/mcc.hpp +++ b/mcc_generated_files/mcc.h @@ -45,12 +45,17 @@ #ifndef MCC_H
#define MCC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <xc.h>
-#include "pin_manager.hpp"
+#include "pin_manager.h"
#include <stdint.h>
#include <stdbool.h>
-#include "uart1.hpp"
-#include "interrupt_manager.hpp"
+#include "uart1.h"
+#include "interrupt_manager.h"
#define _XTAL_FREQ 8000000UL
@@ -128,6 +133,10 @@ void OSCILLATOR_Initialize(void); void _general_exception_handler (void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* MCC_H */
/**
End of File
diff --git a/mcc_generated_files/pin_manager.cpp b/mcc_generated_files/pin_manager.c index 6124d56..b0d4a93 100644 --- a/mcc_generated_files/pin_manager.cpp +++ b/mcc_generated_files/pin_manager.c @@ -49,10 +49,14 @@ /**
Section: Includes
*/
+#include "pin_manager.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "mcc.h"
#include <xc.h>
#include <sys/attribs.h>
-#include "pin_manager.hpp"
-#include "mcc.hpp"
/**
void PIN_MANAGER_Initialize(void)
@@ -129,3 +133,6 @@ void PIN_MANAGER_Initialize(void) }
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file diff --git a/mcc_generated_files/pin_manager.hpp b/mcc_generated_files/pin_manager.h index 650fe9a..f79a0ec 100644 --- a/mcc_generated_files/pin_manager.hpp +++ b/mcc_generated_files/pin_manager.h @@ -47,6 +47,11 @@ #ifndef _PIN_MANAGER_H
#define _PIN_MANAGER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
Section: Includes
*/
@@ -527,4 +532,8 @@ */
void PIN_MANAGER_Initialize(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/mcc_generated_files/uart1.cpp b/mcc_generated_files/uart1.c index 96ed3e3..bf35ee3 100644 --- a/mcc_generated_files/uart1.cpp +++ b/mcc_generated_files/uart1.c @@ -47,7 +47,11 @@ Section: Included Files
*/
-#include "uart1.hpp"
+#include "uart1.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
Section: Data Type Definitions
@@ -59,7 +63,7 @@ Defines the object required for the status of the queue.
*/
-union UART_BYTEQ_STATUS
+typedef union
{
struct
{
@@ -68,7 +72,7 @@ union UART_BYTEQ_STATUS uint8_t reserved:6;
} s;
uint8_t status;
-};
+} UART_BYTEQ_STATUS;
/** UART Driver Hardware Instance Object
@@ -76,7 +80,7 @@ union UART_BYTEQ_STATUS Defines the object required for the maintenance of the hardware instance.
*/
-struct UART_OBJECT
+typedef struct
{
/* RX Byte Q */
uint8_t *rxTail;
@@ -88,7 +92,7 @@ struct UART_OBJECT UART_BYTEQ_STATUS rxStatus;
UART_BYTEQ_STATUS txStatus;
-};
+} UART_OBJECT;
static UART_OBJECT uart1_obj;
@@ -326,7 +330,7 @@ UART1_TRANSFER_STATUS UART1_TransferStatusGet (void) status |= UART1_TRANSFER_STATUS_RX_DATA_PRESENT;
}
- return static_cast<UART1_TRANSFER_STATUS>(status);
+ return (UART1_TRANSFER_STATUS) status;
}
@@ -380,7 +384,7 @@ bool UART1_TransmitBufferIsFull(void) UART1_STATUS UART1_StatusGet (void)
{
- return static_cast<UART1_STATUS>(U1STA);
+ return (UART1_STATUS) U1STA;
}
@@ -388,3 +392,7 @@ UART1_STATUS UART1_StatusGet (void) /**
End of File
*/
+
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file diff --git a/mcc_generated_files/uart1.hpp b/mcc_generated_files/uart1.h index db61d1e..bd3971a 100644 --- a/mcc_generated_files/uart1.hpp +++ b/mcc_generated_files/uart1.h @@ -46,6 +46,10 @@ #ifndef _UART1_H
#define _UART1_H
+#ifdef __cplusplus // Provide C++ Compatibility
+ extern "C" {
+#endif
+
/**
Section: Included Files
*/
@@ -55,11 +59,6 @@ #include <stdint.h>
#include <stdlib.h>
#include <sys/attribs.h>
-#ifdef __cplusplus // Provide C++ Compatibility
-
- extern "C" {
-
-#endif
/**
Section: Data Types
@@ -159,7 +158,7 @@ void _UART_1(void); @Description
This routine initializes the UART driver instance for : 1
- index.
+ index.0x8008
This routine must be called before any other UART routine is called.
@Preconditions
|