void Oscillator_Init()
{
int i = 0;
OSCXCN = 0x67;
for (i = 0; i < 3000; i++){WDTCN=0xa5;}; // Wait 1ms for initialization
while ((OSCXCN & 0x80) == 0);
OSCICN = 0x88;
}
ReadRTC();
if (second==8)
{
Read_Temperature(ptTemper,1);
Read_Temperature(ptTemper,2);
Temp_Con(ptTemp_Average);
}
} while (1);
}
调试错误:
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2004
*** WARNING C235 IN LINE 27 OF MAIN.C: parameter 2: different types
*** WARNING C235 IN LINE 27 OF MAIN.C: parameter 3: different types
*** WARNING C235 IN LINE 27 OF MAIN.C: parameter 4: different types
*** WARNING C235 IN LINE 27 OF MAIN.C: parameter 5: different types
*** WARNING C235 IN LINE 27 OF MAIN.C: parameter 6: different types
*** ERROR C231 IN LINE 29 OF MAIN.C: '_Read_Temperature': redefinition
*** ERROR C231 IN LINE 30 OF MAIN.C: '_Temp_Con': redefinition
我用gcc编译同LZ类似的例子是可以的:
//Function multiply() defined in file1.c, sum() defined in file2.c
#include
#include "file1.c"
#include "file2.c"
int main()
{
extern int multiply();
extern int sum();
int a, b;
int result;
printf("Please input a and b(Format:a,b):");
scanf("%d, %d", &a, &b);
result = multiply(a, b);
printf("The result of multiply is: %d\n", result);
result = sum(a, b);
printf("The result of sum is: %d\n", result);