dbuezas / lgt8fx

Board Package for Logic Green LGT8F328P LGT8F328D and LGT8F88D
359 stars 90 forks source link

Update to WDT library #299

Closed gpb01 closed 9 months ago

gpb01 commented 10 months ago

Adds the capability of using the HFRC oscillator for WDT. A usage example has been added.

LaZsolt commented 10 months ago

I had the exact same thought, but you did it. I suggest some modifications.

gpb01 commented 10 months ago

I suggest some modifications.

Suggestions are always welcome. :-)

Guglielmo

LaZsolt commented 10 months ago

I think it's fine.

gpb01 commented 10 months ago

Yes 👍

You can merge the pull-request 😊

dbuezas commented 10 months ago

Thank you! What's the effect of using the other oscillator? Longer intervals?

gpb01 commented 10 months ago

What's the effect of using the other oscillator? Longer intervals?

The opposite, getting shorter intervals:

#define WTOH_1MS 0
#define WTOH_2MS 1
#define WTOH_4MS 2
#define WTOH_8MS 3
#define WTOH_16MS 4
#define WTOH_32MS 5
#define WTOH_64MS 6
#define WTOH_128MS 7
#define WTOH_256MS 8
#define WTOH_512MS 9

which can be useful on various occasions, e.g. either when the system clock is 32 MHz, or for porting libraries like FreeRTOS that use the WDT interrupt as a system tick.

Guglielmo

gpb01 commented 9 months ago

PR is waiting ... :-)

Guglielmo

dbuezas commented 9 months ago

Oh no, sorry for making this wait!

dbuezas commented 9 months ago

Released https://github.com/dbuezas/lgt8fx/releases/tag/v2.0.7