Build D:\Projects\Power_supply\Firmware\power_supply for device 16F887
Using driver C:\Program Files\HI-TECH Software\PICC\9.71a\bin\picc.exe
Make: The target "D:\Projects\Power_supply\Firmware\main.p1" is up to date.
Make: The target "D:\Projects\Power_supply\Firmware\adc.p1" is up to date.
Make: The target "D:\Projects\Power_supply\Firmware\i2c.p1" is up to date.
Make: The target "D:\Projects\Power_supply\Firmware\led.p1" is up to date.
Make: The target "D:\Projects\Power_supply\Firmware\max5820.p1" is up to date.
Executing: "C:\Program Files\HI-TECH Software\PICC\9.71a\bin\picc.exe" -opower_supply.cof -mpower_supply.map --summary=default --output=default main.p1 adc.p1 i2c.p1 led.p1 max5820.p1 --chip=16F887 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
(1273) Omniscient Code Generation not available in Lite mode (warning)
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.71a
Copyright (C) 2010 Microchip Technology Inc.
Error [1091] C:\Program Files\HI-TECH Software\PICC\9.71a\sources\float.c; 86. main function "_main" not defined
********** Build failed! **********
程序没用浮点运算啊,只是有很复杂的整数运算,是否是在计算的过程中导致浮点错误?
vout_current = 25*adc_result*115/512/3;//current calculation
vout_voltage = 5*adc_result*33*(R15+R16)/512/R15;//voltage calculation
dac_data = 49*64*(vout_ratio.denorminator + 2*vout_ratio.counter*vout_ratio.numerator)/33/vout_ratio.numerator;
对复杂整数运算,应如何写表达式以避免浮点运算,谢谢! |