Today is halfway through the month!
This watch displays a series of quotes relating to time, the seasons, etc with a stylized typerwriter appearance. The text of the quotes are stored in flash and the currently selected, random quote is loaded dynamically into RAM for display. The read routine is copied from
ajwitte's spiflash.h:
// prototype of private API function for raw SPI flash reads
void spiflash_read(int addr, void *buffer, int size);
The offset address is 0x40000 + length of the other resources. My Makefile determines the length of the resources at compile time by running:
include/app_resources.h: resources/fonts.txt
$(PYTHON) $(TOOLSDIR)/resource_packer/resource_packer.py
echo > include/spi_resources.h "#define SPIFLASH_OFFSET `stat -f "%z" resources/inpulse_resources.bin`"
The fortunes are then pre-processed by
make-fortunes perl script and
find_random_saying() will read one from the flash.
Video:
http://www.flickr.com/photos/osr/570192 ... 084215019/Source:
https://bitbucket.org/hudson/watches/src/tip/fortune/