EEPROM Setup

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

cross mob
lock attach
Attachments are accessible only for community members.
shge_4395051
Level 4
Level 4
25 sign-ins 25 replies posted First solution authored

Hello

The following line of code results in a warning when compiled.  I followed the EEPROM setup from an applications note I found on your website.  The EEPROM is working fine.  However,  I'd like to resolve the warning.  I'm using a PSOC CY8C4247AZI-M485  4200M.  Main.c is attached.

returnValue = EEPROM_1_Init(&emEeprom[0]);

pastedImage_0.png

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

The function EEPROM_1_Init() is defined in EEPROM_1.c as

     cy_en_em_eeprom_status_t EEPROM_1_Init(uint32 startAddress)

So the argument needs to be "uint32" to avoid warning.

I made a simple test project and tested

(1) same argument with you, and yes received the warning

000-before.JPG

(2) I cast the address as "uint32" and the warning is gone.

001-after.JPG

But please note that using cast we can fool the compiler even with wrong argument,

so make sure that what you are doing is correct.

moto

View solution in original post

0 Likes
2 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

The function EEPROM_1_Init() is defined in EEPROM_1.c as

     cy_en_em_eeprom_status_t EEPROM_1_Init(uint32 startAddress)

So the argument needs to be "uint32" to avoid warning.

I made a simple test project and tested

(1) same argument with you, and yes received the warning

000-before.JPG

(2) I cast the address as "uint32" and the warning is gone.

001-after.JPG

But please note that using cast we can fool the compiler even with wrong argument,

so make sure that what you are doing is correct.

moto

0 Likes

Thanks Moto

This worked well.