Giter VIP home page Giter VIP logo

Comments (7)

m-kozlowski avatar m-kozlowski commented on August 20, 2024

with 36 multiplier you're running into integer overflow.
if((clock_time()-last_adv_delay) > advertising_interval*(advertising_type?5000:10000)*CLOCK_SYS_CLOCK_1MS)
so it's: 36*10000*24000 = 8640000000, twice as much as uint32 can take;)

I think that highest you can go is 17.

from atc_mithermometer.

atc1441 avatar atc1441 commented on August 20, 2024

Correct.

This is a future fix. Need to get myself into it :)

from atc_mithermometer.

michapr avatar michapr commented on August 20, 2024

with 36 multiplier you're running into integer overflow.

ok, that's why the 5 and 10 minutes from web flasher cannot work too, right?

For understanding - what time interval is it?
I still see advertising data every minute, or I'm wrong? Is it the interval for sending an actual value in advertising packet?

Thanks for help!
Michael

from atc_mithermometer.

m-kozlowski avatar m-kozlowski commented on August 20, 2024

@atc1441 skimming through docs i've found clock_time_exceed( unsigned int ref, unsigned int us ) that handles the whole clock frequency part, taking interval in microseconds as uint. that would give max interval of 4294 seconds without introducing second variable to count interval ticks

from atc_mithermometer.

atc1441 avatar atc1441 commented on August 20, 2024

Thank you for that.

I did used that method at the beginning but had the same problems with the overflow. Will look into it again

from atc_mithermometer.

m-kozlowski avatar m-kozlowski commented on August 20, 2024

On the second thought, there will be still problem of internal clock overlaping somewhere between 100-200seconds, depending of clock frequency, no matter which function is used to measure time.

from atc_mithermometer.

atc1441 avatar atc1441 commented on August 20, 2024

Thats what i was also seeing when using it.

A plan is to have an extra Arduino like millis timer to have independent precise timing available.

So ((overflow counter)*X) + (current counter value) = millis

from atc_mithermometer.

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.