There is something I don't understand about Flowcode. If I try to compile my Flowcode C source in MPLAB, some of the variables that Flowcode generates are too long for the Hi-Tech compiler to handle.
In the code below, the compiler gives "Conflicting Declaration" errors for different variables generated by Flowcode. For example, "//ADC(0): //Macro function declarations" contains:
Code: Select all
void FCD_ADC0_SampleADC();
MX_UINT8 FCD_ADC0_ReadAsByte();
MX_UINT16 FCD_ADC0_ReadAsInt();
MX_FLOAT FCD_ADC0_ReadAsVoltage();
void FCD_ADC0_ReadAsString(MX_CHAR* FCR_RETVAL, MX_UINT8 FCR_RETVAL_SIZE);
void FCD_ADC0_ADC_RAW_Configure_Channel();
MX_UINT8 FCD_ADC0_ADC_RAW_Sample_Channel_Byte();
MX_UINT16 FCD_ADC0_ADC_RAW_Sample_Channel_Int();
MX_UINT8 FCD_ADC0_ADC_RAW_Average_Channel_Byte(MX_UINT8 NumSamples, MX_UINT8 DelayUs);
MX_UINT16 FCD_ADC0_ADC_RAW_Average_Channel_Int(MX_UINT8 NumSamples, MX_UINT8 DelayUs);
void FCD_ADC0_ADC_RAW_Disable_Channel();
Code: Select all
Build C:\MPLAB_Projects\Example_V5\Example_FCv5 for device 18F4431
Using driver C:\Program Files\HI-TECH Software\PICC-18\PRO\9.63\bin\picc18.exe
Make: The target "C:\MPLAB_Projects\Example_V5\Example_4431_V5.p1" is out of date.
Executing: "C:\Program Files\HI-TECH Software\PICC-18\PRO\9.63\bin\picc18.exe" --pass1 C:\MPLAB_Projects\Example_V5\Example_4431_V5.c -q --chip=18F4431 -P --runtime=default --opt=default,+asm,-speed,+space,9 --warn=0 -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [984] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 335.44 type redeclared
Error [1098] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 335.44 conflicting declarations for variable "FCD_ADC0_ADC_RAW_Sample_Channel" (C:\MPLAB_Projects\Example_V5\Example_4431_V5.c:334)
Error [984] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 337.81 type redeclared
Error [1098] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 337.81 conflicting declarations for variable "FCD_ADC0_ADC_RAW_Average_Channe" (C:\MPLAB_Projects\Example_V5\Example_4431_V5.c:336)
Error [984] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 557.1 type redeclared
Error [1098] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 557.1 conflicting declarations for variable "FCD_ADC0_ADC_RAW_Sample_Channel" (C:\MPLAB_Projects\Example_V5\Example_4431_V5.c:550)
Error [1098] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 557.1 conflicting declarations for variable "FCD_ADC0_ADC_RAW_Sample_Channel" (C:\MPLAB_Projects\Example_V5\Example_4431_V5.c:557)
Error [984] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 583.1 type redeclared
Error [1098] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 583.1 conflicting declarations for variable "FCD_ADC0_ADC_RAW_Average_Channe" (C:\MPLAB_Projects\Example_V5\Example_4431_V5.c:564)
Error [1098] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 583.1 conflicting declarations for variable "FCD_ADC0_ADC_RAW_Average_Channe" (C:\MPLAB_Projects\Example_V5\Example_4431_V5.c:583)
Warning [359] C:\Program Files\Flowcode\v5\CAL\PIC\PIC_CAL_ADC.c; 1481.18 illegal conversion between pointer types
Warning [359] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 1145.40 illegal conversion between pointer types
Warning [359] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 1153.47 illegal conversion between pointer types
Warning [359] C:\MPLAB_Projects\Example_V5\Example_4431_V5.c; 1161.47 illegal conversion between pointer types
…..(no more errors, just warnings….)