Default switchs / pots / sliders configuration moved to the HAL (#6514)
Default switchs / pots / sliders configuration moved to the HAL
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#define _BOARD_HORUS_H_
|
||||
|
||||
#include "../definitions.h"
|
||||
#include "../opentx_constants.h"
|
||||
#include "cpu_id.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
@@ -425,6 +426,10 @@ enum Analogs {
|
||||
|
||||
#define POT_LAST (SLIDER_FIRST - 1)
|
||||
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 14) + (SWITCH_3POS << 12) + (SWITCH_2POS << 10) + (SWITCH_3POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 4) + (POT_MULTIPOS_SWITCH << 2) + (POT_WITHOUT_DETENT << 0)
|
||||
#define DEFAULT_SLIDERS_CONFIG (SLIDER_WITH_DETENT << 3) + (SLIDER_WITH_DETENT << 2) + (SLIDER_WITH_DETENT << 1) + (SLIDER_WITH_DETENT << 0)
|
||||
|
||||
enum CalibratedAnalogs {
|
||||
CALIBRATED_STICK1,
|
||||
CALIBRATED_STICK2,
|
||||
@@ -521,6 +526,7 @@ void ledBlue(void);
|
||||
#define LCD_DEPTH 16
|
||||
void lcdInit(void);
|
||||
void lcdRefresh(void);
|
||||
void lcdCopy(void * dest, void * src);
|
||||
void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color);
|
||||
void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint16_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h);
|
||||
void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint16_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include "board_lowlevel.h"
|
||||
#include "audio_driver.h"
|
||||
#include "../opentx_constants.h"
|
||||
|
||||
extern uint16_t ResetReason;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "../definitions.h"
|
||||
#include "../opentx_constants.h"
|
||||
#include "cpu_id.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(SIMU)
|
||||
@@ -448,28 +449,43 @@ enum EnumSwitchesPositions
|
||||
#if defined(PCBXLITES)
|
||||
#define NUM_SWITCHES 6
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 2) + (POT_WITHOUT_DETENT << 0)
|
||||
#elif defined(PCBXLITE)
|
||||
#define NUM_SWITCHES 4
|
||||
#define STORAGE_NUM_SWITCHES 6
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_2POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 2) + (POT_WITHOUT_DETENT << 0)
|
||||
#elif defined(PCBT12)
|
||||
#define NUM_SWITCHES 6
|
||||
#define STORAGE_NUM_SWITCHES 8
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(PCBX7)
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 10) + (SWITCH_2POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITHOUT_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#elif defined(PCBX9LITE)
|
||||
#define NUM_SWITCHES 5
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 8) + (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0);
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0); // S1 = pot with detent
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_SWITCHES 18 // yes, it's perfect like that !
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 14) + (SWITCH_3POS << 12) + (SWITCH_2POS << 10) + (SWITCH_3POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#define DEFAULT_SLIDERS_CONFIG (SLIDER_WITH_DETENT << 1) + (SLIDER_WITH_DETENT << 0)
|
||||
#else
|
||||
#define NUM_SWITCHES 8
|
||||
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
|
||||
#define DEFAULT_SWITCH_CONFIG (SWITCH_TOGGLE << 14) + (SWITCH_3POS << 12) + (SWITCH_2POS << 10) + (SWITCH_3POS << 8) + (SWITCH_3POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_3POS << 0)
|
||||
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2); // S1 = pot without detent, S2 = pot with detent
|
||||
#define DEFAULT_SLIDERS_CONFIG (SLIDER_WITH_DETENT << 1) + (SLIDER_WITH_DETENT << 0)
|
||||
#endif
|
||||
|
||||
#define STORAGE_NUM_SWITCHES_POSITIONS (STORAGE_NUM_SWITCHES * 3)
|
||||
#define NUM_SWITCHES_POSITIONS (NUM_SWITCHES * 3)
|
||||
|
||||
void keysInit(void);
|
||||
uint8_t keyState(uint8_t index);
|
||||
|
||||
Reference in New Issue
Block a user