gitdode / thermidity Goto Github PK
View Code? Open in Web Editor NEWAVR MCU based thermometer and hygrometer with e-ink display
License: GNU General Public License v3.0
AVR MCU based thermometer and hygrometer with e-ink display
License: GNU General Public License v3.0
Instead of
_delay_ms(100);
could just
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_mode();
and get woken up by watchdog after 1 second. The sensors certainly don't mind to have 1s instead of 100ms to settle.
Power consumption should be 1s * ~250uA vs. 100ms * ~6mA.
To be tested & measured.
reduces wear of display
Currently, the framebuffer in SRAM is set/cleared in byte mode. Sequential mode should be more efficient.
detect low battery (BOD?) and display a warning
Makefile
-D__AVR_ATmega328P__
should be removed. This is a built-in define, and provided by specs-atmega328p
since v5. If the compiler does not work as expected without defining that macro by hand, the toolchain is broken.-Wl,--relax
bypasses the assembler and should be replaced by -mrelax
. Otherwise, the assembler might compute symbol values / offsets at assembly time, but which are actually not computable at assembly time because linker relaxation might change their values.thermidity.elf
depends on header files like font.h
, which is not described in the current Makefile. This means that when you only change some header(s) and then rerun make
, it won't re-build thermidity.elf
.In functions like sram::sramWriteString
, display::writeString
and uart::printString
that get a (pointer-to) string argument, the pointed-to object should be const
because these functions are not supposed to change the pointed-to object.
For example, usart::printString
should have prototype
void printString (const char *data)
(or void printString (const char *const data)
if you wish).
Notice that it makes a difference on which side of the *
the const
is placed:
*
, the const
refers to the pointed-to object.*
, the const
refers to the pointer itself, i.e. to data
in the example.In most cases, it is fine to change pointers like data
, e.g. by using them to iterate over the chars in a string, whereas for output functions like above, they should still work as expected and without diagnostic in contexts like:
const char text[] = "Hallo";
printString (text);
As a aside, this applies to other qualifiers like volatile
or __flash
as well, and also to pointers of higher order:
In volatile int *p;
, p
points to a volatile object but b
itself is not volatile, whereas in int * volatile p;
, p
itself is volatile but the pointed-to object is not, and in volatile int * volatile p;
, both p
and the pointed-to object are volatile.
In int **p;
there are 8 = 23 possible ways to put volatile
's.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.