roty wrote:
> ...
> Maybe the precise message is helpful to recognize what's wrong. Here is
> exactly
> one of the messages I'm seeing:
>
> C/C++ Indexer Problem: Macro usage error for macro : time_getHour in
> file: C:\test\EFSL\efsl_027\src\time.c on line: 69.
Hmm, I have tried to reproduce this error-message without success. There
is also a chapter about time-support in the efsl-manual which may
provide useful information.
Anyway. I have just tested the time-support with the library (The code I
had already here has been rather old). The steps done:
1. used the efsl-source-code from my web-page
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/efsl_arm/arm7_efsl_0_2_7_mt_20060531b.zip
This is a slightly modified version of the official source but the
method should work for the official code too.
2. renamed config-sample-lpc2000.h to config.h
3. removed the comment before #define DATE_TIME_SUPPORT in config.h - so
the support is enabled. Keep in mind that when using the library
compiled with this option the "interface"-functions efsl_* have to be
provided in every project which gets linked with the library. Maybe
dummys will do when no real RTC is available or time-support should not
be used.
4. compiled the library with the Makefile-LPC2000 from the archive
5. modified the example application for LPC2138 which comes in the
archive:
5a. created an additional file efsl_time_LPC.c in the same directory is
the main.c - see below
5b. added the file to the source-list in the example's makefile
5c. "make all" for the example-application with the supplied makefile
-> no errors (output below)
So far not tested with the hardware or a simulator.
Hope this helps
Martin Thomas
--- file efsl_time_LPC.c ---
/*
efsl Time-Support for Philips LPC21xx Controllers
Martin THOMAS, 2006
*/
#include "LPC213x.h"
#include "types.h"
#include "time.h"
euint16 efsl_getYear(void)
{
return (euint16)(YEAR);
}
euint8 efsl_getMonth(void)
{
return (euint8)(MONTH);
}
euint8 efsl_getDay(void)
{
return (euint8)(DOM);
}
euint8 efsl_getHour(void)
{
return (euint8)(HOUR);
}
euint8 efsl_getMinute(void)
{
return (euint8)(MIN);
}
euint8 efsl_getSecond(void)
{
return (euint8)(SEC);
}
--- output of make all ---
"make.exe" all
-------- begin --------
arm-elf-gcc (GCC) 4.1.1 (WinARM)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
Assembling (ARM-only): crt0.S
arm-elf-gcc -c -mcpu=arm7tdmi-s -mthumb-interwork -I. -x
assembler-with-cpp -DROM_RUN -Wa,-adhlns=crt0.lst,-gdwarf-2 crt0.S -o
crt0.o
Compiling C: main.c
arm-elf-gcc -c -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -Os -Wall -Wcast-align -Wcast-qual -Wimplicit
-Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow
-Wunused -Wa,-adhlns=main.lst -I../../inc -I../../conf -MD -MP -MF
.dep/main.o.d -Wstrict-prototypes -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -std=gnu99 main.c -o main.o
In file included from ../../inc/efs.h:42,
from main.c:17:
../../inc/fs.h:169:2: warning: #warning "mt ATTR_PACKED active"
Compiling C: uart.c
arm-elf-gcc -c -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -Os -Wall -Wcast-align -Wcast-qual -Wimplicit
-Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow
-Wunused -Wa,-adhlns=uart.lst -I../../inc -I../../conf -MD -MP -MF
.dep/uart.o.d -Wstrict-prototypes -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -std=gnu99 uart.c -o uart.o
Compiling C: efsl_time_LPC.c
arm-elf-gcc -c -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -Os -Wall -Wcast-align -Wcast-qual -Wimplicit
-Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow
-Wunused -Wa,-adhlns=efsl_time_LPC.lst -I../../inc -I../../conf -MD -MP
-MF .dep/efsl_time_LPC.o.d -Wstrict-prototypes -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -std=gnu99 efsl_time_LPC.c -o
efsl_time_LPC.o
Linking: main.elf
arm-elf-gcc -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -Os -Wall -Wcast-align -Wcast-qual -Wimplicit
-Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow
-Wunused -Wa,-adhlns=crt0.lst -I../../inc -I../../conf -MD -MP -MF
.dep/main.elf.d crt0.o main.o uart.o efsl_time_LPC.o --output
main.elf -nostartfiles -Wl,-Map=main.map,--cref -lc -lm -lc -lgcc
-lefsl -L../../ -TLPC2138-ROM.ld
Creating load file for Flash: main.hex
arm-elf-objcopy -O ihex main.elf main.hex
Creating Extended Listing: main.lss
arm-elf-objdump -h -S -C main.elf > main.lss
Creating Symbol Table: main.sym
arm-elf-nm -n main.elf > main.sym
Size after:
main.elf :
section size addr
.text 16636 0
.data 12 1073741824
.bss 4168 1073741836
.stack 1024 1073746176
.comment 594 0
.debug_aranges 800 0
.debug_pubnames 3779 0
.debug_info 29725 0
.debug_abbrev 6469 0
.debug_line 5559 0
.debug_frame 4644 0
.debug_str 4931 0
.debug_loc 18823 0
.debug_ranges 200 0
Total 97364
Errors: none
-------- end --------
> Process Exit Code: 0
> Time Taken: 00:02