runtime memory constraints
grouchy
Posts: 16
I'm not much of a programmer, so I could use some help from someone with patience.
I got the hm55b compass module and a ping sensor, and I thought I'd put together a program to use them.
I started with the graphics demo on the object exchange as a guide, and I draw a circle on the tv display, and rotating crosshairs around the circle, this to display the compass heading. I also draw a bar with tick marks to display the ping range. Then I add the fullduplexserial object so that I can send the heading and range info to my pc (which runs a vb program to display the same thing).
Once I add fullduplexserial, the program is too big by 197 longs.
Fullduplexserial, tv, and graphics run in their own cogs. I haven't even put in the ping yet.
Why is my program so big that it won't run?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Rudy's CNC Freeware·· http://www.enter.net/~schleinkofer
I got the hm55b compass module and a ping sensor, and I thought I'd put together a program to use them.
I started with the graphics demo on the object exchange as a guide, and I draw a circle on the tv display, and rotating crosshairs around the circle, this to display the compass heading. I also draw a bar with tick marks to display the ping range. Then I add the fullduplexserial object so that I can send the heading and range info to my pc (which runs a vb program to display the same thing).
Once I add fullduplexserial, the program is too big by 197 longs.
Fullduplexserial, tv, and graphics run in their own cogs. I haven't even put in the ping yet.
Why is my program so big that it won't run?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Rudy's CNC Freeware·· http://www.enter.net/~schleinkofer
Comments
You write all your graphics to bitmap_base and then copy it to display_base when you are done.
This is nice and ensures you don't get screen flicker, but it means your graphics bitmap space consumes most of your available ram.
You might have to come up with a way to share the same buffer. This would really mean not clearing the display at the start of each run through, but looking at what has changed since the last pass, erasing and re-drawing only what has changed.
If you can manage this, you free up stacks of space.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
Can't find it currently on my EEE, have to look at the desktop when I'm back home in 12 hours. Or maybe someone else remembers as well and can help.
Have a look at the XOR graphics driver and demo by Steven Messenger and DeSilva. It does precisely what you are looking for.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
This question about memory problems whith the graphics object cames again and again and again in this forum.
I think Parallax should place a big warning at begin of the Graphics-Demo which says that this is a demo for flicker free animation and should not be used as a template for real applications.
And even better they should also include a demo with single buffer graphics, which can be used as template.
Andy