<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>4D Systems Forum - Workshop4 - Designer Environment (Diablo16)</title>
		<link>https://forum.4dsystems.com.au/</link>
		<description />
		<language>en</language>
		<lastBuildDate>Mon, 24 Feb 2020 18:59:33 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>images/misc/rss.png</url>
			<title>4D Systems Forum - Workshop4 - Designer Environment (Diablo16)</title>
			<link>https://forum.4dsystems.com.au/</link>
		</image>
		<item>
			<title>Launching program from the SD</title>
			<link>https://forum.4dsystems.com.au/node/71272</link>
			<pubDate>Thu, 20 Feb 2020 16:42:09 GMT</pubDate>
			<description><![CDATA[Hi, 
In order to overtake the program size limit for a single program in FLASH, I am willing to store some programs on the SD card. 
The &quot;main...]]></description>
			<content:encoded><![CDATA[Hi,<br />
In order to overtake the program size limit for a single program in FLASH, I am willing to store some programs on the SD card.<br />
The &quot;main program&quot; (stored in the flashbank 0) would just be launcher.<br />
This program will not have any UI. It will simply make a few actions (check for files on the SD card, ...), and launch a 1st &quot;app&quot; from the SD called Menu (.4XE / .4FN).<br />
<br />
Menu will offer the user several buttons to choose which app he wants to use.<br />
Menu will then launch the corresponding app selected by the user, from the SD (4XE or 4FN).<br />
When the user is done with this app, a return button will exit and go back to Menu.<br />
<br />
<img data-attachmentid="71275" data-align="none" data-size="full" border="0" src="filedata/fetch?id=71275&amp;d=1582216749" class="bbcode-attachment thumbnail" alt="Click image for larger version

Name:	apps.PNG
Views:	20
Size:	7.8 KB
ID:	71275" /><br />
<br />
Since the apps are independant for each other, it does not really matter if the context is stored when launching an app.<br />
It is ok for me to re-initialize my Menu app when I return from another app. The most important data will be store in a txt file on the SD, so it's just a matter of reading it.<br />
So, at this point, both file_Run() or file_Exec() seem to do the job.<br />
<br />
<br />
Here is where it gets tricky : all app need to have access to the serial/UART.<br />
How should I process with that ? Can I initialise the UART buffers (RX and TX) in myLauncher, and then access then from any of my apps with some pointers ?<br />
<br />
At the moment, re-init the UART everytime I open an app. Since I need to be able to send/receive big frame, I am using some large buffers as global variables (&gt; 1000 byte).<br />
I tried a few things with file_Exec(), file_Run(), mem_Free() and returns, but after several opening/closing app, the screen crashed because of stack overflow.<br />
I believe that the memory is not completely freed when I return from an app. Therefore, everytime I re-open an app, some more RAM get allocated, until a stack overflow occurs.<br />
<br />
In each of my app code, I have something like this :<br />

	
	
	

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code" style="height:320;">// Global var
var TXRXbufffer[1000] ;
var RXbuff[1000];

func main()


   COM2_RX_pin(PA10);
   COM2_TX_pin(PA8);
   com2_Reset();
   com_SetBaud(COM2, 39700); // Parameter for the function is Baud/10
   com2_Init(RXbuff, BACKGROUND_SERIAL_COM_BUFFER_SIZE,0);
   com2_TXbuffer(TXRXbufffer,TX_COM_BUFFER_SIZE_ENCODED_FRAME, PA8);


   repeat

      // Some actions
      // Different for each app

      // Check if there is some data
      get_serial_messages();

      foreever
endfunc</pre>
</div>
	
	
	

<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code" style="height:140;">func get_serial_messages()
   var singleData ;

   singleData := serin2();

   if(singleData &gt;= 0)
       // Some processing
   endif

endfunc</pre>
</div>I think I understand the concept of parent and child program, but I haven't been able to find the application note (there are no more filters on the website ?!). Therefore, there are probably some details that I am missing.<br />
<br />
myLauncher is prety basic, and uses Designer<br />
The other program are coded in Visi.<br />
I am using the pro version.]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/37">Workshop4 - Designer Environment (Diablo16)</category>
			<dc:creator>Vincent44</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71272</guid>
		</item>
		<item>
			<title>Winbutton get state of it in MagicCode</title>
			<link>https://forum.4dsystems.com.au/node/71271</link>
			<pubDate>Thu, 20 Feb 2020 14:28:45 GMT</pubDate>
			<description>Hello everyone, 
I have a problem. I have in a small MagicCode part one (if) function. I would know how I can get the value of the state of the...</description>
			<content:encoded><![CDATA[Hello everyone,<br />
I have a problem. I have in a small MagicCode part one (if) function. I would know how I can get the value of the state of the button. I tried to ask with If(Winbutton0 == 1) but that doesen't work. Also it has to be only the state 1 if it was pressed and not if it ist pressed right now. How I can solve that without writhing much code.<br />
Thanks]]></content:encoded>
			<category domain="https://forum.4dsystems.com.au/node/37">Workshop4 - Designer Environment (Diablo16)</category>
			<dc:creator>Simon3000</dc:creator>
			<guid isPermaLink="true">https://forum.4dsystems.com.au/node/71271</guid>
		</item>
	</channel>
</rss>
