<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>1958 Turntable from the Black Forest - 15: SAMA5D4 Blinky</title><link>/challenges-projects/design-challenges/enchanted-objects/b/blog/posts/1958-turntable-from-the-black-forest---15-sama5d4-blinky</link><description>I&amp;#39;ve done many attempts to build and execute my own C program on the atmel sama5d4 xplained ultra board. Thanks to the tutorial on mikrocontroller-software.de , I was able to cross-compile and run my first binary (see post 13: Breakthrough ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: 1958 Turntable from the Black Forest - 15: SAMA5D4 Blinky</title><link>https://community.element14.com/challenges-projects/design-challenges/enchanted-objects/b/blog/posts/1958-turntable-from-the-black-forest---15-sama5d4-blinky</link><pubDate>Wed, 13 May 2015 09:58:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e50382db-9a40-4931-bafc-162280e08acb</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;While experimenting, I discovered that the whole example also works with a small subset of the code,&lt;/p&gt;&lt;p&gt;without the I/O handle exports etc...&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=class+LinuxFile+%7B%0Aprivate%3A%0A++++int+m_Handle%3B%0A%0A%0A++++%2F*%0A+++++*+Linux+File+Handling+to+acces+devices+via+filesystem%0A+++++*%2F%0Apublic%3A%0A++++LinuxFile%28const+char+*pFile%2C+int+flags+%3D+O_RDWR%29+%7B%0A++++++++m_Handle+%3D+open%28pFile%2C+flags%29%3B%0A++++%7D%0A%0A%0A++++%7ELinuxFile%28%29+%7B%0A++++++++if+%28m_Handle+%21%3D+-1%29%0A++++++++++++close%28m_Handle%29%3B%0A++++%7D%0A%0A%0A++++size_t+Write%28const+void+*pBuffer%2C+size_t+size%29+%7B%0A++++++++return+write%28m_Handle%2C+pBuffer%2C+size%29%3B%0A++++%7D%0A%0A%0A++++size_t+Read%28void+*pBuffer%2C+size_t+size%29+%7B%0A++++++++return+read%28m_Handle%2C+pBuffer%2C+size%29%3B%0A++++%7D%0A%0A%0A++++size_t+Write%28const+char+*pText%29+%7B%0A++++++++return+Write%28pText%2C+strlen%28pText%29%29%3B%0A++++%7D%0A%0A%0A++++size_t+Write%28int+number%29+%7B%0A++++++++char+szNum%5B32%5D%3B%0A++++++++snprintf%28szNum%2C+sizeof%28szNum%29%2C+%22%25d%22%2C+number%29%3B%0A++++++++return+Write%28szNum%29%3B%0A++++%7D%0A%7D%3B%0A%0A%0A%0A%0Aint+main%28%29+%7B%0A%0A%0A++++bool+on+%3D+true%3B%0A++++for+%28%3B%3B%29%0A++++%7B%0A++++++++on+%3D+%21on%3B%0A%0A%0A++++++++if%28true%3D%3Don%29%0A++++++++%7B%0A++++++++LinuxFile%28%22%2Fsys%2Fclass%2Fleds%2Fd8%2Fbrightness%22%2C%0A++++++++++++++++O_WRONLY%29.Write%28%221%22%29%3B%0A++++++++%7D%0A++++++++else%0A++++++++%7B%0A++++++++++++LinuxFile%28%22%2Fsys%2Fclass%2Fleds%2Fd8%2Fbrightness%22%2C%0A++++++++++++++++++++++++++++O_WRONLY%29.Write%28%220%22%29%3B%0A++++++++%7D%0A++++++++%2F*%0A+++++++++*++%2F%2F+With+this+sleep%281%29+command+the+task+sleeps+1+second+and+wake+then.+This+is+not+a+good+solution+but+for+this+example+ok%0A+++++++++*%2F%0A++++++++++++sleep%281%29%3B%0A++++%7D%0A%0A%0A++++return+0%3B%0A%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m continuing my exercise to find out if I&amp;#39;m breaking linux rules, or if I don&amp;#39;t fully understand why the example is doing exports.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=20813&amp;AppID=117&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>