Skip to content

Commit 99fb05d

Browse files
facchinmaentinger
authored andcommitted
Fix compilation
* Rename c files to cpp * Fix a lot of cast issues * Fix include paths * Move to src to trigger subfolder compilation * Add some defines in config.h (not sure everything's needed)
1 parent 6f672af commit 99fb05d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+260
-387
lines changed

libraries/ENVIE_Video_Firefly/debug/SerialISR.c

Lines changed: 0 additions & 75 deletions
This file was deleted.

libraries/ENVIE_Video_Firefly/debug/serial.c

Lines changed: 0 additions & 171 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=Enve Video Firefly
2+
version=1.0
3+
author=Arduino
4+
maintainer=Arduino <info@arduino.cc>
5+
sentence=Wrapper for analogix anx chip
6+
paragraph=
7+
category=Other
8+
url=
9+
architectures=mbed,ArduinoCore-mbed

libraries/ENVIE_Video_Firefly/EEPROM/HexFile.c renamed to libraries/ENVIE_Video_Firefly/src/EEPROM/HexFile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Revision History:
2323
#include <stdio.h>
2424
#include "HexFile.h"
2525

26-
char GetLineData(unsigned char *pLine, unsigned char data *pByteCount, unsigned int data *pAddress, unsigned char data *pRecordType, unsigned char *pData)
26+
char GetLineData(unsigned char *pLine, unsigned char *pByteCount, unsigned int *pAddress, unsigned char *pRecordType, unsigned char *pData)
2727
{
2828
char start_code;
2929
unsigned char checksum;

libraries/ENVIE_Video_Firefly/EEPROM/HexFile.h renamed to libraries/ENVIE_Video_Firefly/src/EEPROM/HexFile.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ Revision History:
2626
#define HEX_RECORD_TYPE_DATA 0
2727
#define HEX_RECORD_TYPE_EOF 1
2828

29-
char GetLineData(unsigned char *pLine, unsigned char data *pByteCount, unsigned int data *pAddress, unsigned char data *pRecordType, unsigned char *pData);
29+
#ifdef __cplusplus
30+
extern "C" {
31+
#endif
32+
char GetLineData(unsigned char *pLine, unsigned char *pByteCount, unsigned int *pAddress, unsigned char *pRecordType, unsigned char *pData);
3033
void SetLineData(unsigned char *pLine, unsigned char ByteCount, unsigned int Address, unsigned char RecordType, unsigned char *pData);
34+
#ifdef __cplusplus
35+
}
36+
#endif
3137

3238
#endif /* __HEXFILE_H__ */
3339

libraries/ENVIE_Video_Firefly/Flash/Flash.c renamed to libraries/ENVIE_Video_Firefly/src/Flash/Flash.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
#include "config.h"
88
#include "MI2_REG.h"
99
#include "REG_DRV.h"
10-
#include "HexFile.h"
10+
#include "EEPROM/HexFile.h"
1111
#include "Flash.h"
1212
#include "debug.h"
13-
#include "EFM8UB2_helper.h"
14-
#include "CmdHandler.h"
13+
#include "debug/CmdHandler.h"
1514

1615
/* for early tests before MI-2 chip is back */
1716
//#define DRY_RUN
@@ -223,7 +222,7 @@ void command_flash_SE(void)
223222
{
224223
unsigned int Flash_Addr; /* Flash address, any address inside the sector is a valid address for the Sector Erase (SE) command*/
225224

226-
if(sscanf(g_CmdLineBuf, "\\%*s %x", &Flash_Addr) == 1)
225+
if(sscanf((const char*)g_CmdLineBuf, "\\%*s %x", &Flash_Addr) == 1)
227226
{
228227
flash_write_protection_disable();
229228
flash_sector_erase(Flash_Addr);
@@ -512,7 +511,7 @@ void command_flash_read(void)
512511
unsigned char RegBak1, RegBak2; // register values back up
513512
unsigned char RegVal; // register value
514513

515-
if (sscanf(g_CmdLineBuf, "\\%*s %x %lx", &Address, &size_to_be_read) == 2)
514+
if (sscanf((const char*)g_CmdLineBuf, "\\%*s %x %lx", &Address, &size_to_be_read) == 2)
516515
{
517516
if (Address%MAX_BYTE_COUNT_PER_RECORD_FLASH != 0)
518517
{

libraries/ENVIE_Video_Firefly/MI2.c renamed to libraries/ENVIE_Video_Firefly/src/MI2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "debug.h"
77
#include "MI2_REG.h"
88
#include "MI2.h"
9-
#include "Flash.h"
9+
#include "Flash/Flash.h"
1010

1111

1212

libraries/ENVIE_Video_Firefly/PD/ocm_code.c renamed to libraries/ENVIE_Video_Firefly/src/PD/ocm_code.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unsigned char code OCM_CODE[1600]= // for PDFU_DATA test
1+
const unsigned char OCM_CODE[1600]= // for PDFU_DATA test
22
{
33
0x02, 0x4E, 0x18, 0x02, 0x4E,0xA4, 0x43, 0x3F, 0x20, 0x22, 0x22, 0x02, 0x57, 0x87, 0x90, 0x10,
44
0x00, 0xE4, 0x93, 0x90, 0x7E,0x31, 0xF0, 0x90, 0x10, 0x01, 0xE4, 0x93, 0x90, 0x7E, 0x32, 0xF0,

libraries/ENVIE_Video_Firefly/PD/usb_pd.c renamed to libraries/ENVIE_Video_Firefly/src/PD/usb_pd.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ Revision History:
2222

2323
#include "config.h"
2424
#include "debug.h"
25-
#include "EFM8UB2_helper.h"
2625
#include "MI2.h"
27-
#include "Flash.h"
26+
#include "Flash/Flash.h"
2827
#include "MI2_REG.h"
29-
#include " REG_DRV.h"
28+
#include "REG_DRV.h"
3029
#include <string.h>
31-
#include "private_interface.h"
32-
#include "public_interface.h"
30+
#include "common/private_interface.h"
31+
#include "common/public_interface.h"
3332

3433
extern unsigned char xdata auto_pd_support_flag;
3534
extern void AP_TX_process(void);
@@ -137,7 +136,7 @@ void interface_recvd_msg_handler(void)
137136
{
138137
if(recv_msg_success)
139138
{
140-
dispatch_rcvd_pd_msg(InterfaceRecvBuf[1], &InterfaceRecvBuf[2], InterfaceRecvBuf[0]-1);
139+
dispatch_rcvd_pd_msg((PD_MSG_TYPE)InterfaceRecvBuf[1], &InterfaceRecvBuf[2], InterfaceRecvBuf[0]-1);
141140
recv_msg_success = 0;
142141
}
143142
}

libraries/ENVIE_Video_Firefly/PROC_Main.c renamed to libraries/ENVIE_Video_Firefly/src/PROC_Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Revision History:
2323
#include "config.h"
2424
#include "debug.h"
2525
#include "MI2.h"
26-
#include "Flash.h"
26+
#include "Flash/Flash.h"
2727
#include "MI2_REG.h"
2828
#include "REG_DRV.h"
2929
#include "common/private_interface.h"

0 commit comments

Comments
 (0)