/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Display app menu and keep app running in background.

Username:     
Password:     
             

Forum
  • Index
  •  » circleOS
  •  » Display app menu and keep app running in background.

# 1   2011-01-13 02:27:07 Display app menu and keep app running in background.

JamesSt
New member
Registered: 2010-01-17
Posts: 9

Display app menu and keep app running in background.

Hi,

I can't seem to see how to keep my circle2 app running in the background while my app has a menu active.

Is there a way?

It's as though I need to hack menu.c so it doesn't return after handling the menu perhaps?

The reason is that I'm writing a data acquisition app, and once it has started acquiring data, I don't want it to stop when the button is pressed and a menu displayed, only after answering a yes/no question should it stop.

Cheers,
James.

Offline

 

# 2   2011-01-13 09:44:26 Display app menu and keep app running in background.

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Display app menu and keep app running in background.

Hi James,

Sorry, but the CircleOS is a cooperative mono task system. When a menu has the hand, the application handler is no more called.
I suggest for your acquisition task, to create an interrupt routine triggered by a periodic timer.
For this, use the API's function "UTIL_SetIrqHandler"

Yves

Offline

 

# 3   2011-01-14 02:32:50 Display app menu and keep app running in background.

JamesSt
New member
Registered: 2010-01-17
Posts: 9

Re: Display app menu and keep app running in background.

Hi Yves,

There is already a timer tick that causes app functions to be called, AFAICS, in scheduler.c that calls MENU_Handler().

It would seem silly to add another.

If there's no "official" method, I'll need to invent my own.

Regards,
James.

Offline

 

# 4   2011-01-14 04:53:38 Display app menu and keep app running in background.

JamesSt
New member
Registered: 2010-01-17
Posts: 9

Re: Display app menu and keep app running in background.

I've made a fix.

In MENU_Handler() after the if CurrentCommand condition, I've added the following;

if (CurrentCommand && CurrentCommand->Fct_Manage) {
...
}

if (OldCommand && OldCommand->Fct_Manage
            && OldCommand->fMenuFlag & SM_APP) {
    if (!(divider % Appli_Divider)) {
        OldCommand->Fct_Manage();
    }
}


SM_APP is a fMenuFlag that is unique to my app.

Seems to work a treat!

James.

Offline

 

# 5   2013-02-27 18:49:27 Display app menu and keep app running in background.

MCSolution
New member
Registered: 2010-11-27
Posts: 5

Re: Display app menu and keep app running in background.

Tried to implement the same behavior, but had no success until now.
Where did you define the SM_APP ?
Where did you set/pass the SM_APP from your application to circle OS?

Is there is at least a way to restart the last running application when leaving the Circle-Menu ConfigMenu or the MainMenu with "Quit"

Last edited by MCSolution (2013-02-27 19:18:06)

Offline

 

# 6   2013-02-27 20:55:59 Display app menu and keep app running in background.

JamesSt
New member
Registered: 2010-01-17
Posts: 9

Re: Display app menu and keep app running in background.

Sorry, this is so ancient history for me, I have no idea what I did 2 years ago.

Since then we've abandoned CircleOS in favour of a hand crafted app using the latest ST libraries, which includes DFU capabilities and a realtime application.

James.

Offline

 

  • Index
  •  » circleOS
  •  » Display app menu and keep app running in background.

Board footer