Giter Site home page Giter Site logo

WDT clock source problem about lgt8fx HOT 6 CLOSED

gpb01 avatar gpb01 commented on June 4, 2024
WDT clock source problem

from lgt8fx.

Comments (6)

dbuezas avatar dbuezas commented on June 4, 2024 1

LaZsolt saves the day :)

from lgt8fx.

LaZsolt avatar LaZsolt commented on June 4, 2024

@gpb01

Hi Guglielmo!

Try this version of the code:

	static void begin() __attribute__((always_inline)) { 
		uint8_t btmp = PMCR |  (1 << RCMEN);   // 0000 0001 (enable RCMEN)
		        btmp = btmp & ~(1 << RCKEN);  // 1111 1101 (disable RCKEN)
			btmp = btmp & ~(1 << WCLKS);  // 1110 1111 (select HFRC)
		PMCR = (1 << PMCE);  // 1000 0000
		PMCR = btmp;
	}

from lgt8fx.

gpb01 avatar gpb01 commented on June 4, 2024

@LaZsolt

Hi, thanks, this is actually the correct way to write what I wanted to do. :-D

Unfortunately, however, the result does not change and the WDT continues to operate following the LFRC :-(

Guglielmo

from lgt8fx.

LaZsolt avatar LaZsolt commented on June 4, 2024

ATM I don't have time to test but here is an another idea:

.
.
.
#include <WDT.h>

LGTWDT Lgtwdt;

void setup() {
    Lgtwdt.begin();
.
.   your code
.

from lgt8fx.

gpb01 avatar gpb01 commented on June 4, 2024

@LaZsolt

This seems to be the solution ...
... by explicitly calling the begin() method, everything seems to work. Thanks for your help !!!

Guglielmo

from lgt8fx.

LaZsolt avatar LaZsolt commented on June 4, 2024

Your welcome.

from lgt8fx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.