Misfittech / nano_stepper

Stepper feedback controller
424 stars 179 forks source link

narrowing conversion error #33

Closed hg42 closed 4 years ago

hg42 commented 5 years ago

when compiling on Arduino IDE on Linux I got this conversion error:

eeprom.cpp:67:90: error: narrowing conversion of '4095' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]
 __attribute__((__aligned__(FLASH_ROW_SIZE))) const uint8_t NVM_eeprom[EEPROM_SIZE]={0xFFF};
                                                                                          ^
exit status 1
narrowing conversion of '4095' from 'int' to 'uint8_t {aka unsigned char}' inside { } [-Wnarrowing]

I guess it is a typo...should it be 0xFF?

Or may be I don't understand the special purpose of initializing an uint8_t with 0xFFF :-)

coolio986 commented 4 years ago

@trampas Can you commit these changes? There are no conflicts and it appears that the nvm size is being set to all F's. I don't see any issue with this change

trampas commented 4 years ago

There are some other bugs I have found, let me see if I can do a new release.

Specifically I have found issues with the NVM as that the "={0xFFF}" only sets the first value not the entire memory. This has been shown to cause some issues, depending on how the code is compiled.

Trampas

On Tue, Dec 3, 2019 at 12:46 PM coolio986 notifications@github.com wrote:

@trampas https://github.com/trampas Can you commit these changes? There are no conflicts and it appears that the nvm size is being set to all F's. I don't see any issue with this change

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Misfittech/nano_stepper/issues/33?email_source=notifications&email_token=ABUHSPNSSWETQLVDYKU37XTQW2LPBA5CNFSM4H2TH4G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF2HGMI#issuecomment-561279793, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUHSPMAVL2EAUJ5SYL6VLLQW2LPBANCNFSM4H2TH4GQ .

coolio986 commented 4 years ago

Changes committed c263fbb

coolio986 commented 4 years ago

@trampas, can you close this issue?