RTC_IRQ_IRQ_cfg is found if referenced from main.c but not from my driver file in Shared Files

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SimonCanada
Level 3
Level 3
25 replies posted 10 questions asked 50 sign-ins

I am using a PSoC BLE Pioneer board (PSoC 63) with PSoC Creator 4.4 and using the built in GNU C Compiler.

I am currently getting the RTC working and started by porting code from CE218542 - PSoC6 Custom TickTimer RTC to my test app (tests various hardware using a simple menu-friven system via the terminal). The RTC and Alarm worked, sleeping and waking at the specified intervals. I wanted to make a few changes to the example code and then put it as a wrapper into a driver file that later I will port into my main project.

I created c and h files to house this code in the Shared Files virtual folder, then copied the code from main.c over to my new files. But now, I get the fatal compiler error "Build error: 'RTC_RTC_IRQ_cfg' undeclared (first use in this function)".

I am including "project.h", "RTC.h", "cy_rtc.h" in my new files, which is all I had added in main.c.

I have come across this sort of issue before while developing drivers for other hardware: if my files are located in Shared Files, some things like these xxx_xxx_cfg structures cannot be found outside of main.c, or ISRs don't work if placed in my own files and need to be placed inside of main.c. I found this with initialising the SPI, too.

No doubt it is something obvious to people who are more familiar with this platform and toolchain, so please help me to understand it.

Thanks, Simon

0 Likes
1 Reply
SimonCanada
Level 3
Level 3
25 replies posted 10 questions asked 50 sign-ins

Update: I have found that moving the file from Shared Files to CM4 (Core1) \ Source Files and \Header Files seems to fix it. However, if possible I would still appreciate understanding what the rules are in locating your own source files.

0 Likes