Files
edgetx-gx12/radio/src/tasks_arm.h
T
Arne SchwabeandBertrand Songis 59d2ef8aa1 Rework rssi code a bit (#5507)
* Switch backlight on when displaying a warning.

This is especially visible on the power off RSSI warning. This will also show the other warnings at start with backlight, even when blocklight is set to always off. But my X9D+ will switch its backlight on after boot once even with backlight on, so backlight=off is not so off as it seems.

* Rework power rssi code a bit

- Cleanup shutdown_confirm code
- allow x9d+ to be compiled as power button too to be able to test these things on the x9d+
- Fix shutoff after 10s in warning dialog on x9d
- Make warning dialog always turn on backlight

* Revert CMakeLists.txt
2017-12-12 22:01:32 +01:00

80 lines
1.9 KiB
C++

/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _TASKS_ARM_H_
#define _TASKS_ARM_H_
#if !defined(SIMU)
extern "C" {
#include <CoOS.h>
}
#endif
#define MENUS_STACK_SIZE 2000
#define MIXER_STACK_SIZE 500
#define AUDIO_STACK_SIZE 500
#define BLUETOOTH_STACK_SIZE 500
#if defined(_MSC_VER)
#define _ALIGNED(x) __declspec(align(x))
#elif defined(__GNUC__)
#define _ALIGNED(x) __attribute__ ((aligned(x)))
#endif
uint16_t getStackAvailable(void * address, uint16_t size);
template<int SIZE>
class TaskStack
{
public:
TaskStack() { }
void paint();
uint16_t size()
{
return SIZE * 4;
}
uint16_t available()
{
return getStackAvailable(stack, SIZE);
}
OS_STK stack[SIZE];
};
void stackPaint();
uint16_t stackSize();
uint16_t stackAvailable();
extern OS_TID menusTaskId;
// menus stack must be aligned to 8 bytes otherwise printf for %f does not work!
extern TaskStack<MENUS_STACK_SIZE> _ALIGNED(8) menusStack;
extern OS_TID mixerTaskId;
extern TaskStack<MIXER_STACK_SIZE> mixerStack;
extern OS_TID audioTaskId;
extern TaskStack<AUDIO_STACK_SIZE> audioStack;
void tasksStart();
extern volatile uint16_t timeForcePowerOffPressed;
inline void resetForcePowerOffRequest() {timeForcePowerOffPressed = 0; }
#endif // _TASKS_ARM_H_