Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in eeprom.c with PIC registers #2

Closed
waaslandwolf opened this issue Dec 30, 2014 · 2 comments
Closed

Issue in eeprom.c with PIC registers #2

waaslandwolf opened this issue Dec 30, 2014 · 2 comments

Comments

@waaslandwolf
Copy link

Ake,

I am just updating my firmware with a git pull I did today. The file eeprom.c throws an error because it does not recognize the register PIR2bits.EEIF. In the old code there was a compiler preprocessor statement that compiled PIR4bits.EEIF for some PICs (like my 18F45K80), and PIR2bits.EEIF for everything else. This seems to have been removed in the latest code on Git. I wonder why, since this seems to break compilation for some PICs. Wouldn't it be better to include it again?

David.

This is the code I'm talking about, in the function writeEEPROM():
...

if defined(__18F25K80) || defined(__18F26K80) || defined(__18F45K80) || defined(__18F46K80) || defined(__18F65K80) || defined(__18F66K80)

    while (!PIR4bits.EEIF); // wait for interrupt to signal write complete
    PIR4bits.EEIF = 0;              // clear EEPROM write operation interrupt flag

else

    while (!PIR2bits.EEIF); // wait for interrupt to signal write complete
    PIR2bits.EEIF = 0;              // clear EEPROM write operation interrupt flag

endif

...

@grodansparadis
Copy link
Owner

Hi David,

when I check the history

https://github.com/grodansparadis/vscp_firmware/commits/master/pic/common/eeprom.c

it looks like it has not been there for at least since 2012, if ever.

I have added the suggested change. Please test.

/Ake

waaslandwolf skrev den 2014-12-30 19:00:

Ake,

I am just updating my firmware with a git pull I did today. The file
eeprom.c throws an error because it does not recognize the register
PIR2bits.EEIF. In the old code there was a compiler preprocessor
statement that compiled PIR4bits.EEIF for some PICs (like my
18F45K80), and PIR2bits.EEIF for everything else. This seems to have
been removed in the latest code on Git. I wonder why, since this seems
to break compilation for some PICs. Wouldn't it be better to include
it again?

David.

This is the code I'm talking about, in the function writeEEPROM():
...
#if defined(__18F25K80) || defined(__18F26K80) || defined(__18F45K80)
|| defined(__18F46K80) || defined(__18F65K80) || defined(__18F66K80)
while (!PIR4bits.EEIF); // wait for interrupt to signal write complete
PIR4bits.EEIF = 0; // clear EEPROM write operation interrupt flag
#else
while (!PIR2bits.EEIF); // wait for interrupt to signal write complete
PIR2bits.EEIF = 0; // clear EEPROM write operation interrupt flag
#endif
...


Reply to this email directly or view it on GitHub
#2.

Be Hungry - Stay Foolish!
Åke Hedman, Grodans Paradis AB / Paradise of the Frog
Brattbergavägen 17, 82050 LOS, SWEDEN
Phone: +46 (0)840011835 CellPhone: +46 (0)730-533146
http://www.grodansparadis.com http://www.vscp.org


Detta e-postmeddelande har sökts igenom efter virus med antivirusprogram från Avast.
http://www.avast.com

@waaslandwolf
Copy link
Author

Ake,

For me the change as I proposed below works fine on 18F45K80. Probably Kurt wrote this code for his Hasselt module but it never made it into the main branch. So the kudos go to him J

David.

From: Ake Hedman [mailto:notifications@github.com]
Sent: dinsdag 30 december 2014 20:18
To: grodansparadis/vscp_firmware
Cc: waaslandwolf
Subject: Re: [vscp_firmware] Issue in eeprom.c with PIC registers (#2)

Hi David,

when I check the history

https://github.com/grodansparadis/vscp_firmware/commits/master/pic/common/eeprom.c

it looks like it has not been there for at least since 2012, if ever.

I have added the suggested change. Please test.

/Ake

waaslandwolf skrev den 2014-12-30 19:00:

Ake,

I am just updating my firmware with a git pull I did today. The file
eeprom.c throws an error because it does not recognize the register
PIR2bits.EEIF. In the old code there was a compiler preprocessor
statement that compiled PIR4bits.EEIF for some PICs (like my
18F45K80), and PIR2bits.EEIF for everything else. This seems to have
been removed in the latest code on Git. I wonder why, since this seems
to break compilation for some PICs. Wouldn't it be better to include
it again?

David.

This is the code I'm talking about, in the function writeEEPROM():
...
#if defined(__18F25K80) || defined(__18F26K80) || defined(__18F45K80)
|| defined(__18F46K80) || defined(__18F65K80) || defined(__18F66K80)
while (!PIR4bits.EEIF); // wait for interrupt to signal write complete
PIR4bits.EEIF = 0; // clear EEPROM write operation interrupt flag
#else
while (!PIR2bits.EEIF); // wait for interrupt to signal write complete
PIR2bits.EEIF = 0; // clear EEPROM write operation interrupt flag
#endif
...


Reply to this email directly or view it on GitHub
#2.

Be Hungry - Stay Foolish!
Åke Hedman, Grodans Paradis AB / Paradise of the Frog
Brattbergavägen 17, 82050 LOS, SWEDEN
Phone: +46 (0)840011835 CellPhone: +46 (0)730-533146
http://www.grodansparadis.com http://www.vscp.org


Detta e-postmeddelande har sökts igenom efter virus med antivirusprogram från Avast.
http://www.avast.com


Reply to this email directly or view it on GitHub #2 (comment) . https://github.com/notifications/beacon/AGim4HKYxPQc55HQQiaMGDah2aXpAlt2ks5ncvH-gaJpZM4DNQow.gif


Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
http://www.avast.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants