Microchip-MPLAB-Harmony / core

Harmony 3 Core
https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MH3_core&redirect=true
Other
17 stars 12 forks source link

Fix Decimal in SYS_TICK_FREQ and add parentheses around number #11

Closed apapillon closed 3 years ago

apapillon commented 4 years ago

MHC generate code decimal number for SYS_TICK_FREQ. With french locale, Freemaker produce all decimal numbers with comma that generate compile errors.

For example : #define SYS_TIME_TICK_FREQ_IN_HZ 1000,08

Result

../src/config/default/system/time/src/sys_time.c: In function 'SYS_TIME_CounterInit':
../src/config/default/system/time/src/sys_time.c:480:40: error: invalid digit "8" in octal constant
     counterObj->hwTimerTickFreq = SYS_TIME_TICK_FREQ_IN_HZ;
                                        ^
../src/config/default/system/time/src/sys_time.c:483:85: error: invalid digit "8" in octal constant
     counterObj->hwTimerPeriodValue = counterObj->timePlib->timerFrequencyGet()/SYS_TIME_TICK_FREQ_IN_HZ;
                                                                                     ^
make[2]: *** [build/default/production/_ext/101884895/sys_time.o] Error 1
make[2]: *** Waiting for unfinished jobs....
vishalnxt commented 4 years ago

@apapillon Thank you for reporting the issue and suggesting a fix for the same. We have created an internal ticket to look into the issue.

dsettu commented 3 years ago

MHC is updated to resolve locale issue. Hence, closing the PR.

picerno76 commented 3 years ago

In Italy it still generates bad code with comma. As I read here https://freemarker.apache.org/docs/ref_builtins_number.html , the solution seems the following:

define SYS_TIME_TICK_FREQ_IN_HZ (${SYS_TICK_FREQ?c})