Skip to content

Commit

Permalink
Merge pull request #4 from Ralim/dev
Browse files Browse the repository at this point in the history
Merge upstream changes into fork
  • Loading branch information
Samuelrmlink authored Feb 27, 2023
2 parents 6bf3488 + 6fc27e1 commit d692cd4
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 31 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ _This firmware does **NOT** support the USB port while running for changing sett

| Device | DC | QC | PD | EPR | BLE | Battery | Recommended |
| :--------: | :-: | :-: | :-: | :-: | :-: | :-----: | :---------: |
| MHP30 ||| ✔️ |||| ✔️ |
| Pinecil V1 | ✔️ | ✔️ | ✔️ ||| ✔️ | ✔️ |
| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| TS80P || ✔️ | ✔️ ||| ✔️ | ✔️ |
| TS100 | ✔️ ||||| ✔️ | |
| TS80 || ✔️ |||| ✔️ ||
| MHP30 ||| ✔️ |||| ✔️ |
| Pinecil V1 | ✔️ | ✔️ | ✔️ ||| ✔️ | ✔️ |
| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| TS80P || ✔️ | ✔️ ||| ✔️ | ✔️ |
| TS100 | ✔️ ||||| ✔️ | * |
| TS80 || ✔️ |||| ✔️ |** |

\*Please note that Miniware started shipping TS100's using cloned STM32 Chips. While these do work with IronOS, their DFU bootloader works terribly, and it is hard to get it to successfully flash larger firmware images like IronOS without timing out. This is the main reason why the TS100 is **_no longer recommended_**.

\**TS80 is replaced by TS80P. Production ramped down a long time ago and it's just existing stock clearing the system. It's marked not recommended being optimistic that people might pause and buy the far superior TS80P instead. This is the main reason why the \
TS80 is **_no longer recommended_**.

## Getting Started

To get started with IronOS firmware, please jump to [Getting Started Guide](https://ralim.github.io/IronOS/GettingStarted/).
Expand Down
8 changes: 4 additions & 4 deletions Translations/translation_BE.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"message": "!ЗАМКНУТЫ!"
},
"WarningThermalRunaway": {
"message": "Цеплавы\nУцякач"
"message": "Некантралюемае\nразаграванне"
},
"SettingsCalibrationWarning": {
"message": "Пераканайцеся, што пры наступнай загрузцы наканечнік і ручка маюць пакаёвую тэмпературу!"
Expand Down Expand Up @@ -240,12 +240,12 @@
"description": ""
},
"BLEEnabled": {
"displayText": "BLE\n Enabled",
"displayText": "BLE\n Уключаны",
"description": ""
},
"PDVpdoEnabled": {
"displayText": "PD VPDO\nEnabled",
"description": "Enables PPS/EPR modes."
"displayText": "PD VPDO\nУключаны",
"description": "Уключае рэжымы PPS/EPR."
}
}
}
6 changes: 3 additions & 3 deletions Translations/translation_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@
"displayText": "BLE\n Enabled",
"description": "Enables BLE"
},
"PDVpdoEnabled": {
"PDVpdoEnabled": {
"displayText": "PD VPDO\nEnabled",
"description": "Enables PPS/EPR modes."
}
"description": "Enables PPS/EPR modes."
}
}
}
6 changes: 3 additions & 3 deletions Translations/translation_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@
"description": ""
},
"BLEEnabled": {
"displayText": "BLE\n Enabled",
"displayText": "BLE\n Włączony",
"description": ""
},
"PDVpdoEnabled": {
"displayText": "PD VPDO\nEnabled",
"description": "Enables PPS/EPR modes."
"displayText": "PD VPDO\nWłączony",
"description": "Włącza tryby PPS/EPR."
}
}
}
8 changes: 4 additions & 4 deletions Translations/translation_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"message": "!ЗАБЛОК!"
},
"WarningThermalRunaway": {
"message": "Thermal\nRunaway"
"message": "Неуправляемый\nРазогрев"
},
"SettingsCalibrationWarning": {
"message": "Пожалуйста, убедитесь, что жало и корпус имеют комнатную температуру при следующей загрузке!"
Expand Down Expand Up @@ -240,12 +240,12 @@
"description": ""
},
"BLEEnabled": {
"displayText": "BLE\n Enabled",
"displayText": "BLE\n Включено",
"description": ""
},
"PDVpdoEnabled": {
"displayText": "PD VPDO\nEnabled",
"description": "Enables PPS/EPR modes."
"displayText": "PD VPDO\nВключено",
"description": "Включает режимы PPS/EPR."
}
}
}
6 changes: 3 additions & 3 deletions Translations/translation_UK.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@
"description": ""
},
"BLEEnabled": {
"displayText": "BLE\n Enabled",
"displayText": "BLE\n Увімкнено",
"description": ""
},
"PDVpdoEnabled": {
"displayText": "PD VPDO\nEnabled",
"description": "Enables PPS/EPR modes."
"displayText": "PD VPDO\nУвімкнено",
"description": "Вмикає режими PPS/EPR."
}
}
}
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecilv2/ble_characteristics.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_16(35)
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_16(36)
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_16(37)
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_16(37)
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_16(38)

#endif
11 changes: 11 additions & 0 deletions source/Core/BSP/Pinecilv2/ble_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "uuid.h"

#include "OperatingModes.h"
#include "OLED.hpp"
#include "USBPD.h"
#include "ble_characteristics.h"
#include "ble_handlers.h"
Expand Down Expand Up @@ -242,6 +243,16 @@ int ble_char_write_setting_value_callback(struct bt_conn *conn, const struct bt_
}
} else if (uuid_value < SettingsOptions::SettingsOptionsLength) {
setSettingValue((SettingsOptions)(uuid_value), new_value);
// @TODO refactor to make this more usable
if (uuid_value == SettingsOptions::OLEDInversion) {
OLED::setInverseDisplay(getSettingValue(SettingsOptions::OLEDInversion));
}
if (uuid_value == SettingsOptions::OLEDBrightness){
OLED::setBrightness(getSettingValue(SettingsOptions::OLEDBrightness));
}
if (uuid_value == SettingsOptions::OrientationMode){
OLED::setRotation(getSettingValue(SettingsOptions::OrientationMode) & 1);
}
return len;
}
}
Expand Down
15 changes: 8 additions & 7 deletions source/Core/Src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,16 @@ void resetSettings() {

void setSettingValue(const enum SettingsOptions option, const uint16_t newValue) {
const auto constants = settingsConstants[(int)option];
systemSettings.settingsValues[(int)option] = newValue;
// If less than min, constrain
if (systemSettings.settingsValues[(int)option] < constants.min) {
systemSettings.settingsValues[(int)option] = constants.min;
uint16_t constrainedValue = newValue;
if (constrainedValue < constants.min) {
// If less than min, constrain
constrainedValue = constants.min;
}
// If hit max, constrain
if (systemSettings.settingsValues[(int)option] > constants.max) {
systemSettings.settingsValues[(int)option] = constants.max;
else if (constrainedValue > constants.max) {
// If hit max, constrain
constrainedValue = constants.max;
}
systemSettings.settingsValues[(int)option] = constrainedValue;
}
// Lookup wrapper for ease of use (with typing)
uint16_t getSettingValue(const enum SettingsOptions option) { return systemSettings.settingsValues[(int)option]; }
Expand Down

0 comments on commit d692cd4

Please sign in to comment.