Modified my Battery charger application by adding a simple Sub.
It is a single .bas file 650 lines long with includes noted at the top:
Code: Select all
#include once "includes/pigpio.bi"
#include once "includes/declares.bi"
#include once "includes/myTypes.bi"
#include once "file.bi"
#inclib "pigpio"
Code: Select all
Declare sub ChargeCycle()
Code: Select all
For Xq = 1 to 4
A2D.Cell = Xq
ClearAccum '' Nominate the Cell we are operating on
ReadaCell '' Read this Cell 250 times & Accumulate values.
Times.mSec = (Timer - Times.CalTime) * 1000
SampleSort
Calc_Results '' Convert Counts to TrueV(n) and CellV(n)
Limits_Check '' Classify each Cell according to it's values
Next
Battery_State '' Classify Total Battery charge state .
IOControl
ChargeCycle '' Allow Limited charge Time after 99 %
WriteFlags '' Use all of the above to Switch O/P's
Copy the basic files to my Rpi which uses St_W fbc version 1:20:0.
Compile from Geany or on cli results in:
Comment the line out and it all compiles and links.ld: LiPo4.o: in function 'Taskscan'
LiPo4.c (.text+0x780):undefined reference to 'ChargeCycle'
Noted many posts on 'undefined reference' but they mainly have to do with Constructor / Destructor.
Have never used either in the last 20 years of using FB.
Tried shifting the routine before the error line to no avail.
Anyone have any idea why this is happening ?
Regards
EDIT: Compared .c files from Desktop to Rpi and the only differences are to do with 64 or 32 bit.