<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: help with code</title>
		<link>http://forums.leaflabs.com/topic.php?id=604</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:21:17 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=604" rel="self" type="application/rss+xml" />

		<item>
			<title>poslathian on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3347</link>
			<pubDate>Wed, 12 Jan 2011 15:35:21 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">3347@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;you can also explicitly throw arrays into flash (like PROGMEM) using a gcc directive and some built in linker magic like so:&#60;/p&#62;
&#60;p&#62;uint8_t px_logo[18240] __attribute__ ((section (&#34;.USER_FLASH&#34;))) = {0x00, ..., 0x6f};&#60;/p&#62;
&#60;p&#62;the important thing being the __attribute__((section (&#34;.USER_FLASH&#34;)))
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3338</link>
			<pubDate>Tue, 11 Jan 2011 09:14:00 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">3338@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It would also be worth getting a copy of the manual for the Arduino's processor the ATmega168/ATmega328&#60;/p&#62;
&#60;p&#62;This links  to it:&#60;br /&#62;
&#60;a href=&#34;http://www.atmel.com:80/dyn/resources/prod_documents/doc8271.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.atmel.com:80/dyn/resources/prod_documents/doc8271.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It is on this page:&#60;br /&#62;
&#60;a href=&#34;http://www.atmel.com:80/dyn/products/product_card.asp?part_id=4586&#34; rel=&#34;nofollow&#34;&#62;http://www.atmel.com:80/dyn/products/product_card.asp?part_id=4586&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Then 'Find' names within the document.&#60;/p&#62;
&#60;p&#62;The registers are are all UPPER CASE, and will be of names like PORTx, where x is the 8-bit wide port, A, B, C, D etc, like PIND too.&#60;br /&#62;
Individual pins will be PINxn, where N is a pin number from 0 to 7, so PIND3. I can't see any of those in the error messages, but it is useful to know how the naming conventions work.&#60;/p&#62;
&#60;p&#62;The two arrays port_to_output_PGM and port_to_input_PGM are being used to convert Arduino pin numbers to the actual underlying hardware pin numbers, and comes from &#60;a href=&#34;https://github.com/arduino/Arduino/blob/master/hardware/arduino/cores/arduino/pins_arduino.c&#34; rel=&#34;nofollow&#34;&#62;https://github.com/arduino/Arduino/blob/master/hardware/arduino/cores/arduino/pins_arduino.c&#60;/a&#62; &#60;/p&#62;
&#60;p&#62;You may want to try to deal with this area of code by using the 'Arduino Language' pinMode, digitalRead and digitalWrite functions, and avoid getting into the microcontroller specific details of hardware I/O ports at first. The Maple &#60;em&#62;may&#60;/em&#62; be quick enough that you can get the program working without any of that. This proposal has the downside that you will have to understand how the code works, but that may be necessary anyway.&#60;/p&#62;
&#60;p&#62;The details of the hardware I/O ports, and the peripherals is the biggest area of difference between microcontroller families (i.e. between manufacturers and their products) so minimising the amount of that code you have to port may help get something up and working sooner.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>General Tree on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3333</link>
			<pubDate>Sun, 09 Jan 2011 10:00:26 +0000</pubDate>
			<dc:creator>General Tree</dc:creator>
			<guid isPermaLink="false">3333@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;All of these registers are relevant for arduino, not maple. Some are defined differently in maple, others arent defined at all.&#60;/p&#62;
&#60;p&#62;The best solution to this IMO is described here:&#60;br /&#62;
&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=268&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=268&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;To find out which register has which address, simply open the reference manual of the STM32.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yokurk on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3332</link>
			<pubDate>Sun, 09 Jan 2011 02:43:15 +0000</pubDate>
			<dc:creator>yokurk</dc:creator>
			<guid isPermaLink="false">3332@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ok i was trying to get around with millions of errors i encounterd and finally and stuk here for sumtime.. previously i got the same error in a different place and was able to clear it by including io.h library ..but now it dosent seems to remove the error(same error but in a different file).i am sure that these error point to some missing library of arduino but i dont know which.please help&#60;/p&#62;
