In data domenica 27 luglio 2014 14:20:40, bob cousins ha scritto:
> I have created a pull request
https://github.com/arduino/Arduino/pull/2210.
> As this is my first pull request to the Arduino project, I am quite happy
> to receive advice and guidance :)
Hey Bob,
great work, looks very nice!
I guess we should move everything out of variants and put directly into the
core in a specific file watchdog.c and call wdt_initialize just before init()
here:
https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/sam/cores/arduino/main.cpp#L43
I would like also to rename the method as:
wdt_initialize -> watchdogSetup
wdt_enable -> watchdogEnable
wdt_disable -> watchdogDisable
wdt_reset -> watchdogReset
to better match Arduino API style.
And finally I'll get rid of the constants WDTO_1S, WDTO_2S, etc. and implement
a function that accept an uint32_t timeout in millis and do the calculation of
the constant to use in the watchdog register, is that possible?
C