No announcement yet.

File_Run and File_Process question

  • Filter
  • Time
  • Show
Clear All
new posts

  • File_Run and File_Process question

    Your online information says that when the program called by either of these two command returns, control goes to whatever program is resident in flash. I wondered, how does a prgram 'return' from being run? There is no 'exit' or 'quit' command for a program (that I remember). So how would it end and return control to the flash program? Would just letting a program not continuously loop and 'fall through' do it? or what?

    Thanks ahead of time.
    "I dream the impossible, for if I do not, it will remain that way" - Mitchell Day 12/2007

  • #2

    Yes, simply allowing the code to drop through causes it to revert to flash.



    • #3

      It seems that when you call file_Process, at least by the description online, the passage of data is one-way. The calling program can give the called program a list of variables in an array. But no means is indicated for returning a value.

      I wondered if it might be possible to go against the warning about memory allocation as an intentional means for passing information.

      Would this idea below work (or with a tweek do so)?

      Have the calling program allocate some needed memory for the shared data. Then use the file_Process command an include a pointer to the start of the memory block? Then the call program can use that space for data input and/or return values? So long as its carefully maintained that this is the only memory allocation in which you will allow it not be freed when the called program quits (to avoid leakage). Then upon return to the program in flash, that program can use the memory to process the responses?

      Given that your online comments say that allocations are apparently not lost, shouldn't the data and the pointer to it survive the transitions?

      One note is that this would require the program in flash check that no memory has been allocated yet before attempting to allocated the memory (to allow it to allocate the memory only once).
      "I dream the impossible, for if I do not, it will remain that way" - Mitchell Day 12/2007