&#60;p&#62;errors:&#60;br /&#62;
(&#60;br /&#62;
from C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:24:&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:362: error: 'DDRB' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:363: error: 'DDRC' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:364: error: 'DDRD' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:370: error: 'PORTB' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:370: error: initializer element is not constant&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:370: error: (near initialization for 'port_to_output_PGM[2]')&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:371: error: 'PORTC' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:371: error: initializer element is not constant&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:371: error: (near initialization for 'port_to_output_PGM[3]')&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:372: error: 'PORTD' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:372: error: initializer element is not constant&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:372: error: (near initialization for 'port_to_output_PGM[4]')&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:378: error: 'PINB' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:378: error: initializer element is not constant&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:378: error: (near initialization for 'port_to_input_PGM[2]')&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:379: error: 'PINC' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:379: error: initializer element is not constant&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:379: error: (near initialization for 'port_to_input_PGM[3]')&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:380: error: 'PIND' undeclared here (not in a function)&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:380: error: initializer element is not constant&#60;/p&#62;
&#60;p&#62;C:\Users\lastvirus\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\pins_arduino.c:380: error: (near initialization for 'port_to_input_PGM[4]')&#60;/p&#62;
&#60;p&#62;)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yokurk on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3330</link>
			<pubDate>Sat, 08 Jan 2011 10:28:12 +0000</pubDate>
			<dc:creator>yokurk</dc:creator>
			<guid isPermaLink="false">3330@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;yes i was looking at the smt 32 code and am trying to make changes and have included avr/pgmspace.h which contains teh PROGMEM declaration from arduino's headers to maple's folder.though many more changes have to be made. thanks a lot for the help&#60;/p&#62;
&#60;p&#62;cheers
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mikep on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3329</link>
			<pubDate>Sat, 08 Jan 2011 09:45:54 +0000</pubDate>
			<dc:creator>mikep</dc:creator>
			<guid isPermaLink="false">3329@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I think the PROGMEM directive just means that the data is stored into the FLASH memory and not in RAM since it's static. This is important for the Arduinos since they have little RAM. The Maple has 20KB of RAM, much more than the Arduino, so you could try for now just to remove the PROGMEM directive, which would make it a regular variable.&#60;br /&#62;
I am not sure if there is an equivalent statement.&#60;/p&#62;
&#60;p&#62;Here's a little more info (although no solution):&#60;br /&#62;
&#60;a href=&#34;http://forum.sparkfun.com/viewtopic.php?f=11&#38;amp;t=17695&#34; rel=&#34;nofollow&#34;&#62;http://forum.sparkfun.com/viewtopic.php?f=11&#38;amp;t=17695&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://www.arduino.cc/en/Reference/PROGMEM&#34; rel=&#34;nofollow&#34;&#62;http://www.arduino.cc/en/Reference/PROGMEM&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I would just leave out the PROGMEM for now and continue that way.&#60;br /&#62;
Keep in mind that every place where &#34;BigFont&#34; is accessed, you probably also need to change some code, since reading from FLASH is a different command than accessing from RAM (pgm_read_byte etc.).&#60;/p&#62;
&#60;p&#62;You can also look at the display code for the STM32 that I mentioned in my other post yesterday:&#60;br /&#62;
&#60;a href=&#34;http://iteadstudio.com/application-note/itdb02-display-lib-for-stm32-gcc/&#34; rel=&#34;nofollow&#34;&#62;http://iteadstudio.com/application-note/itdb02-display-lib-for-stm32-gcc/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;And there you see how they have SmallFont and BigFont defined for the STM32 processor.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yokurk on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3328</link>
			<pubDate>Sat, 08 Jan 2011 09:18:12 +0000</pubDate>
			<dc:creator>yokurk</dc:creator>
			<guid isPermaLink="false">3328@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;i understand that PROGMEM is defined within the &#38;lt;avr/pgmspace.h&#38;gt; library. but i cannot compile this library in Maple too.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yokurk on "help with code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=604#post-3327</link>
			<pubDate>Sat, 08 Jan 2011 09:16:20 +0000</pubDate>
			<dc:creator>yokurk</dc:creator>
			<guid isPermaLink="false">3327@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;one of the codes in arduino uses the definition of characters as&#60;br /&#62;
for eg:&#60;br /&#62;
unsigned char BigFont[32*95] PROGMEM={&#60;br /&#62;
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //  &#38;lt;Space&#38;gt;}&#60;br /&#62;
when i try to compile the same code using Maple IDE it shows this error&#60;/p&#62;
&#60;p&#62;C:\Users\userer\Desktop\maple-ide-0.0.6\libraries\ITDB02_Graph\BigFont.c:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PROGMEM'&#60;/p&#62;
&#60;p&#62;i am new to Maple.the same code worked with arduino... please help
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
