Skip to content

Commit

Permalink
float to TS_FLOAT
Browse files Browse the repository at this point in the history
  • Loading branch information
gemu2015 committed Feb 10, 2023
1 parent 61701f6 commit 8e0f982
Showing 1 changed file with 238 additions and 223 deletions.
Loading

6 comments on commit 8e0f982

@pkkrusty
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this will get integrated into Tasmota Development next time you do a PR? I'm using it successfully with with GPS data calculations.

@gemu2015
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, currently i change a lot and must test things before i make a pr.

i also introduce integer variables
I:var1=0
I:var2=0
constants must be given by #value to distinguish from float
var1=#5
var1=var2*#3/#4
var1*=#2
var1<<=#4
var1=gi(epoch) // get integer value

these are 32 bit integers. it is still not possible to use with every function and only can be combined with single float precision
you also can not yet combine integers with float vars

@gemu2015
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw what was the reason for your SPI problems ?

@pkkrusty
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad wiring, I think.

@gemu2015
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just saw your post about GPS logging, nice!
i am sure the integers will help to make use it less RAM.
like i wrote above, define only variables you need in full precision as integers.
all math and shifting should work
when you want to print then it is done automatically, for converting to hex with full precision use hxi(var)

@pkkrusty
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check it out, thanks!

Please sign in to comment.