It is currently Wed Jul 06, 2011 12:51 pm

All times are UTC - 8 hours




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Sim 1.1.2 vs Hardware (timer resolution, display boundary)
PostPosted: Sun Apr 10, 2011 6:21 pm 

Joined: Sun Apr 10, 2011 4:55 pm
Posts: 1
I found a few discrepancies between the simulator and the watch hardware. Workarounds are possible, but the first one is a big problem for doing animation. I'm developing on sim v1.1.2 in the provided Puppy/Ubuntu VM, VirtualBox v4.0.4 r70112, WinXP Pro 32-bit Intel Quad-Core host. Hopefully this will save the simmers some frustration, and give the devs some ideas on what to fix.

Memory Usage:

The sim allocates impossibly large amounts of RAM during screen writes. It made no difference whether I used an image resource, or wrote raw pixels, but larger writes caused problems faster. The following code will consume about 50MB of ram after clicking the button rapidly for 30 seconds, bringing a 256MB VM to its knees. The hardware watch has no problem with this.

void main_app_handle_button_down() {
     pulse_set_draw_window(16, 32, 64, 96);
     for (int i = 0; i < 3072; i++) {
        pulse_draw_point24(COLOR_WHITE24);
     }
}


I was able to partially work around this in my app by writing single pixels and lines in my test code, and switching to the actual drawing code when deploying to the watch.

Timer Resolution:

The following code will execute roughly every 250ms in the simulator, when it should execute roughly every 50ms. The timers on the hardware watch have much higher resolution, as does the VM itself (ping, etc..), so I'm not sure what's up with the sim.

uint32_t updateTimerID;
void Update(){
     // do stuff
     updateTimerID = pulse_register_timer(50, &Update,0); // once called, this should repeat every 50ms
}


Display Boundary Behavior:

Setting a draw window outside the screen boundary yields confusing results. The following code works in the simulator, filling as much as it can, but the actual watch draws nothing at all. If the sim looks great, but the watch is missing stuff, make sure everything is within bounds.

uint32_t area = 16*(128);
uint32_t i;
pulse_set_draw_window(80, 0, 95,128); // one-off, 127 is the bottom of the screen
for(i=0;i<area;i++){
   pulse_draw_point24(COLOR_BLACK24); // erase stuff
}


-Matt Jones
www.evilseed.net


Offline
 Profile  
 
 Post subject: Re: Sim 1.1.2 vs Hardware (timer resolution, display boundar
PostPosted: Mon Apr 11, 2011 4:44 am 

Joined: Sun Feb 27, 2011 8:32 pm
Posts: 138
Location: Where ever the USAF sends me.
Also, cos and sin work int he simulator but aren't implemented on the watch.



_________________
Page ID: KTS
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

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: