Merge branch 'master' into ralim/scrollbar
This commit is contained in:
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -8,25 +8,25 @@ assignees: Ralim
|
|||||||
---
|
---
|
||||||
|
|
||||||
**Describe the bug**
|
**Describe the bug**
|
||||||
A clear and concise description of what the bug is.
|
<!-- A clear and concise description of what the bug is. -->
|
||||||
|
|
||||||
**To Reproduce**
|
**To Reproduce**
|
||||||
Steps to reproduce the behavior:
|
<!-- Steps to reproduce the behavior:
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
2. Click on '....'
|
2. Click on '....'
|
||||||
3. Scroll down to '....'
|
3. Scroll down to '....'
|
||||||
4. See error
|
4. See error -->
|
||||||
|
|
||||||
**Expected behavior**
|
**Expected behavior**
|
||||||
A clear and concise description of what you expected to happen.
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
|
|
||||||
**Details on your device:**
|
**Details on your device:**
|
||||||
|
<!-- You can get these from the debug menu by holding the rear button down and then using the front one to cycle through-->
|
||||||
- Device: [e.g. TS80/Pinecil etc]
|
- Device: [e.g. TS80/Pinecil etc]
|
||||||
- Release: [eg 2.15.40087E6]
|
- Release: [eg 2.15.40087E6]
|
||||||
- Power adapter being used:
|
- Power adapter being used:
|
||||||
|
- If this is an acceleromter related issue, please include its model number here:
|
||||||
Note you can grab these from the debug menu.
|
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Questions are preferred to be kept to the discussions tab where possible, but otherwise go for it. be polite and as clear as possible.**
|
<!-- **Questions are preferred to be kept to the discussions tab where possible, but otherwise go for it. be polite and as clear as possible.** -->
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -8,13 +8,13 @@ assignees: Ralim
|
|||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
**Describe the solution you'd like**
|
||||||
A clear and concise description of what you want to happen.
|
<!-- A clear and concise description of what you want to happen. -->
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
**Describe alternatives you've considered**
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context or screenshots about the feature request here.
|
<!-- Add any other context or screenshots about the feature request here. -->
|
||||||
|
|||||||
@@ -52,18 +52,17 @@ This is shown in degrees C x10, so 200 == 20.0C
|
|||||||
|
|
||||||
The input voltage as read by the internal ADC. Can be used to sanity check its being read correctly.
|
The input voltage as read by the internal ADC. Can be used to sanity check its being read correctly.
|
||||||
|
|
||||||
### PCB
|
### ACC
|
||||||
|
|
||||||
This is slightly miss-named, but preserving the name for now.
|
|
||||||
This indicates the PCB "version" number, which comes from the TS100 changing the model of accelerometer without warning.
|
|
||||||
This indicates the accelerometer that is fitted inside the unit.
|
This indicates the accelerometer that is fitted inside the unit.
|
||||||
|
|
||||||
- 1 = MMA8652
|
- MMA8652
|
||||||
- 2 = LIS2DH12
|
- LIS2DH12
|
||||||
- 3 = BMA223
|
- BMA223
|
||||||
- 4 = MSA301
|
- MSA301
|
||||||
- 5 = SC7A20
|
- SC7A20
|
||||||
- 99 = None detected (running in fallback without movement detection)
|
- None detected -> running in fallback without movement detection
|
||||||
|
- Scanning -> Still searching I2C for one
|
||||||
|
|
||||||
### PWR
|
### PWR
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
|
|
||||||
Please try and fill out this template where possible, not all fields are required and can be removed.
|
<!-- Please try and fill out this template where possible, not all fields are required and can be removed. -->
|
||||||
|
|
||||||
* **Please check if the PR fulfills these requirements**
|
* **Please check if the PR fulfills these requirements**
|
||||||
- [] The changes have been tested locally
|
- [] The changes have been tested locally
|
||||||
- [] There are no breaking changes
|
- [] There are no breaking changes
|
||||||
|
|
||||||
* **What kind of change does this PR introduce?**
|
* **What kind of change does this PR introduce?**
|
||||||
(Bug fix, feature, docs update, ...)
|
<!-- (Bug fix, feature, docs update, ...) -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* **What is the current behavior?**
|
* **What is the current behavior?**
|
||||||
(You can also link to an open issue here)
|
<!-- (You can also just link to an open issue here) -->
|
||||||
|
|
||||||
* **What is the new behavior (if this is a feature change)?**
|
* **What is the new behavior (if this is a feature change)?**
|
||||||
|
|
||||||
|
|||||||
@@ -124,12 +124,24 @@ def get_debug_menu() -> List[str]:
|
|||||||
"CTip ",
|
"CTip ",
|
||||||
"CHan ",
|
"CHan ",
|
||||||
"Vin ",
|
"Vin ",
|
||||||
"PCB ",
|
"ACC ",
|
||||||
"PWR ",
|
"PWR ",
|
||||||
"Max ",
|
"Max ",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def get_accel_names_list() -> List[str]:
|
||||||
|
return [
|
||||||
|
"Scanning",
|
||||||
|
"None",
|
||||||
|
"MMA8652FC",
|
||||||
|
"LIS2DH12",
|
||||||
|
"BMA223",
|
||||||
|
"MSA301",
|
||||||
|
"SC7A20",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_letter_counts(
|
def get_letter_counts(
|
||||||
defs: dict, lang: dict, build_version: str
|
defs: dict, lang: dict, build_version: str
|
||||||
) -> Tuple[List[str], Dict[str, int]]:
|
) -> Tuple[List[str], Dict[str, int]]:
|
||||||
@@ -189,6 +201,7 @@ def get_letter_counts(
|
|||||||
for x in constants:
|
for x in constants:
|
||||||
text_list.append(x[1])
|
text_list.append(x[1])
|
||||||
text_list.extend(get_debug_menu())
|
text_list.extend(get_debug_menu())
|
||||||
|
text_list.extend(get_accel_names_list())
|
||||||
|
|
||||||
# collapse all strings down into the composite letters and store totals for these
|
# collapse all strings down into the composite letters and store totals for these
|
||||||
|
|
||||||
@@ -948,6 +961,16 @@ def get_translation_common_text(
|
|||||||
f'\t "{convert_string(symbol_conversion_table, c)}",//{c} \n'
|
f'\t "{convert_string(symbol_conversion_table, c)}",//{c} \n'
|
||||||
)
|
)
|
||||||
translation_common_text += "};\n\n"
|
translation_common_text += "};\n\n"
|
||||||
|
|
||||||
|
# accel names
|
||||||
|
translation_common_text += "const char* AccelTypeNames[] = {\n"
|
||||||
|
|
||||||
|
for c in get_accel_names_list():
|
||||||
|
translation_common_text += (
|
||||||
|
f'\t "{convert_string(symbol_conversion_table, c)}",//{c} \n'
|
||||||
|
)
|
||||||
|
translation_common_text += "};\n\n"
|
||||||
|
|
||||||
return translation_common_text
|
return translation_common_text
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ extern const char *SymbolCellCount;
|
|||||||
extern const char *SymbolVersionNumber;
|
extern const char *SymbolVersionNumber;
|
||||||
|
|
||||||
extern const char *DebugMenu[];
|
extern const char *DebugMenu[];
|
||||||
|
extern const char *AccelTypeNames[];
|
||||||
|
|
||||||
enum class SettingsItemIndex : uint8_t {
|
enum class SettingsItemIndex : uint8_t {
|
||||||
DCInCutoff,
|
DCInCutoff,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "OLED.hpp"
|
#include "OLED.hpp"
|
||||||
#include "Setup.h"
|
#include "Setup.h"
|
||||||
extern uint8_t DetectedAccelerometerVersion;
|
|
||||||
extern uint32_t currentTempTargetDegC;
|
extern uint32_t currentTempTargetDegC;
|
||||||
extern bool settingsWereReset;
|
extern bool settingsWereReset;
|
||||||
extern bool usb_pd_available;
|
extern bool usb_pd_available;
|
||||||
@@ -13,8 +12,6 @@ extern "C" {
|
|||||||
|
|
||||||
void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed portCHAR *pcTaskName);
|
void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed portCHAR *pcTaskName);
|
||||||
|
|
||||||
#define NO_DETECTED_ACCELEROMETER 99
|
|
||||||
#define ACCELEROMETERS_SCANNING 100
|
|
||||||
// Threads
|
// Threads
|
||||||
void startGUITask(void const *argument);
|
void startGUITask(void const *argument);
|
||||||
void startPIDTask(void const *argument);
|
void startPIDTask(void const *argument);
|
||||||
@@ -26,5 +23,17 @@ extern uint8_t accelInit;
|
|||||||
extern TickType_t lastMovementTime;
|
extern TickType_t lastMovementTime;
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
// Accelerometer type
|
||||||
|
enum class AccelType {
|
||||||
|
Scanning = 0,
|
||||||
|
None = 1,
|
||||||
|
MMA = 2,
|
||||||
|
LIS = 3,
|
||||||
|
BMA = 4,
|
||||||
|
MSA = 5,
|
||||||
|
SC7 = 6,
|
||||||
|
};
|
||||||
|
extern AccelType DetectedAccelerometerVersion;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* __MAIN_H */
|
#endif /* __MAIN_H */
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
#include "power.hpp"
|
#include "power.hpp"
|
||||||
uint8_t DetectedAccelerometerVersion = 0;
|
AccelType DetectedAccelerometerVersion = AccelType::Scanning;
|
||||||
bool settingsWereReset = false;
|
bool settingsWereReset = false;
|
||||||
// FreeRTOS variables
|
// FreeRTOS variables
|
||||||
|
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ void showDebugMenu(void) {
|
|||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
// Print PCB ID number
|
// Print PCB ID number
|
||||||
OLED::printNumber(DetectedAccelerometerVersion, 2, FontStyle::SMALL);
|
OLED::print(AccelTypeNames[(int)DetectedAccelerometerVersion], FontStyle::SMALL);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
// Power negotiation status
|
// Power negotiation status
|
||||||
@@ -768,11 +768,11 @@ void showWarnings() {
|
|||||||
// We also want to alert if accel or pd is not detected / not responding
|
// We also want to alert if accel or pd is not detected / not responding
|
||||||
// In this case though, we dont want to nag the user _too_ much
|
// In this case though, we dont want to nag the user _too_ much
|
||||||
// So only show first 2 times
|
// So only show first 2 times
|
||||||
while (DetectedAccelerometerVersion == ACCELEROMETERS_SCANNING) {
|
while (DetectedAccelerometerVersion == AccelType::Scanning) {
|
||||||
osDelay(5);
|
osDelay(5);
|
||||||
}
|
}
|
||||||
// Display alert if accelerometer is not detected
|
// Display alert if accelerometer is not detected
|
||||||
if (DetectedAccelerometerVersion == NO_DETECTED_ACCELEROMETER) {
|
if (DetectedAccelerometerVersion == AccelType::None) {
|
||||||
if (getSettingValue(SettingsOptions::AccelMissingWarningCounter) < 2) {
|
if (getSettingValue(SettingsOptions::AccelMissingWarningCounter) < 2) {
|
||||||
nextSettingValue(SettingsOptions::AccelMissingWarningCounter);
|
nextSettingValue(SettingsOptions::AccelMissingWarningCounter);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ uint8_t accelInit = 0;
|
|||||||
TickType_t lastMovementTime = 0;
|
TickType_t lastMovementTime = 0;
|
||||||
|
|
||||||
void detectAccelerometerVersion() {
|
void detectAccelerometerVersion() {
|
||||||
DetectedAccelerometerVersion = ACCELEROMETERS_SCANNING;
|
DetectedAccelerometerVersion = AccelType::Scanning;
|
||||||
#ifdef ACCEL_MMA
|
#ifdef ACCEL_MMA
|
||||||
if (MMA8652FC::detect()) {
|
if (MMA8652FC::detect()) {
|
||||||
if (MMA8652FC::initalize()) {
|
if (MMA8652FC::initalize()) {
|
||||||
DetectedAccelerometerVersion = 1;
|
DetectedAccelerometerVersion = AccelType::MMA;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -41,7 +41,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (LIS2DH12::detect()) {
|
if (LIS2DH12::detect()) {
|
||||||
// Setup the ST Accelerometer
|
// Setup the ST Accelerometer
|
||||||
if (LIS2DH12::initalize()) {
|
if (LIS2DH12::initalize()) {
|
||||||
DetectedAccelerometerVersion = 2;
|
DetectedAccelerometerVersion = AccelType::LIS;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -49,7 +49,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (BMA223::detect()) {
|
if (BMA223::detect()) {
|
||||||
// Setup the BMA223 Accelerometer
|
// Setup the BMA223 Accelerometer
|
||||||
if (BMA223::initalize()) {
|
if (BMA223::initalize()) {
|
||||||
DetectedAccelerometerVersion = 3;
|
DetectedAccelerometerVersion = AccelType::BMA;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -57,7 +57,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (MSA301::detect()) {
|
if (MSA301::detect()) {
|
||||||
// Setup the MSA301 Accelerometer
|
// Setup the MSA301 Accelerometer
|
||||||
if (MSA301::initalize()) {
|
if (MSA301::initalize()) {
|
||||||
DetectedAccelerometerVersion = 4;
|
DetectedAccelerometerVersion = AccelType::MSA;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -65,43 +65,43 @@ void detectAccelerometerVersion() {
|
|||||||
if (SC7A20::detect()) {
|
if (SC7A20::detect()) {
|
||||||
// Setup the SC7A20 Accelerometer
|
// Setup the SC7A20 Accelerometer
|
||||||
if (SC7A20::initalize()) {
|
if (SC7A20::initalize()) {
|
||||||
DetectedAccelerometerVersion = 5;
|
DetectedAccelerometerVersion = AccelType::SC7;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// disable imu sensitivity
|
// disable imu sensitivity
|
||||||
setSettingValue(SettingsOptions::Sensitivity, 0);
|
setSettingValue(SettingsOptions::Sensitivity, 0);
|
||||||
DetectedAccelerometerVersion = NO_DETECTED_ACCELEROMETER;
|
DetectedAccelerometerVersion = AccelType::None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) {
|
inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) {
|
||||||
#ifdef ACCEL_LIS
|
|
||||||
if (DetectedAccelerometerVersion == 2) {
|
|
||||||
LIS2DH12::getAxisReadings(tx, ty, tz);
|
|
||||||
rotation = LIS2DH12::getOrientation();
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
#ifdef ACCEL_MMA
|
#ifdef ACCEL_MMA
|
||||||
if (DetectedAccelerometerVersion == 1) {
|
if (DetectedAccelerometerVersion == AccelType::MMA) {
|
||||||
MMA8652FC::getAxisReadings(tx, ty, tz);
|
MMA8652FC::getAxisReadings(tx, ty, tz);
|
||||||
rotation = MMA8652FC::getOrientation();
|
rotation = MMA8652FC::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ACCEL_LIS
|
||||||
|
if (DetectedAccelerometerVersion == AccelType::LIS) {
|
||||||
|
LIS2DH12::getAxisReadings(tx, ty, tz);
|
||||||
|
rotation = LIS2DH12::getOrientation();
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
#ifdef ACCEL_BMA
|
#ifdef ACCEL_BMA
|
||||||
if (DetectedAccelerometerVersion == 3) {
|
if (DetectedAccelerometerVersion == AccelType::BMA) {
|
||||||
BMA223::getAxisReadings(tx, ty, tz);
|
BMA223::getAxisReadings(tx, ty, tz);
|
||||||
rotation = BMA223::getOrientation();
|
rotation = BMA223::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_MSA
|
#ifdef ACCEL_MSA
|
||||||
if (DetectedAccelerometerVersion == 4) {
|
if (DetectedAccelerometerVersion == AccelType::MSA) {
|
||||||
MSA301::getAxisReadings(tx, ty, tz);
|
MSA301::getAxisReadings(tx, ty, tz);
|
||||||
rotation = MSA301::getOrientation();
|
rotation = MSA301::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_SC7
|
#ifdef ACCEL_SC7
|
||||||
if (DetectedAccelerometerVersion == 5) {
|
if (DetectedAccelerometerVersion == AccelType::SC7) {
|
||||||
SC7A20::getAxisReadings(tx, ty, tz);
|
SC7A20::getAxisReadings(tx, ty, tz);
|
||||||
rotation = SC7A20::getOrientation();
|
rotation = SC7A20::getOrientation();
|
||||||
} else
|
} else
|
||||||
|
|||||||
Reference in New Issue
Block a user