It is currently Wed Jul 06, 2011 4:26 pm

All times are UTC - 8 hours




 Page 1 of 1 [ 1 post ] 
Author Message
 Post subject: Fortune (Day 15)
PostPosted: Sun May 08, 2011 6:06 pm 

Joined: Sun Feb 27, 2011 11:32 am
Posts: 71

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/


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 1 post ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: