2 Replies Latest reply on Jan 23, 2020 7:56 AM by shge_4395051

    EEPROM Setup

    shge_4395051

      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]);

       

        • 1. Re: EEPROM Setup
          MoTa_728816

          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

          • 2. Re: EEPROM Setup
            shge_4395051

            Thanks Moto

            This worked well.