Compare commits

...

39 Commits

Author SHA1 Message Date
Ben V. Brown
dda6a82647 Minor PD changes, mostly fixing NO_DYNAMIC (#2142)
* Update usb-pd

* Ensure NO_DYNAMIC always works

* Update usb-pd

* Update usb-pd
2025-07-23 19:39:55 +10:00
Ben V. Brown
b4bb6d5488 Fix 2115 2131 (#2143)
* Mark Pinecilv1 NRND

Closes #2131

* Fix #2115

Refactor lost line
2025-07-23 19:39:51 +10:00
Karakurt
580bc4f70d Updated flasher script with some quality of life (#2141)
* Added automatic retries

* Generalized naming
2025-07-17 00:10:50 +00:00
Karakurt
c00df49708 Added support for spaces in directory names (#2140) 2025-07-16 23:07:19 +00:00
Ben V. Brown
009aa10a53 Fix docs gen check (#2139)
* Adding CI check to prevent settings docs drift
* Fixup gen_menu_docs
* Generate new settings docs
2025-07-16 16:03:26 +10:00
Ben V. Brown
260891b00b Adding documentation around debugging PD PSU's (#2111)
* Create USB-PD Debug docs

* Add to menu

* Update DebuggingPD.md
2025-07-07 14:49:48 +10:00
Witska
bc6d5d16d5 Update translation_LT.json (#2134) 2025-07-06 18:25:49 +10:00
fredericuslaurentii
985075afdf Update translation_IT.json (#2117)
* Update translation_IT.json

* Update translation_IT.json
2025-07-04 12:24:59 +10:00
IkerGarcia
1184163cde Update translation_ES.json (#2133) 2025-07-03 06:33:39 +10:00
Sirse
0813b38f61 Update translation_RU.json (#2130) 2025-06-08 08:29:21 +00:00
protato7
0f3e03e7cf blisp typo in Logo.md (#2129) 2025-05-22 22:12:01 +00:00
Steven Seifried
6b20522a8a Updated translation_DE.json (#2128)
* Updated translation_DE.json

* Updated translation_DE.json
2025-05-20 13:21:16 +10:00
nomakewan
8d40afcaa1 Add missing dependency (#2118)
img2logo.py has IntelHex as a dependency which is not installed by default with Python3 or Pillow and so should be specified explicitly in the instructions.
2025-04-14 01:50:21 +00:00
Ivan Zorin
3d331aa094 Merge pull request #2103 from ia/reverse-button-settings
Add option to swap A/B buttons in Settings menu with minimal changes (fix for #2034)
2025-03-20 01:24:14 +03:00
Ivan Zorin
ab6657c75b Sync 2025-03-20 01:02:39 +03:00
Ivan Zorin
ac080eb909 Merge pull request #2108 from ia/py-diff
Makefile: add diff output for python linter if there are some warnings
2025-03-20 00:59:35 +03:00
Ivan Zorin
6de9dd860f .github/push.yml: add diff output for python linter if there are some warnings 2025-03-20 00:01:40 +03:00
Ivan Zorin
bd15926e6a Makefile: add diff output for python linter if there are some warnings 2025-03-19 23:50:48 +03:00
Ivan Zorin
d3bc0fd332 Sync 2025-03-17 01:39:27 +03:00
Ivan Zorin
61f5211d3a Merge pull request #2107 from ia/debug-time
Update debug time stamp according to the official recommendation from reproducible builds initiative by @paulfertser suggestion
2025-03-17 01:32:56 +03:00
Ivan Zorin
a66dbeb12b Update debug time stamp according to the official recommendation from reproducible builds iniative by @paulfertser suggestion 2025-03-17 00:06:04 +03:00
Ivan Zorin
24ffc3eb8c Switch slide scrolling animation for debug menu from the bottom 2025-03-16 23:29:33 +03:00
Ivan Zorin
1a673b8b91 Swap AB buttons setting: use another approach by keeping original switch/case intact but adding another one 2025-03-10 10:51:10 +03:00
Ivan Zorin
ccda1713c1 Disable ReverseButtonSettings option by default 2025-03-10 05:42:37 +03:00
Ivan Zorin
ce3fea8176 Add option to swap A/B buttons in Settings menu with minimal changes (#2034) 2025-03-10 05:01:07 +03:00
Ivan Zorin
03ec177058 Merge pull request #2102 from ia/soldering-home-no-slide
Disable animation between home and soldering screens if detailed view is set for both modes (probably a finally proper fix for #2076)
2025-03-09 04:15:05 +03:00
Ivan Zorin
c698c58e3a Making clang-format happy 2025-03-07 07:03:24 +03:00
Ivan Zorin
42aeee1c0b Alternative solution with more code lines in different functions 2025-03-07 06:59:33 +03:00
Ivan Zorin
11d9f1ab1d Fix code style 2025-03-07 05:35:53 +03:00
Ivan Zorin
7dbc55fa2b Probably a finally proper fix for #2076 2025-03-07 05:22:20 +03:00
Philippe Teuwen
83aa1b6425 Adding Pinecilv2 ws2812b mod option (#2099)
* support for WS2812B mod on Pinecil v2

* document support for WS2812B mod on Pinecil v2

* update IronOS-mkdocs.yml

* Protect WS2812B_Pin with define WS2812B_ENABLE
2025-03-06 22:36:01 +03:00
Ben V. Brown
5e8ab27958 Mhp 30 fixes (#2094)
* Fix LED control for MHP30

* Refactor the draw rect function to fix heating

* FIXUP to include correct menu title for MHP30

Closes #2036

* Fixes for ADC mode init

Fixes #2043
2025-03-06 08:59:05 +11:00
Ivan Zorin
51afcbd733 Revert "Add option to swap A / B buttons in Settings menu" (#2098)
Revert "Add option to swap A / B buttons in Settings menu (#2059)"

This reverts commit c6bdc28081.
2025-03-05 10:53:38 +11:00
Ben V. Brown
5041326335 Add missing BLE settings (#2095)
Fixes #2044
2025-03-05 08:22:20 +11:00
Ivan Zorin
7de5698abb push.yml: update runs-on to ubuntu-24.04 to fix upload_metadata build step (#2097)
push.yml: unify and update runs-on to ubuntu-24.04 to fix upload_metadata build step and to fix IronOS build pipeline (#2096)
2025-03-04 20:05:13 +01:00
Leo
c6bdc28081 Add option to swap A / B buttons in Settings menu (#2059)
* Add option to swap A / B buttons in Settings menu

---------

Co-authored-by: Ivan Zorin <ivan.a.zorin@gmail.com>
2025-03-04 14:35:48 +03:00
oliverpool
0e044cf108 README: add notice about another revision of TS101 with a different not supported yet OLED model (#2084)
* Update REAMDE

---------

Co-authored-by: Ivan Zorin <ivan.a.zorin@gmail.com>
2025-03-02 01:32:53 +03:00
tabudz
d775036c9e Fix: Potential Vulnerability in Cloned Function (#2087)
* Fix for #168

* Adapt style ecc_dsa.c

* Update ecc_dsa.c
2025-03-02 09:07:51 +11:00
Ben V. Brown
08002e0d33 Fix RToS Update (#2091)
* Silence undef

* Update Makefile

* Fix task priorities

* Bump CI host images

* Format c++

* Update make_translation.py

* Update bl702_common.c
2025-03-02 08:56:23 +11:00
94 changed files with 1050 additions and 389 deletions

View File

@@ -10,9 +10,9 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: alpine:3.19
image: alpine:3.21
strategy:
matrix:
model:
@@ -70,9 +70,9 @@ jobs:
if-no-files-found: error
build_multi-lang:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: alpine:3.19
image: alpine:3.21
strategy:
matrix:
model: ["Pinecil", "Pinecilv2"]
@@ -118,7 +118,7 @@ jobs:
upload_metadata:
needs: [build, build_multi-lang]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Download all prebuilts
@@ -136,9 +136,9 @@ jobs:
if-no-files-found: error
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: alpine:3.19
image: alpine:3.21
steps:
- name: Install dependencies (apk)
@@ -158,9 +158,9 @@ jobs:
run: make -C source/ Objects/host/brieflz/libbrieflz.so && ./Translations/brieflz_test.py
check_c-cpp:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: alpine:3.19
image: alpine:3.21
steps:
- name: Install dependencies (apk)
@@ -173,10 +173,19 @@ jobs:
- name: Check format style with clang-format
run: make clean check-style
check-settings-docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run the menu docs generator
run: python Translations/gen_menu_docs.py
- name: Check that Documentation/Settings.md didn't change
run: git diff --exit-code
check_python:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: alpine:3.19
image: alpine:3.21
steps:
- name: Install dependencies (apk)
@@ -190,14 +199,14 @@ jobs:
run: python3 -m pip install --break-system-packages bdflib flake8
- name: Check python formatting with black
run: black --check Translations
run: black --diff --check Translations
- name: Check python with flake8
run: flake8 Translations
check_shell:
name: check_shell
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: shellcheck
@@ -209,9 +218,9 @@ jobs:
check_all_files_with_shebangs: "false" # Optional.
check_docs:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: alpine:3.19
image: alpine:3.21
steps:
- name: Install dependencies (apk)

View File

@@ -0,0 +1,61 @@
# Debugging PD
When using many of these soldering irons, the recommended power source is to use a USB-PD power supply.
Occasionally, issues are run into where the iron reboots or appears to not boot when connected to this supply.
There are generally a few different reasons for this to occur, the first is of course a bug or incompatibility in the IronOS PD-stack / firmware, but there are also power adapters that either have issues or try to be _smart_ to the detriment of compatibility.
It also helps to remember that driving a soldering iron is not like a normal load that these power supplies are designed for. Normally a laptop or phone will gently ramp the power draw up and down. Where as the soldering iron will rapidly go from 0 to full power, and then back to 0 again. This can cause issues with some power supplies tripping out.
In general, a normal, boring 60-100W PD supply is recommended. Watch out for adapters with multiple ports that are used by marketing to advertise a higher number. It's somewhat common to see 65W adapters being pushed that have two ports, one of which is 45W and one that is 20W. These cannot support 65W output on one typically.
Smarter chargers that try to implement every known protocol can come with quirks. Often slight shortcuts are taken in the PD implementation that can cause hard to debug issues.
## If the unit doesn't power up at all
This can be the most frustrating one to diagnose.
First, test the device powers up when powered by a USB-A -> USB-C cable. Or a DC power supply. This can rule out other issues that cause the device to appear off (bad flashing).
### No power
If your device won't power up on any other supply type, look into if you can boot into the bootloader. This is usually done by holding down a button while connecting it to a computer and then checking if it's detected.
If the device shows up to a computer, but doesn't operate when powered up normally, the two most likely causes are a bad flash/firmware OR a non-functioning display.
Testing alternative firmware builds or trying to heat the unit (pressing the front button) can be ways to test this.
### Powers up on other supplies
If the device powers up on other supplies, but not on the USB-PD supply, it could be a problem with the USB-PD supply itself. Try using a different USB-PD supply to see if the issue persists.
If the unit does not power on any PD supplies it could be damage to the PD PHY or the USB connector. USB-PD uses the CC pins on the connector, which are not used for normal data so a USB-A adapter for example doesn't use these at all.
## If the unit powers up but keeps rebooting
There are two causes of this:
1. If the reboot occurs when the unit starts to heat up, then it is the power supply being unable to supply the power requested.
2. The unit reboots frequently even without any buttons being pressed.
If this is the issue that you are seeing, then the problem is that something during the PD initialisation is failing.
The _best_ way to resolve this is to be able to capture the USB PD traffic. This is the only way to know what is **really** going on and why the two devices can't negotiate.
To capture PD traffic requires a device that can capture this data. A logic analyser can be used on the CC pins, though note that the signalling voltage is < 3.3V so it will require a logic analyser that can handle this or buffering.
Alternatively, a lot of the higher-end USB power meter units can capture the packets. It doesn't matter if it only shows these on screen or if it can save these out to a file (ideally a file though).
**Without a traffic capture, all debugging is guessing**
On firmwares 2.23+ there is a toggle in advanced settings to change the PD mode. This will adjust how the firmware negotiates with the PD supply slightly. This can enable/disable the PPS and EPR modes (dynamic voltage negotiation).
PPS is known to be incorrectly implemented on some supplies, so turning off these features can improve compatibility.
If the device is _sometimes_ stable, you can on Pinecil devices boot while holding the front button to enter the PD debug menu. This will show what voltages & power levels are being advertised by the device. This can be used to cross-check with what is printed on the adapter. Take into consideration that non e-marked cables will be limited to 3A and that EPR requires specifically marked cables.
If you take the tip out of the iron, it will result in most devices not negotiating a PD profile (the irons wait to know what kind of tip is installed). This can be used to stop the failing negotiations in some situations to allow viewing this menu.
Before filing a support request, please try testing other power adapters & cables to try and narrow down the possibilities of the issue being a one-off.
If you have the capability to capture the PD traffic, that makes the problem exponentially easier to rectify.

View File

@@ -26,11 +26,13 @@ It is easiest if you copy your logo file to be converted into this folder too, i
The image can be in color and any size, but it will be resized and converted to 1-bit color. However, it looks best if you create a 96x16 image (`png` or `bmp`) in any image editor and color the pixels black & white manually. The thresholding used for converting colour to B&W may not always work as well as one would hope.
The converter requires at least Python3 and Pillow apps. Follow online instructions for installing Python and Pillow on your machine. Any reasonably recent version should work well.
The converter requires at least Python3 and Pillow apps as well as the IntelHex library for Python. Follow online instructions for installing Python, Pillow, and IntelHex on your machine. Any reasonably recent version should work well.
When running the script on the Windows operating system; it is recommended to use `Powershell` rather than the old `Command Prompt`.
When running the script on the Windows operating system it is recommended to use `Powershell` rather than the old `Command Prompt`.
For installing pillow; you can install it via your package manager (Debian and similar distros) or via pip. To install via pip the command should be `python -m pip install pillow`.
For installing pillow, you can install it via your package manager (Debian and similar distros) or via pip. To install via pip the command should be `python -m pip install pillow`.
For installing IntelHex you can use the same pip command as above but replace `pillow` with `intelhex` so that it becomes `python -m pip install intelhex`.
In your shell you can now execute `python img2logo.py input.png out -m ${model}` to convert the file `input.png` and create output files in the folder `out`.
The model should be replaced by one of the following options:
@@ -98,4 +100,4 @@ For these flash as per usual using the `.dfu` file. Afterwards power cycle and t
### Upload via blisp (PinecilV2)
For the PinecilV2 we suggest `blisp` as the command line tool to use if you are not using a GUI tool. `blsip` has been updated to accept `.dfu` files as well as the `.bin` files it historically used. As such you use the `.dfu` file for the logo and flash as per normal otherwise and it will work and reboot at the end. It should show you your new logo after flashing.
For the PinecilV2 we suggest `blisp` as the command line tool to use if you are not using a GUI tool. `blisp` has been updated to accept `.dfu` files as well as the `.bin` files it historically used. As such you use the `.dfu` file for the logo and flash as per normal otherwise and it will work and reboot at the end. It should show you your new logo after flashing.

View File

@@ -21,13 +21,15 @@
- [Temperature](../Documentation/Temperature.md)
- [Startup Logo](../Documentation/Logo.md)
- Hardware
- [Hall Sensor (Pinecil)](../Documentation/HallSensor.md)
- [Bluetooth (Pinecil V2)](../Documentation/Bluetooth.md)
- [Debugging USB-PD](../Documentation/DebuggingPD.md)
- [Hall Sensor (Pinecil)](../Documentation/HallSensor.md)
- [Hardware Notes](../Documentation/Hardware.md)
- [Troubleshooting](../Documentation/Troubleshooting.md)
- [Known Hardware Issues](../Documentation/HardwareIssues.md)
- [Power sources](../Documentation/PowerSources.md)
- [New Hardware Requirements](../Documentation/PortingToNewDevice.md)
- [Power sources](../Documentation/PowerSources.md)
- [Troubleshooting](../Documentation/Troubleshooting.md)
- [WS2812B RGB Modding (Pinecil V2)](../Documentation/WS2812BModding.md)
- [Translations](../Documentation/Translation.md)
- [Development](../Documentation/Development.md)
- [Changelog](../Documentation/History.md)

View File

@@ -43,7 +43,199 @@ When the device is powered by a battery, this adjusts the low voltage threshold
On device help text:
Set cutoff voltage to prevent battery over-drain. (DC 10V) (S=3.3V per cell, disable PWR limit)
Set cutoff voltage to prevent battery overdischarge (DC=10V) (S=3.3V per cell, disable PWR limit)
### Setting: Minimum voltage
When powered by a battery, this adjusts the minimum voltage per cell before shutdown. (This is multiplied by the cell count.)
On device help text:
Minimum allowed voltage per battery cell (3S: 3 - 3.7V | 4-6S: 2.4 - 3.7V)
### Setting: QC voltage
This adjusts the maximum voltage the QC negotiation will adjust to. Does NOT affect USB-PD. Should be set safely based on the current rating of your power supply.
On device help text:
Max QC voltage the iron should negotiate for
### Setting: PD timeout
How long until firmware stops trying to negotiate for USB-PD and tries QC instead. Longer times may help dodgy / old PD adapters, faster times move onto PD quickly. Units of 100ms. Recommended to keep small values.
On device help text:
PD negotiation timeout in 100ms steps for compatibility with some QC chargers
### Setting: PD Mode
Adjusts how the USB-PD Logic selects the voltage. No Dynamic disables EPR & PPS protocols, Safe mode does not use padding resistance (will select a slightly lower voltage).
On device help text:
No Dynamic disables EPR & PPS, Safe mode does not use padding resistance
### Setting: Boost temp
When the unit is in soldering mode. You can hold down the button at the front of the device to temporarily override the soldering temperature to this value. This SETS the temperature, it does not ADD to it.
On device help text:
Tip temperature used in "boost mode"
### Setting: Start-up behavior
When the device powers up, should it enter into a special mode. These settings set it to either start into soldering mode, sleeping mode or auto mode (Enters into soldering mode on the first movement).
On device help text:
S=heat to soldering temp | Z=standby at sleep temp until moved | R=standby without heating until moved
### Setting: Temp change short
Factor by which the temperature is changed with a quick press of the buttons.
On device help text:
Temperature-change-increment on short button press
### Setting: Temp change long
Factor by which the temperature is changed with a hold of the buttons.
On device help text:
Temperature-change-increment on long button press
### Setting: Allow locking buttons
If locking the buttons against accidental presses is enabled.
On device help text:
While soldering, hold down both buttons to toggle locking them (B=boost mode only | F=full locking)
### Setting: Profile Phases
set the number of phases for profile mode.
On device help text:
Number of phases in profile mode
### Setting: Preheat Temp
Preheat to this temperature at the start of profile mode.
On device help text:
Preheat to this temperature at the start of profile mode
### Setting: Preheat Speed
How fast the temperature is allowed to rise during the preheat phase at the start of profile mode.
On device help text:
Preheat at this rate (degrees per second)
### Setting: Phase 1 Temp
Target temperature for the end of phase 1 of profile mode.
On device help text:
Target temperature for the end of this phase
### Setting: Phase 1 Duration
Duration of phase 1 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature.
On device help text:
Target duration of this phase (seconds)
### Setting: Phase 2 Temp
Target temperature for the end of phase 2 of profile mode.
On device help text:
### Setting: Phase 2 Duration
Duration of phase 2 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature.
On device help text:
### Setting: Phase 3 Temp
Target temperature for the end of phase 3 of profile mode.
On device help text:
### Setting: Phase 3 Duration
Duration of phase 3 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature.
On device help text:
### Setting: Phase 4 Temp
Target temperature for the end of phase 5 of profile mode.
On device help text:
### Setting: Phase 4 Duration
Duration of phase 5 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature.
On device help text:
### Setting: Phase 5 Temp
Target temperature for the end of phase 5 of profile mode.
On device help text:
### Setting: Phase 5 Duration
Duration of phase 5 of profile mode. The phase might actually take longer if it takes longer to reach the target temperature.
On device help text:
### Setting: Cooldown Speed
How fast the temperature is allowed to drop during the cooldown phase at the end of profile mode.
On device help text:
Cooldown at this rate at the end of profile mode (degrees per second)
### Setting: Motion sensitivity
Scale of how sensitive the device is to movement. Higher numbers == more sensitive. 0 == motion detection turned off.
On device help text:
1=least sensitive | ... | 9=most sensitive
### Setting: Sleep temp
@@ -69,13 +261,21 @@ On device help text:
Interval before the iron shuts down (m=minutes)
### Setting: Motion sensitivity
### Setting: Hall sensor sensitivity
Scale of how sensitive the device is to movement. Higher numbers == more sensitive. 0 == motion detection turned off.
If the unit has a hall effect sensor (Pinecil), this adjusts how sensitive it is at detecting a magnet to put the device into sleep mode.
On device help text:
0=off | 1=least sensitive | ... | 9=most sensitive
Sensitivity to magnets (1=least sensitive | ... | 9=most sensitive)
### Setting: HallSensor SleepTime
If the unit has a hall effect sensor (Pinecil), this adjusts how long the device takes before it drops down to the sleep temperature when hall sensor is over threshold.
On device help text:
Interval before "sleep mode" starts when hall effect is above threshold
### Setting: Temperature unit
@@ -83,15 +283,7 @@ If the device shows temperatures in °C or °F.
On device help text:
C=Celsius | F=Fahrenheit
### Setting: Detailed idle screen
Should the device show an 'advanced' view on the idle screen. The advanced view uses text to show more details than the typical icons.
On device help text:
Display detailed info in a smaller font on idle screen
C=°Celsius | F=°Fahrenheit
### Setting: Display orientation
@@ -101,72 +293,13 @@ On device help text:
R=right-handed | L=left-handed | A=automatic
### Setting: Boost temp
When the unit is in soldering mode. You can hold down the button at the front of the device to temporarily override the soldering temperature to this value. This SETS the temperature, it does not ADD to it.
On device help text:
Tip temperature used in "boost mode"
### Setting: Start-up behavior
When the device powers up, should it enter into a special mode. These settings set it to either start into soldering mode, sleeping mode or auto mode (Enters into soldering mode on the first movement).
On device help text:
O=off | S=heat to soldering temp | Z=standby at sleep temp until moved | R=standby, heat-off until moved
### Setting: Cooldown flashing
If the idle screen should blink the tip temperature for attention while the tip is over 50°C. Intended as a 'tip is still hot' warning.
On device help text:
Flash temperature reading at idle if tip is hot
### Setting: Calibrate CJC at next boot
Note:
If the difference between the target temperature and the measured temperature is less than 5°C, **calibration is NOT required at all**.
This is used to calibrate the offset between ADC and Op-amp of the tip **at next boot** (Ideally it has to be done at boot, before internal components get warm.). If the checkbox is set, the calibration will only be performed at the next boot. After a successful calibration the checkbox will be unchecked again! If you need to repeat the calibration however, you have to set the checkbox *again*, unplug your device and let it cool down to room/ambient temperature & power it up, ideally while it sits on the desk.
Also, the calibration will only take place if both of the following conditions are met:
- The tip must be installed.
- The temperature difference between tip and handle must be less than 10°C. (~ ambient / room temperature)
Otherwise, the calibration will be performed the next time the device is started and both conditions are met, unless the corresponding checkbox is unchecked.
Hence, never repeat the calibration in quick succession!
On device help text:
Calibrate tip Cold Junction Compensation at the next boot (not required if Delta T is < 5°C)
### Setting: Restore default settings
Resets all settings and calibrations to factory defaults. Does NOT erase custom user boot up logo's.
On device help text:
Reset default settings for this firmware ver.
### Setting: Calibrate input voltage
Enters an adjustment mode where you can gradually adjust the measured voltage to compensate for any unit-to-unit variance in the voltage sense resistors.
On device help text:
Start VIN calibration (long press to exit)
### Setting: Detailed solder screen
Should the device show an 'advanced' soldering view. This is a text-based view that shows more information at the cost of no nice graphics.
On device help text:
Display detailed info in a smaller font on soldering screen
Flash temp reading at idle while tip is hot
### Setting: Scrolling speed
@@ -174,31 +307,7 @@ How fast the description text scrolls when hovering on a menu. Faster speeds may
On device help text:
Speed info text scrolls past at (S=slow | F=fast)
### Setting: QC voltage
This adjusts the maximum voltage the QC negotiation will adjust to. Does NOT affect USB-PD. Should be set safely based on the current rating of your power supply.
On device help text:
Max QC voltage the iron should negotiate for
### Setting: PD timeout
How long until firmware stops trying to negotiate for USB-PD and tries QC instead. Longer times may help dodgy / old PD adapters, faster times move onto PD quickly. Units of 100ms. Recommended to keep small values.
On device help text:
PD negotiation timeout in 100ms steps for compatibility with some QC chargers
### Setting: Power limit
Allows setting a custom wattage for the device to aim to keep the AVERAGE power below. The unit can't control its peak power no matter how you set this. (Except for MHP30 which will regulate nicely to this). If USB-PD is in use, the limit will be set to the lower of this and the supplies advertised wattage.
On device help text:
Maximum power the iron can use (W=watt)
Scrolling speed of info text (S=slow | F=fast)
### Setting: Swap + - keys
@@ -208,53 +317,21 @@ On device help text:
Reverse assignment of buttons for temperature adjustment
### Setting: Temp change short
### Setting: Swap A B keys
Factor by which the temperature is changed with a quick press of the buttons.
Swaps which button is used as Enter/Change and as Scroll/Back in Settings menu.
On device help text:
Temperature-change-increment on short button press
Reverse assignment of buttons for Settings menu
### Setting: Temp change long
### Setting: Anim. speed
Factor by which the temperature is changed with a hold of the buttons.
How fast should the menu animations loop, or if they should not loop at all.
On device help text:
Temperature-change-increment on long button press
### Setting: Power pulse
Enables and sets the wattage of the power pulse. Power pulse causes the device to briefly turn on the heater to draw power to avoid power banks going to sleep.
On device help text:
Intensity of power of keep-awake-pulse (watt)
### Setting: Hall sensor sensitivity
If the unit has a hall effect sensor (Pinecil), this adjusts how sensitive it is at detecting a magnet to put the device into sleep mode.
On device help text:
Sensitivity to magnets (0=off | 1=least sensitive | ... | 9=most sensitive)
### Setting: Allow locking buttons
If locking the buttons against accidental presses is enabled.
On device help text:
While soldering, hold down both buttons to toggle locking them (D=disable | B=boost mode only | F=full locking)
### Setting: Minimum voltage
When powered by a battery, this adjusts the minimum voltage per cell before shutdown. (This is multiplied by the cell count.)
On device help text:
Minimum allowed voltage per battery cell (3S: 3 - 3.7V | 4-6S: 2.4 - 3.7V)
Pace of icon animations in menu (S=slow | M=medium | F=fast)
### Setting: Anim. loop
@@ -264,38 +341,6 @@ On device help text:
Loop icon animations in main menu
### Setting: Anim. speed
How fast should the menu animations loop, or if they should not loop at all.
On device help text:
Pace of icon animations in menu (O=off | S=slow | M=medium | F=fast)
### Setting: Power pulse delay
Adjusts the time interval between power pulses. Longer gaps reduce undesired heating of the tip, but needs to be fast enough to keep your power bank awake.
On device help text:
Delay before keep-awake-pulse is triggered (x 2.5s)
### Setting: Power pulse duration
How long should the power pulse go for. Some power banks require seeing the power draw be sustained for a certain duration to keep awake. Should be kept as short as possible to avoid wasting power / undesired heating of the tip.
On device help text:
Keep-awake-pulse duration (x 250ms)
### Setting: Language: EN English
Changes the device language on multi-lingual builds.
On device help text:
Current firmware language
### Setting: Screen brightness
Display brightness. Higher values age the OLED faster due to burn-in. (However, it is notable that most of these screens die from other causes first.)
@@ -318,4 +363,111 @@ Sets the duration for the boot logo (s=seconds).
On device help text:
Set Boot logo duration (off | s=seconds | infinity)
Set boot logo duration (s=seconds)
### Setting: Detailed idle screen
Should the device show an 'advanced' view on the idle screen. The advanced view uses text to show more details than the typical icons.
On device help text:
Display detailed info in a smaller font on idle screen
### Setting: Detailed solder screen
Should the device show an 'advanced' soldering view. This is a text-based view that shows more information at the cost of no nice graphics.
On device help text:
Display detailed info in a smaller font on soldering screen
### Setting: Bluetooth
Should BLE be enabled at boot time.
On device help text:
Enables BLE
### Setting: Power limit
Allows setting a custom wattage for the device to aim to keep the AVERAGE power below. The unit can't control its peak power no matter how you set this. (Except for MHP30 which will regulate nicely to this). If USB-PD is in use, the limit will be set to the lower of this and the supplies advertised wattage.
On device help text:
Average maximum power the iron can use (W=watt)
### Setting: Calibrate CJC at next boot
Note:
If the difference between the target temperature and the measured temperature is less than 5°C, **calibration is NOT required at all**.
This is used to calibrate the offset between ADC and Op-amp of the tip **at next boot** (Ideally it has to be done at boot, before internal components get warm.). If the checkbox is set, the calibration will only be performed at the next boot. After a successful calibration the checkbox will be unchecked again! If you need to repeat the calibration however, you have to set the checkbox *again*, unplug your device and let it cool down to room/ambient temperature & power it up, ideally while it sits on the desk.
Also, the calibration will only take place if both of the following conditions are met:
- The tip must be installed.
- The temperature difference between tip and handle must be less than 10°C. (~ ambient / room temperature)
Otherwise, the calibration will be performed the next time the device is started and both conditions are met, unless the corresponding checkbox is unchecked.
Hence, never repeat the calibration in quick succession!
On device help text:
Calibrate Cold Junction Compensation at next boot (not required if Delta T is < 5°C)
### Setting: Calibrate input voltage
Enters an adjustment mode where you can gradually adjust the measured voltage to compensate for any unit-to-unit variance in the voltage sense resistors.
On device help text:
Start VIN calibration (long press to exit)
### Setting: Power pulse
Enables and sets the wattage of the power pulse. Power pulse causes the device to briefly turn on the heater to draw power to avoid power banks going to sleep.
On device help text:
Intensity of power of keep-awake-pulse (W=watt)
### Setting: Power pulse delay
Adjusts the time interval between power pulses. Longer gaps reduce undesired heating of the tip, but needs to be fast enough to keep your power bank awake.
On device help text:
Delay before keep-awake-pulse is triggered (x 2.5s)
### Setting: Power pulse duration
How long should the power pulse go for. Some power banks require seeing the power draw be sustained for a certain duration to keep awake. Should be kept as short as possible to avoid wasting power / undesired heating of the tip.
On device help text:
Keep-awake-pulse duration (x 250ms)
### Setting: Restore default settings
Resets all settings and calibrations to factory defaults. Does NOT erase custom user boot up logo's.
On device help text:
Reset all settings to default
### Setting: Language: EN English
Changes the device language on multi-lingual builds.
On device help text:
### Setting: Soldering Tip Type
For manually selecting the type of tip fitted
On device help text:
Select the tip type fitted

View File

@@ -0,0 +1,33 @@
# WS2812B RGB Modding (Pinecil V2)
## What is it?
The idea of this mod is to bring the RGB feature of the MHP30 to the Pinecil V2.
Use a transparent shell for a better effect.
Pinecil V2 has a free GPIO_12 accessible through TP10, which is along the screen, cf [Pinecil PCB placement v2.0](https://files.pine64.org/doc/Pinecil/Pinecil_PCB_placement_v2.0_20220608.pdf) page 3. (TP9 (GPIO_14) is also available but hidden below the screen. If you want to use it, change `WS2812B_Pin` in `source/Core/BSP/Pinecilv2/Pins.h`.)
We'll using it to drive a WS2812B and let the color logic already present for the MHP30 do its magic:
- green when temperature is safe (< 55°C)
- pulsing red when heating
- solid red when desired temperature is reached
- orange when cooling down
## Electrical considerations
WS2812B requires a Vdd between 3.5 and 5.3V and Vih (high level of input signal) must be at least 0.7*Vdd.
Pinecil V2 GPIO levels are 3.3V and the 5V rail is actually max 4.6V.
So we can directly power the WS2812B on the 5V rail and command it with the GPIO without need for a level shifter, or for a Zener diode to clamp Vdd.
## How to wire it?
- WS2812B pin 1 (Vdd) is connected to the "5V" rail, e.g. on the C8 capacitor as illustrated [here](https://github.com/Ralim/IronOS/issues/1410#issuecomment-1296064392).
- WS2812B pin 3 (Vss) is connected to the Pinecil GND, e.g. on the U10 pad at the back of the PCB, below R35, as illustrated [here](https://github.com/Ralim/IronOS/issues/1410#issuecomment-1296064392).
- WS2812B pin 4 (Din) is connected to TP10.
You can use e.g. 0.1-mm enameled wire and isolate connections with UV glue to avoid any shortcut.
## How to enable it in the code?
`make firmware-EN model=Pinecilv2 ws2812b_enable=1`

View File

@@ -15,7 +15,7 @@ _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 V1 | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ✔️ | |
| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | ✔️ | ✔️ |
| TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ✔️ | ❌ |

View File

@@ -164,7 +164,7 @@ test-py:
@echo "---- Checking python code... ----"
@echo ""
flake8 Translations
black --check Translations
black --diff --check Translations
@$(MAKE) -C source/ Objects/host/brieflz/libbrieflz.so
./Translations/brieflz_test.py
./Translations/make_translation_test.py

View File

@@ -28,7 +28,7 @@ _This firmware does **NOT** support the USB port while running for changing sett
| Miniware MHP30 | ❌ | ❌ | ✔️ | ❌ | ❌ | ✔️ | ✔️ | |
| Pinecil V1 | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ \* | |
| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. |
| Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ \*\*\*\*\* | Full OLED resolution not yet supported. |
| Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. |
| Sequre S60P | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. |
| Sequre T55 | ❌ | ❌ | ✔️ | ❌ | ❌ | N/A | ✔️ | Full OLED resolution not yet supported. |
@@ -51,6 +51,8 @@ The _TS101_ & _S60(P)_ irons and _MHP30_ & _T55_ plates feature a higher resolut
\*\*\*\* **EPR/PPS with 28V support** is _**disabled by default**_ due to [safety concerns](https://github.com/Ralim/IronOS/pull/2073), but to turn it back on set
_PD Mode_ option in _Power settings_ submenu to _Safe_ or _Default_.
\*\*\*\*\* Some users confirm that there is a version of newer _TS101_ revision with another OLED screen model, which is not supported yet at all by _IronOS_ unfortunately. See [this bug report](https://github.com/Ralim/IronOS/issues/2063) for more information.
## Getting Started
To get started with _IronOS firmware_, please jump to [Getting Started Guide](https://ralim.github.io/IronOS/GettingStarted/).

View File

@@ -51,7 +51,7 @@ In the menu there are a few main categories that are used to keep the list manag
for menu in defs.get("menuGroups", {}):
menu_id = menu.get("id", "")
entry = translation_data.get("menuGroups", {}).get(menu_id, "")
name = " ".join(entry.get("text2", []))
name = " ".join(entry.get("displayText").split("\n"))
desc = menu.get("description", "")
section = f"""
### Category: {name}
@@ -80,9 +80,9 @@ This is the "on device help text".
for menu in defs.get("menuOptions", {}):
menu_id = menu.get("id", "")
entry = translation_data.get("menuOptions", {}).get(menu_id, "")
name = " ".join(entry.get("text2", []))
name = " ".join(entry.get("displayText").split("\n"))
desc = menu.get("description", "")
on_device_desc = entry.get("desc", "")
on_device_desc = entry.get("description", "")
section = f"""
### Setting: {name}
@@ -99,8 +99,8 @@ def main() -> None:
json_dir = HERE
print(json_dir)
logging.info("Loading translation definitions")
defs = load_json(TRANSLATION_DEFS_PATH)
eng_translation = load_json(ENGLISH_TRANSLATION_PATH)
defs = load_json(TRANSLATION_DEFS_PATH, False)
eng_translation = load_json(ENGLISH_TRANSLATION_PATH, False)
with open(MENU_DOCS_FILE_PATH, "w") as outputf:
write_header(outputf)
write_menu_categories(outputf, defs, eng_translation)

View File

@@ -10,7 +10,7 @@ import pickle
import re
import subprocess
import sys
from datetime import datetime
import time
from pathlib import Path
from typing import Dict, List, Optional, TextIO, Tuple, Union
from dataclasses import dataclass
@@ -152,7 +152,10 @@ def get_constants() -> List[Tuple[str, str]]:
def get_debug_menu() -> List[str]:
return [
datetime.today().strftime("%Y%m%d %H%M%S"),
time.strftime(
"%Y%m%d %H%M%S",
time.gmtime(int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))),
),
"ID ",
"ACC ",
"PWR ",
@@ -629,7 +632,7 @@ def make_font_table_named_cpp(
if name:
output_table = f"const uint8_t {name}[] = {{\n"
for i, sym in enumerate(sym_list):
output_table += f"{bytes_to_c_hex(font_map[sym])}//0x{i+2:X} -> {sym}\n"
output_table += f"{bytes_to_c_hex(font_map[sym])}//0x{i + 2:X} -> {sym}\n"
if name:
output_table += f"}}; // {name}\n"
return output_table
@@ -643,7 +646,7 @@ def make_font_table_06_cpp(sym_list: List[str], font_map: FontMapsPerFont) -> st
font_line = bytes_to_c_hex(font_bytes)
else:
font_line = "// " # placeholder
output_table += f"{font_line}//0x{i+2:X} -> {sym}\n"
output_table += f"{font_line}//0x{i + 2:X} -> {sym}\n"
output_table += "};\n"
return output_table
@@ -995,7 +998,7 @@ def write_languages(
f.write("};\n")
f.write(
"const uint8_t LanguageCount = sizeof(LanguageMetas) / sizeof(LanguageMetas[0]);\n\n"
f"alignas(TranslationData) uint8_t translation_data_out_buffer[{max_decompressed_translation_size }];\n"
f"alignas(TranslationData) uint8_t translation_data_out_buffer[{max_decompressed_translation_size}];\n"
"const uint16_t translation_data_out_buffer_size = sizeof(translation_data_out_buffer);\n\n"
)

View File

@@ -275,6 +275,10 @@
"displayText": "Інвертаваць\nкнопкі",
"description": "Інвертаваць кнопкі вымярэння тэмпературы"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Хуткасць\nанімацыі",
"description": "Хуткасць анімацыі гузікаў у галоўным меню (Мілісекунды) (Н=Нізкая | С=Сярэдняя | В=Высокая)"

View File

@@ -275,6 +275,10 @@
"displayText": "Размяна\nбутони +/-",
"description": "Обръщане на бутоните + и - за промяна на температурата на човка на поялника"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Скорост на\nанимацията",
"description": "Скорост на анимация на иконата в главното меню (Н=Ниска | C=Средна | B=Висока)"

View File

@@ -275,6 +275,10 @@
"displayText": "Prohodit\ntl. +-?",
"description": "Prohodit tlačítka pro změnu teploty"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nrychlost",
"description": "Tempo animace ikon v menu (P=pomalu | S=středně | R=rychle)"

View File

@@ -275,6 +275,10 @@
"displayText": "Skift\n+ - tasterne",
"description": "Skift tildeling af knapper til temperaturjustering"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nHastighed",
"description": "Hastigheden for ikonanimationer i menuen (S=langsomt | M=medium | F=hurtigt)"

View File

@@ -275,6 +275,10 @@
"displayText": "+- Tasten\numkehren",
"description": "Tastenbelegung zur Temperaturänderung umkehren"
},
"ReverseButtonSettings": {
"displayText": "A B Tasten\nvertauschen",
"description": "Umgekehrte Belegung der Tasten für das Einstellungsmenü"
},
"AnimSpeed": {
"displayText": "Anim.\nGeschw.",
"description": "Geschwindigkeit der Icon-Animationen im Menü (L=langsam | M=mittel | S=schnell)"

View File

@@ -275,6 +275,10 @@
"displayText": "Αντιστροφή\nπλήκτρων + -",
"description": "Αντιστροφή διάταξης πλήκτρων στη ρύθμιση θερμοκρασίας"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Ταχύτητα\nκιν. εικονιδ.",
"description": "Ρυθμός κίνησης εικονιδίων στο μενού (Α=αργός | Μ=μέτριος | Γ=γρήγορος)"

View File

@@ -275,6 +275,10 @@
"displayText": "Swap\n+ - keys",
"description": "Reverse assignment of buttons for temperature adjustment"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nspeed",
"description": "Pace of icon animations in menu (S=slow | M=medium | F=fast)"

View File

@@ -31,7 +31,7 @@
"message": "Térmico\nFuera de control"
},
"WarningTipShorted": {
"message": "¡Punta en Corto!"
"message": "¡Punta en cortocircuito!"
},
"SettingsCalibrationWarning": {
"message": "¡Antes de reiniciar, asegúrese de que la punta y el mango estén a temperatura ambiente!"
@@ -145,11 +145,11 @@
},
"QCMaxVoltage": {
"displayText": "Potencia de\nentrada",
"description": "Potencia en Watts del adaptador de corriente utilizado"
"description": "Potencia en vatios del adaptador de corriente utilizado"
},
"PDNegTimeout": {
"displayText": "PD\ntiempo de espera",
"description": "Timeout de negociación de PD en pasos de 100ms para compatibilidad con algunos cargadores QC (0: apagado)"
"description": "Tiempo de espera de negociación de PD en pasos de 100ms para compatibilidad con algunos cargadores QC (0: apagado)"
},
"USBPDMode": {
"displayText": "PD\nMode",
@@ -253,7 +253,7 @@
},
"HallEffSleepTimeout": {
"displayText": "Tiempo reposo\nSensor Hall",
"description": "Intervalo antes de que \"sleep mode\" empiece cuando sensorhall supera límite"
"description": "Intervalo antes de que \"modo resposo\" empiece cuando sensorhall supera límite"
},
"TemperatureUnit": {
"displayText": "Unidad de\ntemperatura",
@@ -275,6 +275,10 @@
"displayText": "Invertir\nbotones +/-",
"description": "Invertir botones de ajuste de temperatura"
},
"ReverseButtonSettings": {
"displayText": "Cambiar\nteclas A B",
"description": "Asignación inversa de botonos para el menú de configuración"
},
"AnimSpeed": {
"displayText": "Anim.\nvelocidad",
"description": "Velocidad de animaciones de iconos en el menú (L=baja | M=media | R=alta)"
@@ -309,11 +313,11 @@
},
"PowerLimit": {
"displayText": "Potencia\nlímite",
"description": "Elige el límite de potencia máxima del soldador (en Watts)"
"description": "Elige el límite de potencia máxima del soldador (en vatios)"
},
"CalibrateCJC": {
"displayText": "Calibrar CJC\nen el próximo inicio",
"description": "Al siguinte inicio el Cold Junction Compensation sera calibrado (no requerido si el Delta T es < 5°C)"
"description": "Al siguinte inicio la compensación de referencia será calibrada (no requerido si el Delta T es < 5°C)"
},
"VoltageCalibration": {
"displayText": "Calibrar voltaje\nde entrada",
@@ -321,7 +325,7 @@
},
"PowerPulsePower": {
"displayText": "Pulsos bat.\nconstantes",
"description": "Intensidad de la potencia del pulso para mantener encendido (W=Watt)"
"description": "Intensidad de la potencia del pulso para mantener encendido (W=Vatio)"
},
"PowerPulseWait": {
"displayText": "Tiempor entre\n pulso de energia",
@@ -340,8 +344,8 @@
"description": ""
},
"SolderingTipType": {
"displayText": "Soldering\nTip Type",
"description": "Select the tip type fitted"
"displayText": "Tipo de\nTpunta",
"description": "Selecciona la punta montada"
}
}
}

View File

@@ -275,6 +275,10 @@
"displayText": "Vaheta\n+ - nupud",
"description": "Temperatuurinuppude asukohtade vahetus"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nkiirus",
"description": "Menüüikoonide animatsiooni kiirus (A=aeglane | K=keskmine | T=tempokas)"

View File

@@ -275,6 +275,10 @@
"displayText": "Suunnanvaihto\n+ - näppäimille",
"description": "Lämpötilapainikkeiden suunnan vaihtaminen"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Animaation\nnopeus",
"description": "Animaatioiden nopeus valikossa (A=alhainen | K=keskiverto | S=suuri)"

View File

@@ -275,6 +275,10 @@
"displayText": "Inverser les\ntouches + -",
"description": "Inverser les boutons d'ajustement de température"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Vitesse\nanim. icônes",
"description": "Vitesse des animations des icônes dans le menu (L=lente | M=moyenne | R=rapide)"

View File

@@ -275,6 +275,10 @@
"displayText": "Zamjena\n+ - tipki",
"description": "Zamjenjuje funkciju gornje i donje tipke za podešavanje temperature"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Brzina\nanimacije",
"description": "Brzina animacije ikona u menijima (S=sporo | M=srednje | B=brzo)"

View File

@@ -275,6 +275,10 @@
"displayText": "+/- gomb\nmegfordítása",
"description": "Forrasztó hegy hőmérsékletállító gombok felcserélése"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Animáció\nsebessége",
"description": "Menüikonok animációjának sebessége (L=lassú | K=közepes | Gy=gyors)"

View File

@@ -275,6 +275,10 @@
"displayText": "Inversione\ntasti",
"description": "Inverti i tasti per aumentare o diminuire la temperatura della punta"
},
"ReverseButtonSettings": {
"displayText": "Inversione\ntasti A/B",
"description": "Inverti il funzionamento dei tasti del saldatore all'interno del menù principale"
},
"AnimSpeed": {
"displayText": "Velocità\nanimazioni",
"description": "Imposta la velocità di riproduzione delle animazioni del menù principale [L: lenta; M: media; V: veloce]"
@@ -321,15 +325,15 @@
},
"PowerPulsePower": {
"displayText": "Potenza\nimpulso",
"description": "Regola la potenza di un \"impulso sveglia\" atto a prevenire lo standby eventuale dell'alimentatore [watt]"
"description": "Regola la potenza di un segnale di attività per prevenire lo standby eventuale dell'alimentatore [watt]"
},
"PowerPulseWait": {
"displayText": "Distanza\nimpulsi",
"description": "Imposta il tempo che deve intercorrere tra due \"impulsi sveglia\" [multipli di 2,5 s]"
"description": "Imposta il tempo che deve intercorrere tra un segnale di attività e il successivo [multipli di 2,5 s]"
},
"PowerPulseDuration": {
"displayText": "Durata\nimpulso",
"description": "Regola la durata dell'«impulso sveglia» [multipli di 250 ms]"
"description": "Regola la durata del segnale di attività [multipli di 250 ms]"
},
"SettingsReset": {
"displayText": "Ripristino\nimpostazioni",

View File

@@ -275,6 +275,10 @@
"displayText": "キー入れ替え",
"description": "温度設定時に+ボタンと-ボタンを入れ替える"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "動画の速度",
"description": "メニューアイコンのアニメーションの速さ <遅=低速 | 中=中速 | 速=高速>"

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": false,
"messagesWarn": {
"CalibrationDone": {
"message": "Calibration\ndone!"
"message": "Kalibravimas\natliktas!"
},
"ResetOKMessage": {
"message": "Atstatyta"
@@ -37,7 +37,7 @@
"message": "Before rebooting, make sure tip & handle are at room temperature!"
},
"CJCCalibrating": {
"message": "calibrating\n"
"message": "Kalibruojama\n"
},
"SettingsResetWarning": {
"message": "Ar norite atstatyti nustatymus į numatytas reikšmes?"
@@ -275,6 +275,10 @@
"displayText": "Sukeisti + -\nmygtukus?",
"description": "Sukeisti + - temperatūros keitimo mygtukus vietomis"
},
"ReverseButtonSettings": {
"displayText": "Sukeisti A B\nmygtukus?",
"description": "Sukeisti nustatymų meniu mygtukus vietomis"
},
"AnimSpeed": {
"displayText": "Animacijų\ngreitis",
"description": "Paveiksliukų animacijų greitis meniu punktuose (L=Lėtas | V=Vidutinis | G=Greitas)"
@@ -292,8 +296,8 @@
"description": "Invertuoja OLED ekrano spalvas"
},
"LOGOTime": {
"displayText": "Boot logo\nduration",
"description": "Set boot logo duration (s=seconds)"
"displayText": "Įkrovos logotipo\ntrukmė",
"description": "Nustatykite įkrovos logotipo trukmę (s=sekundės)"
},
"AdvancedIdle": {
"displayText": "Detalus lau-\nkimo ekranas",

View File

@@ -275,6 +275,10 @@
"displayText": "Bytt\n+ - kn.",
"description": "Bytt om på knappene for å stille temperatur"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nhastighet",
"description": "Hastigheten til animasjonene i menyen (S=slow | M=medium | F=fast)"

View File

@@ -275,6 +275,10 @@
"displayText": "Wissel\n+ - knoppen",
"description": "Wissel de knoppen voor temperatuur controle om"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nsnelheid",
"description": "Snelheid van de icoon animaties in het menu (Langzaam | Middel | Snel)"

View File

@@ -275,6 +275,10 @@
"displayText": "Wissel\n+ - knoppen",
"description": "Wissel de knoppen voor temperatuur controle"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nsnelheid",
"description": "Snelheid van de icoon animaties in het menu (T=sloom | M=middel | S=snel)"

View File

@@ -275,6 +275,10 @@
"displayText": "Zamień przyc.\n+ -",
"description": "Zamienia działanie przycisków zmiany temperatury grotu"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Prędkosć\nanimacji",
"description": "Prędkość animacji ikon w menu (W: mała | M: średnia | S: duża)"

View File

@@ -275,6 +275,10 @@
"displayText": "Trocar\nbotões + -",
"description": "Inverte o funcionamento dos botões de ajuste da temperatura"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Velocidade\nde animação",
"description": "Velocidade das animações no menu (S=lenta | M=média | F=rápida)"

View File

@@ -275,6 +275,10 @@
"displayText": "Inversare\n+ - butoane",
"description": "Inversarea butoanelor de reglare a temperaturii"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Animaţii\nviteză",
"description": "Ritmul animaţiilor pictogramei din meniu (Î=încet | M=mediu | R=rapid)"

View File

@@ -275,6 +275,10 @@
"displayText": "Поменять\nкнопки +/-",
"description": "Поменять кнопки изменения температуры"
},
"ReverseButtonSettings": {
"displayText": "Поменять\nкнопки A/B",
"description": "Поменять назначение кнопок A/B в меню настроек"
},
"AnimSpeed": {
"displayText": "Скорость\nанимации",
"description": "Скорость анимации иконок в главном меню (М=Медленная| С=Средняя | Б=Быстрая)"

View File

@@ -275,6 +275,10 @@
"displayText": "Otočenie\ntlačidiel +/-",
"description": "Prehodenie tlačidiel na nastavovanie teploty"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Rýchlosť\nanimácií",
"description": "Rýchlosť animácií ikoniek v menu (P=pomaly | S=stredne | R=rýchlo)"

View File

@@ -275,6 +275,10 @@
"displayText": "Obrni\ntipki + -?",
"description": "Zamenjaj funkciji gumbov."
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nspeed",
"description": "Pace of icon animations in menu (P=slow | M=medium | H=fast)"

View File

@@ -275,6 +275,10 @@
"displayText": "Swap\n+ - keys",
"description": "Reverse assignment of buttons for temperature adjustment"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nspeed",
"description": "Pace of icon animations in menu (С=slow | M=medium | Б=fast)"

View File

@@ -275,6 +275,10 @@
"displayText": "Swap\n+ - keys",
"description": "Reverse assignment of buttons for temperature adjustment"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\nspeed",
"description": "Pace of icon animations in menu (S=slow | M=medium | B=fast)"

View File

@@ -275,6 +275,10 @@
"displayText": "Omvända\n+- knappar",
"description": "Omvänd ordning för temperaturjustering via plus/minus knapparna"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.-\nhastighet",
"description": "Animationshastighet för ikoner i menyer (L=långsam | M=medel | S=snabb)"

View File

@@ -275,6 +275,10 @@
"displayText": "Düğme Yerleri\nRotasyonu",
"description": "\"Düğme Yerleri Rotasyonu\" Sıcaklık ayar düğmelerinin yerini değiştirin"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Animasyon\nHızı",
"description": "Menüdeki simge animasyonlarının hızı (Y=Yavaş | O=Orta | H=Hızlı)"

View File

@@ -275,6 +275,10 @@
"displayText": "Інвертувати\nкнопки +-?",
"description": "Інвертувати кнопки зміни температури."
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Швидкість\nанімації",
"description": "Швидкість анімації іконок у меню (Н=Низькa | С=Середня | М=Максимальна)"

View File

@@ -275,6 +275,10 @@
"displayText": "(+) va (-) tugmalarni\nalmashtirish",
"description": "Harorat o'zgarishi uchun tugmachalarni vazifasini almashish"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Anim.\ntezligi",
"description": "Menyudagi ikonka animatsiyalari tezligini sozlash (S=sekin | O=o'rtacha | T=tez)"

View File

@@ -275,6 +275,10 @@
"displayText": "Đao nguoc\nnút + -",
"description": "Đao nguoc chuc năng các nút đieu chinh nhiet đo"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "Toc đo\nhoat anh",
"description": "Toc đo cua hoat anh menu (S=cham | M=trung bình | F=nhanh)"

View File

@@ -275,6 +275,10 @@
"displayText": "反轉加減掣",
"description": "反轉調校温度時加減掣嘅方向"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "動畫速度",
"description": "功能表圖示動畫嘅速度 <慢=慢速 | 中=中速 | 快=快速>"

View File

@@ -275,6 +275,10 @@
"displayText": "调换加减键",
"description": "调校温度时更换加减键的方向"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "动画速度",
"description": "主菜单中功能图标动画的播放速度 <慢=慢速 | 中=中速 | 快=快速>"

View File

@@ -275,6 +275,10 @@
"displayText": "調換加減鍵",
"description": "調校溫度時調換加減鍵的方向"
},
"ReverseButtonSettings": {
"displayText": "Swap\nA B keys",
"description": "Reverse assignment of buttons for Settings menu"
},
"AnimSpeed": {
"displayText": "動畫速度",
"description": "功能表圖示動畫的速度 <慢=慢速 | 中=中速 | 快=快速>"

View File

@@ -172,7 +172,7 @@
"id": "PowerMenu",
"maxLen": 5,
"maxLen2": 11,
"include": ["POW_DC", "POW_QC"],
"include": ["POW_DC", "POW_PD", "POW_QC"],
"description": "Menu for settings related to power. Main settings to do with the input voltage."
},
{
@@ -272,7 +272,7 @@
"maxLen": 7,
"maxLen2": 15,
"include": ["POW_PD"],
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
"description": "Adjusts how the USB-PD Logic selects the voltage. No Dynamic disables EPR & PPS protocols, Safe mode does not use padding resistance (will select a slightly lower voltage)."
},
{
"id": "BoostTemperature",
@@ -473,6 +473,12 @@
"maxLen2": 15,
"description": "Swaps which button increments and decrements on temperature change screens."
},
{
"id": "ReverseButtonSettings",
"maxLen": 6,
"maxLen2": 15,
"description": "Swaps which button is used as Enter/Change and as Scroll/Back in Settings menu."
},
{
"id": "AnimSpeed",
"maxLen": 6,
@@ -532,7 +538,7 @@
"id": "CalibrateCJC",
"maxLen": 8,
"maxLen2": 15,
"description": "Used to calibrate the ADC+Op-amp offsets for the tip. This calibration must be performed when the tip temperature and the handle temperature are equal. Generally not required unless your device is reading more than 5°C off target."
"description": "Note:\r\nIf the difference between the target temperature and the measured temperature is less than 5°C, **calibration is NOT required at all**.\r\n\r\nThis is used to calibrate the offset between ADC and Op-amp of the tip **at next boot** (Ideally it has to be done at boot, before internal components get warm.). If the checkbox is set, the calibration will only be performed at the next boot. After a successful calibration the checkbox will be unchecked again! If you need to repeat the calibration however, you have to set the checkbox *again*, unplug your device and let it cool down to room/ambient temperature & power it up, ideally while it sits on the desk.\r\n\r\n\r\nAlso, the calibration will only take place if both of the following conditions are met:\r\n- The tip must be installed.\r\n- The temperature difference between tip and handle must be less than 10°C. (~ ambient / room temperature)\r\n\r\nOtherwise, the calibration will be performed the next time the device is started and both conditions are met, unless the corresponding checkbox is unchecked.\r\nHence, never repeat the calibration in quick succession!"
},
{
"id": "VoltageCalibration",

View File

@@ -35,13 +35,15 @@ nav:
- Temperature: Temperature.md
- Startup Logo: Logo.md
- Hardware:
- Hall Sensor (Pinecil): HallSensor.md
- Bluetooth (Pinecil V2): Bluetooth.md
- Debugging USB-PD: DebuggingPD.md
- Hall Sensor (Pinecil): HallSensor.md
- Hardware Notes: Hardware.md
- Troubleshooting: Troubleshooting.md
- Known Hardware Issues: HardwareIssues.md
- Power sources: PowerSources.md
- New Hardware Requirements: PortingToNewDevice.md
- Power sources: PowerSources.md
- Troubleshooting: Troubleshooting.md
- WS2812B RGB Modding (Pinecil V2): WS2812BModding.md
- Translations: Translation.md
- Development: Development.md
- Changelog: History.md

View File

@@ -1,19 +1,21 @@
#!/bin/bash
# TS100 Flasher for Linux by Alex Wigen (https://github.com/awigen)
# Jan 2021 - Update by Ysard (https://github.com/ysard)
# Jul 2025 - Update by Karakurt
DIR_TMP="/tmp/ts100"
DIR_TMP="/tmp/ironos"
HEX_FIRMWARE="$DIR_TMP/ts100.hex"
MAX_TRIES=5
usage() {
echo
echo "#################"
echo "# TS100 Flasher #"
echo "#################"
echo "#######################"
echo "# TS100/TS101 Flasher #"
echo "#######################"
echo
echo " Usage: $0 <HEXFILE>"
echo
echo "This script has been tested to work on Fedora."
echo "This script has been tested to work on Fedora and Arch Linux."
echo "If you experience any issues please open a ticket at:"
echo "https://github.com/Ralim/IronOS/issues/new"
echo
@@ -44,12 +46,12 @@ is_attached() {
}
instructions="not printed"
wait_for_ts100() {
wait_for_iron() {
while ! is_attached; do
if [ "$instructions" = "not printed" ]; then
echo
echo "#####################################################"
echo "# Waiting for TS100 config disk device to appear #"
echo "# Waiting for config disk device to appear #"
echo "# #"
echo "# Connect the soldering iron with a USB cable while #"
echo "# holding the button closest to the tip pressed #"
@@ -61,7 +63,7 @@ wait_for_ts100() {
done
}
mount_ts100() {
mount_iron() {
mkdir -p "$DIR_TMP"
user="${UID:-$(id -u)}"
if ! sudo mount -t msdos -o uid=$user "$DEVICE" "$DIR_TMP"; then
@@ -70,11 +72,12 @@ mount_ts100() {
fi
}
umount_ts100() {
umount_iron() {
if ! (mountpoint "$DIR_TMP" > /dev/null && sudo umount "$DIR_TMP"); then
echo "Failed to unmount $DIR_TMP"
exit 1
fi
sleep 1
sudo rmdir "$DIR_TMP"
}
@@ -84,19 +87,22 @@ check_flash() {
if [ -f "$RDY_FIRMWARE" ]; then
echo -e "\e[92mFlash is done\e[0m"
echo "Disconnect the USB and power up the iron. You're good to go."
return 0
elif [ -f "$ERR_FIRMWARE" ]; then
echo -e "\e[91mFlash error; Please retry!\e[0m"
return 1
else
echo -e "\e[91mUNKNOWN error\e[0m"
echo "Flash result: "
ls "$DIR_TMP"/ts100*
return 1
fi
}
cleanup() {
enable_gautomount
if [ -d "$DIR_TMP" ]; then
umount_ts100
umount_iron
fi
}
trap cleanup EXIT
@@ -121,19 +127,28 @@ fi
disable_gautomount
wait_for_ts100
echo "Found TS100 config disk device on $DEVICE"
TRIES=0
while [ $TRIES -lt $MAX_TRIES ]; do
wait_for_iron
NAME=$(sudo fatlabel "$DEVICE" 2>/dev/null)
echo "Found $NAME config disk device on $DEVICE"
mount_ts100
echo "Mounted config disk drive, flashing..."
dd if="$1" of="$HEX_FIRMWARE" oflag=direct
umount_ts100
mount_iron
echo "Mounted config disk drive, flashing..."
dd if="$1" of="$HEX_FIRMWARE" oflag=direct
umount_iron
echo "Waiting for TS100 to flash"
sleep 5
echo "Waiting for $NAME to flash"
sleep 5
echo "Remounting config disk drive"
wait_for_ts100
mount_ts100
check_flash
echo "Remounting config disk drive"
wait_for_iron
mount_iron
check_flash && exit 0
echo "Retrying automatically..."
TRIES=$((TRIES + 1))
done
echo -e "\e[91mMax retries reached.\e[0m"
exit 1

View File

@@ -101,7 +101,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ (SystemCoreClock)
#define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES (6)
#define configMAX_PRIORITIES (7)
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
#define configMAX_TASK_NAME_LEN (32)

View File

@@ -182,7 +182,7 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) {
tmp = hdma->Instance->CCR;
/* Clear PL, MSIZE, PSIZE, MINC, PINC, CIRC and DIR bits */
tmp &= ((uint32_t) ~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | DMA_CCR_DIR));
tmp &= ((uint32_t)~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | DMA_CCR_DIR));
/* Prepare the DMA Channel configuration */
tmp |= hdma->Init.Direction | hdma->Init.PeriphInc | hdma->Init.MemInc | hdma->Init.PeriphDataAlignment | hdma->Init.MemDataAlignment | hdma->Init.Mode | hdma->Init.Priority;

View File

@@ -1,6 +1,7 @@
#include "Pins.h"
#include "Setup.h"
#include "stm32f1xx_hal.h"
#include "string.h"
/**
* Initializes the Global MSP.
*/
@@ -29,6 +30,7 @@ void HAL_MspInit(void) {
void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
GPIO_InitTypeDef GPIO_InitStruct;
memset(&GPIO_InitStruct, 0, sizeof(GPIO_InitStruct));
if (hadc->Instance == ADC1) {
__HAL_RCC_ADC1_CLK_ENABLE();
@@ -51,6 +53,7 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
HAL_NVIC_EnableIRQ(ADC1_2_IRQn);
} else {
__HAL_RCC_ADC2_CLK_ENABLE();
GPIO_InitStruct.Pull = GPIO_NOPULL;
/**ADC2 GPIO Configuration
PB0 ------> ADC2_IN8
@@ -59,9 +62,11 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) {
GPIO_InitStruct.Pin = TIP_TEMP_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
HAL_GPIO_Init(TIP_TEMP_GPIO_Port, &GPIO_InitStruct);
GPIO_InitStruct.Pin = TMP36_INPUT_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
HAL_GPIO_Init(TMP36_INPUT_GPIO_Port, &GPIO_InitStruct);
GPIO_InitStruct.Pin = VIN_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
HAL_GPIO_Init(VIN_GPIO_Port, &GPIO_InitStruct);

View File

@@ -101,7 +101,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ (SystemCoreClock)
#define configTICK_RATE_HZ (1000)
#define configMAX_PRIORITIES (6)
#define configMAX_PRIORITIES (7)
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
#define configMAX_TASK_NAME_LEN (32)

View File

@@ -198,7 +198,7 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) {
tmp = hdma->Instance->CCR;
/* Clear PL, MSIZE, PSIZE, MINC, PINC, CIRC and DIR bits */
tmp &= ((uint32_t) ~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | DMA_CCR_DIR));
tmp &= ((uint32_t)~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | DMA_CCR_DIR));
/* Prepare the DMA Channel configuration */
tmp |= hdma->Init.Direction | hdma->Init.PeriphInc | hdma->Init.MemInc | hdma->Init.PeriphDataAlignment | hdma->Init.MemDataAlignment | hdma->Init.Mode | hdma->Init.Priority;

View File

@@ -8,7 +8,7 @@
#define configCPU_CLOCK_HZ ((uint32_t)SystemCoreClock)
#define configRTC_CLOCK_HZ ((uint32_t)32768)
#define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES (4)
#define configMAX_PRIORITIES (7)
#define configMINIMAL_STACK_SIZE ((unsigned short)128)
#define configMAX_TASK_NAME_LEN 24
#define configIDLE_SHOULD_YIELD 0

View File

@@ -632,7 +632,7 @@ uint32_t adc_sync_mode_convert_value_read(void) {
\retval none
*/
void adc_watchdog_single_channel_enable(uint32_t adc_periph, uint8_t adc_channel) {
ADC_CTL0(adc_periph) &= (uint32_t) ~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL);
ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL);
/* analog watchdog channel select */
ADC_CTL0(adc_periph) |= (uint32_t)adc_channel;
ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC);
@@ -650,7 +650,7 @@ void adc_watchdog_single_channel_enable(uint32_t adc_periph, uint8_t adc_channel
\retval none
*/
void adc_watchdog_group_channel_enable(uint32_t adc_periph, uint8_t adc_channel_group) {
ADC_CTL0(adc_periph) &= (uint32_t) ~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC);
ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC);
/* select the group */
switch (adc_channel_group) {
case ADC_REGULAR_CHANNEL:
@@ -676,7 +676,7 @@ void adc_watchdog_group_channel_enable(uint32_t adc_periph, uint8_t adc_channel_
\param[out] none
\retval none
*/
void adc_watchdog_disable(uint32_t adc_periph) { ADC_CTL0(adc_periph) &= (uint32_t) ~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); }
void adc_watchdog_disable(uint32_t adc_periph) { ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); }
/*!
\brief configure ADC analog watchdog threshold

View File

@@ -45,8 +45,7 @@ OF SUCH DAMAGE.
\param[out] none
\retval none
*/
void bkp_deinit(void) { /* reset BKP domain register*/
}
void bkp_deinit(void) { /* reset BKP domain register*/ }
/*!
\brief write BKP data register

View File

@@ -112,7 +112,7 @@ void exmc_norsram_init(exmc_norsram_parameter_struct *exmc_norsram_init_struct)
snctl = EXMC_SNCTL(exmc_norsram_init_struct->norsram_region);
/* clear relative bits */
snctl &= ((uint32_t) ~(EXMC_SNCTL_NREN | EXMC_SNCTL_NRTP | EXMC_SNCTL_NRW | EXMC_SNCTL_NRWTPOL | EXMC_SNCTL_WREN | EXMC_SNCTL_NRWTEN | EXMC_SNCTL_ASYNCWAIT | EXMC_SNCTL_NRMUX));
snctl &= ((uint32_t)~(EXMC_SNCTL_NREN | EXMC_SNCTL_NRTP | EXMC_SNCTL_NRW | EXMC_SNCTL_NRWTPOL | EXMC_SNCTL_WREN | EXMC_SNCTL_NRWTEN | EXMC_SNCTL_ASYNCWAIT | EXMC_SNCTL_NRMUX));
snctl |= (uint32_t)((uint32_t)exmc_norsram_init_struct->address_data_mux << SNCTL_NRMUX_OFFSET) | exmc_norsram_init_struct->memory_type | exmc_norsram_init_struct->databus_width |
exmc_norsram_init_struct->nwait_polarity | ((uint32_t)exmc_norsram_init_struct->memory_write << SNCTL_WREN_OFFSET) |

View File

@@ -519,8 +519,7 @@ void _premain_init(void) {
* by __libc_fini_array function, so we defined a new function
* to do initialization
*/
void _postmain_fini(int status) { /* TODO: Add your own finishing code here, called after main */
}
void _postmain_fini(int status) { /* TODO: Add your own finishing code here, called after main */ }
/**
* \brief _init function called in __libc_init_array()
@@ -531,8 +530,7 @@ void _postmain_fini(int status) { /* TODO: Add your own finishing code here, cal
* \note
* Please use \ref _premain_init function now
*/
void _init(void) { /* Don't put any code here, please use _premain_init now */
}
void _init(void) { /* Don't put any code here, please use _premain_init now */ }
/**
* \brief _fini function called in __libc_fini_array()
@@ -543,7 +541,6 @@ void _init(void) { /* Don't put any code here, please use _premain_init now */
* \note
* Please use \ref _postmain_fini function now
*/
void _fini(void) { /* Don't put any code here, please use _postmain_fini now */
}
void _fini(void) { /* Don't put any code here, please use _postmain_fini now */ }
/** @} */ /* End of Doxygen Group NMSIS_Core_SystemAndClock */

View File

@@ -7,6 +7,9 @@
#include "Pins.h"
#include "Settings.h"
#include "Setup.h"
#if defined(WS2812B_ENABLE)
#include "WS2812B.h"
#endif
#include "TipThermoModel.h"
#include "USBPD.h"
#include "Utils.hpp"
@@ -27,6 +30,10 @@ uint8_t tempMeasureTicks = 25;
uint16_t totalPWM = 255; // Total length of the cycle's ticks
#if defined(WS2812B_ENABLE)
WS2812B<WS2812B_Pin, 1> ws2812b;
#endif
void resetWatchdog() {
// #TODO
}
@@ -124,6 +131,12 @@ uint8_t getButtonB() {
return val;
}
void BSPInit(void) {
#if defined(WS2812B_ENABLE)
ws2812b.init();
#endif
}
void reboot() { hal_system_reset(); }
void delay_ms(uint16_t count) {
@@ -143,7 +156,33 @@ bool isTipDisconnected() {
}
void setStatusLED(const enum StatusLED state) {
// Dont have one
#if defined(WS2812B_ENABLE)
static enum StatusLED lastState = LED_UNKNOWN;
if (lastState != state || state == LED_HEATING) {
switch (state) {
default:
case LED_UNKNOWN:
case LED_OFF:
ws2812b.led_set_color(0, 0, 0, 0);
break;
case LED_STANDBY:
ws2812b.led_set_color(0, 0, 0xFF, 0); // green
break;
case LED_HEATING: {
ws2812b.led_set_color(0, ((xTaskGetTickCount() / 4) % 192) + 64, 0, 0); // Red fade
} break;
case LED_HOT:
ws2812b.led_set_color(0, 0xFF, 0, 0); // red
break;
case LED_COOLING_STILL_HOT:
ws2812b.led_set_color(0, 0xFF, 0x20, 0x00); // Orange
break;
}
ws2812b.led_update();
lastState = state;
}
#endif
}
void setBuzzer(bool on) {}

View File

@@ -41,4 +41,11 @@
#define UART_TX_Pin GPIO_PIN_22
#define UART_RX_Pin GPIO_PIN_23
#if defined(WS2812B_ENABLE)
// WS2812B mod using TP10
#define WS2812B_Pin GPIO_PIN_12
// WS2812B mod using TP9 is doable too, but harder to reach. Thanks @t3chguy
//#define WS2812B_Pin GPIO_PIN_14
#endif
#endif /* BSP_PINE64_PINS_H_ */

View File

@@ -343,8 +343,7 @@ static u8_t *fixed_data_alloc(struct net_buf *buf, size_t *size, s32_t timeout)
return fixed->data_pool + fixed->data_size * net_buf_id(buf);
}
static void fixed_data_unref(struct net_buf *buf, u8_t *data) { /* Nothing needed for fixed-size data pools */
}
static void fixed_data_unref(struct net_buf *buf, u8_t *data) { /* Nothing needed for fixed-size data pools */ }
const struct net_buf_data_cb net_buf_fixed_cb = {
.alloc = fixed_data_alloc,

View File

@@ -100,7 +100,8 @@ static void bits2int(uECC_word_t *native, const uint8_t *bits, unsigned bits_siz
int uECC_sign_with_k(const uint8_t *private_key, const uint8_t *message_hash, unsigned hash_size, uECC_word_t *k, uint8_t *signature, uECC_Curve curve) {
uECC_word_t tmp[NUM_ECC_WORDS];
uECC_word_t s[NUM_ECC_WORDS];
uECC_word_t *k2[2] = {tmp, s};
uECC_word_t *k2[2] = {tmp, s};
uECC_word_t *initial_Z = 0;
uECC_word_t p[NUM_ECC_WORDS * 2];
uECC_word_t carry;
wordcount_t num_words = curve->num_words;
@@ -113,7 +114,15 @@ int uECC_sign_with_k(const uint8_t *private_key, const uint8_t *message_hash, un
}
carry = regularize_k(k, tmp, s, curve);
EccPoint_mult(p, curve->G, k2[!carry], 0, num_n_bits + 1, curve);
/* If an RNG function was specified, try to get a random initial Z value to improve
protection against side-channel attacks. */
if (g_rng_function) {
if (!uECC_generate_random_int(k2[carry], curve->p, num_words)) {
return 0;
}
initial_Z = k2[carry];
}
EccPoint_mult(p, curve->G, k2[!carry], initial_Z, num_n_bits + 1, curve);
if (uECC_vli_isZero(p, num_words)) {
return 0;
}

View File

@@ -2059,14 +2059,14 @@ void bt_att_mtu_changed(struct bt_l2cap_chan *chan, u16_t mtu) { bt_gatt_mtu_cha
static int bt_att_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan) {
int i;
static struct bt_l2cap_chan_ops ops = {
.connected = bt_att_connected,
.disconnected = bt_att_disconnected,
.recv = bt_att_recv,
.connected = bt_att_connected,
.disconnected = bt_att_disconnected,
.recv = bt_att_recv,
#if defined(CONFIG_BT_SMP)
.encrypt_change = bt_att_encrypt_change,
.encrypt_change = bt_att_encrypt_change,
#endif /* CONFIG_BT_SMP */
#if defined(BFLB_BLE_MTU_CHANGE_CB)
.mtu_changed = bt_att_mtu_changed,
.mtu_changed = bt_att_mtu_changed,
#endif
};

View File

@@ -260,7 +260,11 @@ struct event_handler {
};
#define EVENT_HANDLER(_evt, _handler, _min_len) \
{ .event = _evt, .handler = _handler, .min_len = _min_len, }
{ \
.event = _evt, \
.handler = _handler, \
.min_len = _min_len, \
}
static inline void handle_event(u8_t event, struct net_buf *buf, const struct event_handler *handlers, size_t num_handlers) {
size_t i;
@@ -5240,11 +5244,11 @@ int bt_recv(struct net_buf *buf) {
}
static const struct event_handler prio_events[] = {
EVENT_HANDLER(BT_HCI_EVT_CMD_COMPLETE, hci_cmd_complete, sizeof(struct bt_hci_evt_cmd_complete)),
EVENT_HANDLER(BT_HCI_EVT_CMD_STATUS, hci_cmd_status, sizeof(struct bt_hci_evt_cmd_status)),
EVENT_HANDLER(BT_HCI_EVT_CMD_COMPLETE, hci_cmd_complete, sizeof(struct bt_hci_evt_cmd_complete)),
EVENT_HANDLER(BT_HCI_EVT_CMD_STATUS, hci_cmd_status, sizeof(struct bt_hci_evt_cmd_status)),
#if defined(CONFIG_BT_CONN)
EVENT_HANDLER(BT_HCI_EVT_DATA_BUF_OVERFLOW, hci_data_buf_overflow, sizeof(struct bt_hci_evt_data_buf_overflow)),
EVENT_HANDLER(BT_HCI_EVT_NUM_COMPLETED_PACKETS, hci_num_completed_packets, sizeof(struct bt_hci_evt_num_completed_packets)),
EVENT_HANDLER(BT_HCI_EVT_DATA_BUF_OVERFLOW, hci_data_buf_overflow, sizeof(struct bt_hci_evt_data_buf_overflow)),
EVENT_HANDLER(BT_HCI_EVT_NUM_COMPLETED_PACKETS, hci_num_completed_packets, sizeof(struct bt_hci_evt_num_completed_packets)),
#endif /* CONFIG_BT_CONN */
};
@@ -5618,7 +5622,7 @@ extern struct net_buf_pool prep_pool;
#if defined(CONFIG_BT_BREDR)
extern struct net_buf_pool br_sig_pool;
extern struct net_buf_pool sdp_pool;
#if defined CONFIG_BT_HFP
#if defined CONFIG_BT_HFP
extern struct net_buf_pool hf_pool;
extern struct net_buf_pool dummy_pool;
#endif

View File

@@ -55,8 +55,9 @@
#ifndef __GNUC__
__WEAK
__ASM void ATTR_TCM_SECTION ASM_Delay_Us(uint32_t core, uint32_t cnt){
lsrs r0, #0x10 muls r0, r1, r0 mov r2, r0 lsrs r2, #0x04 lsrs r2, #0x03 cmp r2, #0x01 beq end cmp r2, #0x00 beq end loop mov r0, r0 mov r0, r0 mov r0,
r0 mov r0, r0 mov r0, r0 subs r2, r2, #0x01 cmp r2, #0x00 bne loop end bx lr}
lsrs r0, #0x10 muls r0, r1, r0 mov r2, r0 lsrs r2, #0x04 lsrs r2, #0x03 cmp r2, #0x01 beq end cmp r2, #0x00 beq end loop mov r0, r0 mov r0, r0 mov r0, r0 mov r0, r0 mov r0, r0 subs r2, r2,
# 0x01 cmp r2, #0x00 bne loop end bx lr
}
#else
__WEAK
void ATTR_TCM_SECTION ASM_Delay_Us(uint32_t core, uint32_t cnt) {

View File

@@ -1404,8 +1404,7 @@ BL_Sts_Type ATTR_TCM_SECTION SF_Ctrl_GetBusyState(void) {
*
*******************************************************************************/
#ifndef BFLB_USE_HAL_DRIVER
void SF_Ctrl_IRQHandler(void) { /* TODO: Not implemented */
}
void SF_Ctrl_IRQHandler(void) { /* TODO: Not implemented */ }
#endif
/*@} end of group SF_CTRL_Public_Functions */

View File

@@ -90,4 +90,6 @@
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70024, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533))
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70025, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533))
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70026, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533))
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_53 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70035, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533))
#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_54 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70036, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533))
#endif

View File

@@ -246,6 +246,12 @@ static struct bt_gatt_attr ble_attrs_declaration[] = {
ble_char_read_setting_value_callback, ble_char_write_setting_value_callback, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_SETTINGS_VALUE_38, BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE | BT_GATT_CHRC_WRITE_WITHOUT_RESP, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
ble_char_read_setting_value_callback, ble_char_write_setting_value_callback, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_SETTINGS_VALUE_53, BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE | BT_GATT_CHRC_WRITE_WITHOUT_RESP, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
ble_char_read_setting_value_callback, ble_char_write_setting_value_callback, NULL),
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_SETTINGS_VALUE_54, BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE | BT_GATT_CHRC_WRITE_WITHOUT_RESP, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
ble_char_read_setting_value_callback, ble_char_write_setting_value_callback, NULL),
/* Save & reset */
BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE, BT_GATT_CHRC_READ | BT_GATT_CHRC_WRITE | BT_GATT_CHRC_WRITE_WITHOUT_RESP, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE,
ble_char_read_setting_value_callback, ble_char_write_setting_value_callback, NULL),

View File

@@ -20,5 +20,6 @@ void preRToSInit() {
gpio_write(OLED_RESET_Pin, 0);
delay_ms(10);
gpio_write(OLED_RESET_Pin, 1);
BSPInit();
FRToSI2C::FRToSInit();
}

View File

@@ -101,7 +101,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ (SystemCoreClock)
#define configTICK_RATE_HZ (1000)
#define configMAX_PRIORITIES (6)
#define configMAX_PRIORITIES (7)
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
#define configMAX_TASK_NAME_LEN (32)

View File

@@ -319,6 +319,9 @@ static void MX_TIM2_Init(void) {
TIM_ClockConfigTypeDef sClockSourceConfig;
TIM_MasterConfigTypeDef sMasterConfig;
TIM_OC_InitTypeDef sConfigOC;
memset(&sConfigOC, 0, sizeof(sConfigOC));
memset(&sClockSourceConfig, 0, sizeof(sClockSourceConfig));
memset(&sMasterConfig, 0, sizeof(sMasterConfig));
// Timer 2 is fairly slow as its being used to run the PWM and trigger the ADC
// in the PWM off time.

View File

@@ -198,7 +198,7 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) {
tmp = hdma->Instance->CCR;
/* Clear PL, MSIZE, PSIZE, MINC, PINC, CIRC and DIR bits */
tmp &= ((uint32_t) ~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | DMA_CCR_DIR));
tmp &= ((uint32_t)~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | DMA_CCR_DIR));
/* Prepare the DMA Channel configuration */
tmp |= hdma->Init.Direction | hdma->Init.PeriphInc | hdma->Init.MemInc | hdma->Init.PeriphDataAlignment | hdma->Init.MemDataAlignment | hdma->Init.Mode | hdma->Init.Priority;

View File

@@ -22,8 +22,8 @@ bool BMA223::detect() {
}
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
//
//
//
//
{ BMA223_PMU_RANGE, 0b00000011, 0}, // 2G range
{ BMA223_PMU_BW, 0b00001101, 0}, // 250Hz filter
{ BMA223_PMU_LPW, 0b00000000, 0}, // Full power
@@ -33,7 +33,7 @@ static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
{ BMA223_INT_EN_0, 0b01000000, 0}, // Enable orientation
{ BMA223_INT_A, 0b00100111, 0}, // Setup orientation detection
//
//
};
bool BMA223::initalize() {
// Setup acceleration readings

View File

@@ -17,7 +17,7 @@ static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
{ LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on
{ LIS_CTRL_REG5, 0b00000010, 0}, //
{ LIS_CTRL_REG6, 0b01100010, 0},
// Basically setup the unit to run, and enable 4D orientation detection
// Basically setup the unit to run, and enable 4D orientation detection
{ LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{ LIS_INT2_THS, 0x28, 0}, //
{LIS_INT2_DURATION, 64, 0}, //

View File

@@ -13,8 +13,8 @@
bool MSA301::detect() { return ACCEL_I2C_CLASS::probe(MSA301_I2C_ADDRESS); }
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
//
//
//
//
{ MSA301_REG_ODR, 0b00001000, 1}, // X/Y/Z enabled @ 250Hz
{MSA301_REG_POWERMODE, 0b0001001, 1}, // Normal mode
{ MSA301_REG_RESRANGE, 0b00000001, 0}, // 14bit resolution @ 4G range

View File

@@ -34,7 +34,7 @@ uint32_t OLED::displayChecksum;
* Data packets are prefixed with 0x40
*/
I2C_CLASS::I2C_REG OLED_Setup_Array[] = {
/**/
/**/
{0x80, OLED_OFF, 0}, /* Display off */
{0x80, OLED_DIVIDER, 0}, /* Set display clock divide ratio / osc freq */
{0x80, 0x52, 0}, /* Divide ratios */
@@ -760,28 +760,33 @@ void OLED::fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, const uin
}
void OLED::drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool clear) {
//!! LSB is at the top of the screen !!
// Ensure coordinates are within bounds
if (x0 >= OLED_WIDTH || y0 >= OLED_HEIGHT || x1 >= OLED_WIDTH || y1 >= OLED_HEIGHT) {
return;
}
// Draw this in 3 sections
uint8_t remainingHeight = y1 - y0;
for (uint8_t currentRow = y0 / 8; (currentRow < (OLED_HEIGHT / 8)) && remainingHeight; currentRow++) {
uint8_t maskTop = (0xFF) << (y0 % 8); // Shift off the mask
y0 = 0; // Blank out any start offset for future iterations
// If we are terminating the bottom of the rectangle in this row, we mask the bottom side of things too
if (remainingHeight <= 8) {
uint8_t maskBottom = ~((0xFF) << y1 % 8); // Create mask for
maskTop = maskTop & maskBottom; // AND the two masks together for final write mask
// Calculate the height in rows
uint8_t startRow = y0 / 8;
uint8_t endRow = y1 / 8;
uint8_t startMask = 0xFF << (y0 % 8);
uint8_t endMask = 0xFF >> (7 - (y1 % 8));
for (uint8_t row = startRow; row <= endRow; row++) {
uint8_t mask = 0xFF;
if (row == startRow) {
mask &= startMask;
}
if (row == endRow) {
mask &= endMask;
}
for (uint8_t xpos = x0; xpos < x1; xpos++) {
for (uint8_t x = x0; x <= x1; x++) {
if (clear) {
stripPointers[currentRow][xpos] &= ~maskTop;
stripPointers[row][x] &= ~mask;
} else {
stripPointers[currentRow][xpos] |= maskTop;
stripPointers[row][x] |= mask;
}
}
remainingHeight -= 8; // Reduce remaining height but the row stripe height
}
}
@@ -791,8 +796,20 @@ void OLED::drawHeatSymbol(uint8_t state) {
// the levels masks the symbol nicely
state /= 31; // 0-> 8 range
// Then we want to draw down (16-(5+state)
uint8_t cursor_x_temp = cursor_x;
uint16_t cursor_x_temp = cursor_x;
drawSymbol(14);
/*
/ / / / /
/ / / / /
+---------+
| |
+---------+
<- 14 px ->
What we are doing is aiming to clear a section of the screen, down to the base depending on how much PWM we are using.
Larger numbers mean more heat, so we clear less of the screen.
*/
drawFilledRect(cursor_x_temp, 0, cursor_x_temp + 12, 2 + (8 - state), true);
}

View File

@@ -42,15 +42,15 @@ bool SC7A20::detect() {
}
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
//
//
//
//
{ SC7A20_CTRL_REG1, 0b01100111, 0}, // 200Hz, XYZ enabled
{ SC7A20_CTRL_REG2, 0b00000000, 0}, // Setup filter to 0x00 ??
{ SC7A20_CTRL_REG3, 0b00000000, 0}, // int1 off
{ SC7A20_CTRL_REG4, 0b01001000, 0}, // Block mode off,little-endian,2G,High-pres,self test off
{ SC7A20_CTRL_REG5, 0b00000100, 0}, // fifo off, D4D on int1
{ SC7A20_CTRL_REG6, 0x00, 0}, // INT2 off
// Basically setup the unit to run, and enable 4D orientation detection
// Basically setup the unit to run, and enable 4D orientation detection
{ SC7A20_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{ SC7A20_INT2_THS, 0x28, 0}, //
{SC7A20_INT2_DURATION, 64, 0}, //
@@ -58,7 +58,7 @@ static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
{ SC7A20_INT1_THS, 0x28, 0}, //
{SC7A20_INT1_DURATION, 64, 0}
//
//
};
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers_alt[] = {
{ LIS_CTRL_REG1, 0b00110111, 0}, // 200Hz XYZ
@@ -67,7 +67,7 @@ static const ACCEL_I2C_CLASS::I2C_REG i2c_registers_alt[] = {
{ LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on
{ LIS_CTRL_REG5, 0b00000010, 0}, //
{ LIS_CTRL_REG6, 0b01100010, 0},
// Basically setup the unit to run, and enable 4D orientation detection
// Basically setup the unit to run, and enable 4D orientation detection
{ LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{ LIS_INT2_THS, 0x28, 0}, //
{LIS_INT2_DURATION, 64, 0}, //

View File

@@ -135,8 +135,9 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
*bestVoltage = 5000; // Default 5V
// Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
uint8_t tipResistance = getTipResistanceX10();
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
uint8_t tipResistance = getTipResistanceX10();
usbpdMode_t pd_mode = (usbpdMode_t)getSettingValue(SettingsOptions::USBPDMode);
if (pd_mode == usbpdMode_t::DEFAULT) {
tipResistance += 5;
}
#ifdef MODEL_HAS_DCDC
@@ -156,21 +157,23 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
int min_resistance_ohmsx10 = voltage_mv / current_a_x100;
if (voltage_mv > 0) {
if (voltage_mv <= (USB_PD_VMAX * 1000)) {
if (min_resistance_ohmsx10 <= tipResistance) {
// This is a valid power source we can select as
if (voltage_mv > *bestVoltage) {
if (voltage_mv <= 20000 || (pd_mode != usbpdMode_t::NO_DYNAMIC)) {
if (min_resistance_ohmsx10 <= tipResistance) {
// This is a valid power source we can select as
if (voltage_mv > *bestVoltage) {
// Higher voltage and valid, select this instead
*bestIndex = i;
*bestVoltage = voltage_mv;
*bestCurrent = current_a_x100;
*bestIsPPS = false;
*bestIsAVS = false;
// Higher voltage and valid, select this instead
*bestIndex = i;
*bestVoltage = voltage_mv;
*bestCurrent = current_a_x100;
*bestIsPPS = false;
*bestIsAVS = false;
}
}
}
}
}
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && getSettingValue(SettingsOptions::USBPDMode)) {
} else if (((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED) && (pd_mode != usbpdMode_t::NO_DYNAMIC)) {
bool sourceIsEPRCapable = lastCapabilities[0] & PD_PDO_SRC_FIXED_EPR_CAPABLE;
bool isPPS = false;
bool isAVS = false;
@@ -210,6 +213,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
else if (isAVS) {
uint16_t max_voltage = PD_PAV2MV(PD_APDO_AVS_MAX_VOLTAGE_GET(lastCapabilities[i]));
uint8_t max_wattage = PD_APDO_AVS_MAX_POWER_GET(lastCapabilities[i]);
tipResistance = getTipResistanceX10(); // Dont use fudge factor for EPR
// W = v^2/tip_resistance => Wattage*tip_resistance == Max_voltage^2
auto ideal_max_voltage = sqrtI((max_wattage * tipResistance) / 10) * 1000;

View File

@@ -0,0 +1,81 @@
/*
* WS2812B.h
*
* Created on: 9 July 2023
* Author: Doegox
* Currently for RISC-V architecture only
* Based on WS2812.h by Ralim for STM32
*/
#include "Pins.h"
#include "Setup.h"
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#ifndef CORE_DRIVERS_WS2812B_H_
#define CORE_DRIVERS_WS2812B_H_
#ifndef WS2812B_LED_CHANNEL_COUNT
#define WS2812B_LED_CHANNEL_COUNT 3
#endif
#define WS2812B_RAW_BYTES_PER_LED (WS2812B_LED_CHANNEL_COUNT * 8)
template <uint16_t LED_PIN, int LED_COUNT> class WS2812B {
private:
uint8_t leds_colors[WS2812B_LED_CHANNEL_COUNT * LED_COUNT];
public:
void led_update() {
__disable_irq();
// Bitbang it out as our cpu irq latency is too high
for (unsigned int i = 0; i < sizeof(leds_colors); i++) {
// Shove out MSB first
for (int x = 0; x < 8; x++) {
if ((leds_colors[i] & (1 << (7 - x))) == (1 << (7 - x))) {
gpio_write(LED_PIN, 1);
for (int k = 0; k < 27; k++) {
__ASM volatile("nop");
}
gpio_write(LED_PIN, 0);
for (int k = 0; k < 10; k++) {
__ASM volatile("nop");
}
} else {
gpio_write(LED_PIN, 1);
for (int k = 0; k < 10; k++) {
__ASM volatile("nop");
}
gpio_write(LED_PIN, 0);
for (int k = 0; k < 27; k++) {
__ASM volatile("nop");
}
}
}
}
__enable_irq();
}
void init(void) { memset(leds_colors, 0, sizeof(leds_colors));
gpio_set_mode(LED_PIN, GPIO_OUTPUT_MODE);
gpio_write(LED_PIN, 1);
led_set_color(0, 0, 0xFF, 0); // green
led_update();
}
void led_set_color(size_t index, uint8_t r, uint8_t g, uint8_t b) {
leds_colors[index * WS2812B_LED_CHANNEL_COUNT + 0] = g;
leds_colors[index * WS2812B_LED_CHANNEL_COUNT + 1] = r;
leds_colors[index * WS2812B_LED_CHANNEL_COUNT + 2] = b;
}
void led_set_color_all(uint8_t r, uint8_t g, uint8_t b) {
for (int index = 0; index < LED_COUNT; index++) {
leds_colors[index * WS2812B_LED_CHANNEL_COUNT + 0] = g;
leds_colors[index * WS2812B_LED_CHANNEL_COUNT + 1] = r;
leds_colors[index * WS2812B_LED_CHANNEL_COUNT + 2] = b;
}
}
};
#endif /* CORE_DRIVERS_WS2812B_H_ */

View File

@@ -76,8 +76,9 @@ enum SettingsOptions {
ProfileCooldownSpeed = 52, // Maximum allowed cooldown speed in degrees per second
HallEffectSleepTime = 53, // Seconds (/5) timeout to sleep when hall effect over threshold
SolderingTipType = 54, // Selecting the type of soldering tip fitted
ReverseButtonSettings = 55, // Change the A and B button assigment in Settings menu
//
SettingsOptionsLength = 55, // End marker
SettingsOptionsLength = 56, // End marker
};
typedef enum {

View File

@@ -90,6 +90,7 @@ enum class SettingsItemIndex : uint8_t {
CooldownBlink,
ScrollingSpeed,
ReverseButtonTempChange,
ReverseButtonSettings,
AnimSpeed,
AnimLoop,
Brightness,

View File

@@ -54,7 +54,7 @@ typedef struct {
} SettingConstants;
static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOptionsLength] = {
//{ min, max, increment, default}
//{ min, max, increment, default}
{ MIN_TEMP_C, MAX_TEMP_F, 5, SOLDERING_TEMP}, // SolderingTemp
{ MIN_TEMP_C, MAX_TEMP_F, 5, 150}, // SleepTemp
{ 0, 15, 1, SLEEP_TIME}, // SleepTime
@@ -110,6 +110,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
{ 1, 10, 1, 2}, // ProfileCooldownSpeed
{ 0, 12, 1, 0}, // HallEffectSleepTime
{ 0, (tipType_t::TIP_TYPE_MAX - 1) > 0 ? (tipType_t::TIP_TYPE_MAX - 1) : 0, 1, 0}, // SolderingTipType
{ 0, 1, 1, 0}, // ReverseButtonSettings
};
static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));

View File

@@ -47,6 +47,7 @@ static void displayAdvancedSolderingScreens(void);
static void displayAdvancedIDLEScreens(void);
static void displayScrollSpeed(void);
static void displayReverseButtonTempChangeEnabled(void);
static void displayReverseButtonSettings(void);
static void displayPowerLimit(void);
#ifdef BLE_ENABLED
@@ -395,6 +396,8 @@ const menuitem UIMenu[] = {
{SETTINGS_DESC(SettingsItemIndex::ScrollingSpeed), nullptr, displayScrollSpeed, nullptr, SettingsOptions::DescriptionScrollSpeed, SettingsItemIndex::ScrollingSpeed, 7},
/* Reverse Temp change buttons +/- */
{SETTINGS_DESC(SettingsItemIndex::ReverseButtonTempChange), nullptr, displayReverseButtonTempChangeEnabled, nullptr, SettingsOptions::ReverseButtonTempChangeEnabled, SettingsItemIndex::ReverseButtonTempChange, 7},
/* Reverse Settings menu buttons A/B */
{SETTINGS_DESC(SettingsItemIndex::ReverseButtonSettings), nullptr, displayReverseButtonSettings, nullptr, SettingsOptions::ReverseButtonSettings, SettingsItemIndex::ReverseButtonSettings, 7},
/* Animation Speed adjustment */
{SETTINGS_DESC(SettingsItemIndex::AnimSpeed), nullptr, displayAnimationSpeed, nullptr, SettingsOptions::AnimationSpeed, SettingsItemIndex::AnimSpeed, 7},
/* Animation Loop switch */
@@ -450,11 +453,11 @@ const menuitem advancedMenu[] = {
/* clang-format on */
const menuitem *subSettingsMenus[] {
const menuitem *subSettingsMenus[]{
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
powerMenu,
powerMenu,
#endif
solderingMenu, PowerSavingMenu, UIMenu, advancedMenu,
solderingMenu, PowerSavingMenu, UIMenu, advancedMenu,
};
/* ^^^ !!!ENABLE CLANG-FORMAT back!!! ^^^ */
@@ -853,6 +856,8 @@ static void displayScrollSpeed(void) { OLED::print(translatedString((getSettingV
static void displayReverseButtonTempChangeEnabled(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled)); }
static void displayReverseButtonSettings(void) { OLED::drawCheckbox(getSettingValue(SettingsOptions::ReverseButtonSettings)); }
static void displayAnimationSpeed(void) {
switch (getSettingValue(SettingsOptions::AnimationSpeed)) {
case settingOffSpeed_t::SLOW:

View File

@@ -57,6 +57,9 @@ OperatingMode guiHandleDraw(void) {
setStatusLED(LED_OFF);
} else {
OLED::setDisplayState(OLED::DisplayState::ON);
}
if (currentOperatingMode != OperatingMode::Soldering && currentOperatingMode != OperatingMode::SolderingProfile) {
// Not in soldering mode, so set this based on temp
if (tipTemp > 55) {
setStatusLED(LED_COOLING_STILL_HOT);
} else {
@@ -157,6 +160,7 @@ void guiRenderLoop(void) {
memset(&context.scratch_state, 0, sizeof(context.scratch_state));
currentOperatingMode = newMode;
}
// If the transition marker is set, we need to make the next draw occur to the secondary buffer so we have something to transition to
if (context.transitionMode != TransitionAnimation::None) {
OLED::useSecondaryFramebuffer(true);

View File

@@ -6,7 +6,7 @@ OperatingMode showDebugMenu(const ButtonState buttons, guiContext *cxt) {
ui_draw_debug_menu(cxt->scratch_state.state1);
if (buttons == BUTTON_B_SHORT) {
cxt->transitionMode = TransitionAnimation::Down;
cxt->transitionMode = TransitionAnimation::Up;
return OperatingMode::HomeScreen;
} else if (buttons == BUTTON_F_SHORT) {
cxt->scratch_state.state1++;

View File

@@ -19,7 +19,7 @@ OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
break;
case BUTTON_B_LONG:
cxt->transitionMode = TransitionAnimation::Up;
cxt->transitionMode = TransitionAnimation::Down;
return OperatingMode::DebugMenuReadout;
break;
case BUTTON_F_LONG:
@@ -37,7 +37,8 @@ OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
break;
case BUTTON_F_SHORT:
if (!isTipDisconnected()) {
cxt->transitionMode = TransitionAnimation::Left;
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Left;
return OperatingMode::Soldering;
}
break;

View File

@@ -152,9 +152,9 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
if (currentVirtualPosition > 0) {
currentVirtualPosition--;
}
// The height of the indicator is screen res height / total menu entries
uint8_t indicatorHeight = OLED_HEIGHT / *currentMenuLength;
if (indicatorHeight == 0) {
indicatorHeight = 1; // always at least 1 pixel
}
@@ -181,8 +181,8 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
OLED::drawScrollIndicator((uint8_t)position, indicatorHeight);
}
}
// Now handle user button input
// Now handle user button input
auto callIncrementHandler = [&]() {
if (currentMenu[currentScreen].incrementHandler != nullptr) {
currentMenu[currentScreen].incrementHandler();
@@ -192,9 +192,29 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
return false;
};
//
OperatingMode newMode = OperatingMode::SettingsMenu;
// Modify a button value before processing a key press if setting to swap buttons is enabled
bool swapButtonSettings = getSettingValue(SettingsOptions::ReverseButtonSettings);
uint8_t buttonPress;
switch (buttons) {
case BUTTON_F_LONG:
buttonPress = swapButtonSettings ? BUTTON_B_LONG : BUTTON_F_LONG;
break;
case BUTTON_F_SHORT:
buttonPress = swapButtonSettings ? BUTTON_B_SHORT : BUTTON_F_SHORT;
break;
case BUTTON_B_LONG:
buttonPress = swapButtonSettings ? BUTTON_F_LONG : BUTTON_B_LONG;
break;
case BUTTON_B_SHORT:
buttonPress = swapButtonSettings ? BUTTON_F_SHORT : BUTTON_B_SHORT;
break;
default:
buttonPress = buttons;
break;
}
OperatingMode newMode = OperatingMode::SettingsMenu;
switch (buttonPress) {
case BUTTON_NONE:
(*autoRepeatAcceleration) = 0; // reset acceleration
(*autoRepeatTimer) = 0; // reset acceleration
@@ -210,7 +230,6 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
return OperatingMode::SettingsMenu;
}
break;
case BUTTON_F_LONG:
if (xTaskGetTickCount() + (*autoRepeatAcceleration) > (*autoRepeatTimer) + PRESS_ACCEL_INTERVAL_MAX) {
callIncrementHandler();
@@ -259,17 +278,16 @@ OperatingMode gui_SettingsMenu(const ButtonState buttons, guiContext *cxt) {
/* Fall through*/
case BUTTON_B_SHORT:
// Increment menu item
newMode = moveToNextEntry(cxt);
break;
default:
break;
}
if ((PRESS_ACCEL_INTERVAL_MAX - (*autoRepeatAcceleration)) < PRESS_ACCEL_INTERVAL_MIN) {
(*autoRepeatAcceleration) = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
}
// Otherwise we stay put for next render iteration
return newMode;
}
}

View File

@@ -33,6 +33,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
switch (buttons) {
case BUTTON_NONE:
cxt->scratch_state.state1 = 3;
cxt->scratch_state.state2 = 0;
break;
case BUTTON_F_LONG:
if (getSettingValue(SettingsOptions::BoostTemp) && (getSettingValue(SettingsOptions::LockingMode) == lockingMode_t::BOOST)) {
@@ -47,6 +48,8 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
}
return OperatingMode::Soldering;
}
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
// otherwise we are unlocked
switch (buttons) {
case BUTTON_NONE:
@@ -56,7 +59,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
case BUTTON_BOTH:
/*Fall through*/
case BUTTON_B_LONG:
cxt->transitionMode = TransitionAnimation::Right;
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
return OperatingMode::HomeScreen;
case BUTTON_F_LONG:
// if boost mode is enabled turn it on
@@ -142,10 +145,12 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
} else {
ui_draw_soldering_basic_status(cxt->scratch_state.state2);
}
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
// Check if we should bail due to undervoltage for example
if (checkExitSoldering()) {
setBuzzer(false);
cxt->transitionMode = TransitionAnimation::Right;
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
return OperatingMode::HomeScreen;
}
#ifdef NO_SLEEP_MODE
@@ -153,7 +158,7 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
if (shouldShutdown()) {
// shutdown
currentTempTargetDegC = 0;
cxt->transitionMode = TransitionAnimation::Right;
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
return OperatingMode::HomeScreen;
}
#endif

View File

@@ -65,7 +65,7 @@ typedef uint32_t blz_word;
#define LOOKUP_SIZE (1UL << BLZ_HASH_BITS)
#define NO_MATCH_POS ((blz_word)-1)
#define NO_MATCH_POS ((blz_word) - 1)
// Internal data structure
struct blz_state {

View File

@@ -37,7 +37,7 @@ struct blz_state {
#if !defined(BLZ_NO_LUT)
static const unsigned char blz_gamma_lookup[256][2] = {
/* 00xxxxxx = 2 */
/* 00xxxxxx = 2 */
{ 2, 2},
{ 2, 2},
{ 2, 2},
@@ -103,7 +103,7 @@ static const unsigned char blz_gamma_lookup[256][2] = {
{ 2, 2},
{ 2, 2},
/* 0100xxxx = 4 */
/* 0100xxxx = 4 */
{ 4, 4},
{ 4, 4},
{ 4, 4},
@@ -121,31 +121,31 @@ static const unsigned char blz_gamma_lookup[256][2] = {
{ 4, 4},
{ 4, 4},
/* 010100xx = 8 */
/* 010100xx = 8 */
{ 8, 6},
{ 8, 6},
{ 8, 6},
{ 8, 6},
/* 01010100 = 16 01010101 = 16+ 01010110 = 17 01010111 = 17+ */
/* 01010100 = 16 01010101 = 16+ 01010110 = 17 01010111 = 17+ */
{16, 8},
{16, 0},
{17, 8},
{17, 0},
/* 010110xx = 9 */
/* 010110xx = 9 */
{ 9, 6},
{ 9, 6},
{ 9, 6},
{ 9, 6},
/* 01011100 = 18 01011101 = 18+ 01011110 = 19 01011111 = 19+ */
/* 01011100 = 18 01011101 = 18+ 01011110 = 19 01011111 = 19+ */
{18, 8},
{18, 0},
{19, 8},
{19, 0},
/* 0110xxxx = 5 */
/* 0110xxxx = 5 */
{ 5, 4},
{ 5, 4},
{ 5, 4},
@@ -163,31 +163,31 @@ static const unsigned char blz_gamma_lookup[256][2] = {
{ 5, 4},
{ 5, 4},
/* 011100xx = 10 */
/* 011100xx = 10 */
{10, 6},
{10, 6},
{10, 6},
{10, 6},
/* 01110100 = 20 01110101 = 20+ 01110110 = 21 01110111 = 21+ */
/* 01110100 = 20 01110101 = 20+ 01110110 = 21 01110111 = 21+ */
{20, 8},
{20, 0},
{21, 8},
{21, 0},
/* 011110xx = 11 */
/* 011110xx = 11 */
{11, 6},
{11, 6},
{11, 6},
{11, 6},
/* 01111100 = 22 01111101 = 22+ 01111110 = 23 01111111 = 23+ */
/* 01111100 = 22 01111101 = 22+ 01111110 = 23 01111111 = 23+ */
{22, 8},
{22, 0},
{23, 8},
{23, 0},
/* 10xxxxxx = 3 */
/* 10xxxxxx = 3 */
{ 3, 2},
{ 3, 2},
{ 3, 2},
@@ -253,7 +253,7 @@ static const unsigned char blz_gamma_lookup[256][2] = {
{ 3, 2},
{ 3, 2},
/* 1100xxxx = 6 */
/* 1100xxxx = 6 */
{ 6, 4},
{ 6, 4},
{ 6, 4},
@@ -271,31 +271,31 @@ static const unsigned char blz_gamma_lookup[256][2] = {
{ 6, 4},
{ 6, 4},
/* 110100xx = 12 */
/* 110100xx = 12 */
{12, 6},
{12, 6},
{12, 6},
{12, 6},
/* 11010100 = 24 11010101 = 24+ 11010110 = 25 11010111 = 25+ */
/* 11010100 = 24 11010101 = 24+ 11010110 = 25 11010111 = 25+ */
{24, 8},
{24, 0},
{25, 8},
{25, 0},
/* 110110xx = 13 */
/* 110110xx = 13 */
{13, 6},
{13, 6},
{13, 6},
{13, 6},
/* 11011100 = 26 11011101 = 26+ 11011110 = 27 11011111 = 27+ */
/* 11011100 = 26 11011101 = 26+ 11011110 = 27 11011111 = 27+ */
{26, 8},
{26, 0},
{27, 8},
{27, 0},
/* 1110xxxx = 7 */
/* 1110xxxx = 7 */
{ 7, 4},
{ 7, 4},
{ 7, 4},
@@ -313,25 +313,25 @@ static const unsigned char blz_gamma_lookup[256][2] = {
{ 7, 4},
{ 7, 4},
/* 111100xx = 14 */
/* 111100xx = 14 */
{14, 6},
{14, 6},
{14, 6},
{14, 6},
/* 11110100 = 28 11110101 = 28+ 11110110 = 29 11110111 = 29+ */
/* 11110100 = 28 11110101 = 28+ 11110110 = 29 11110111 = 29+ */
{28, 8},
{28, 0},
{29, 8},
{29, 0},
/* 111110xx = 15 */
/* 111110xx = 15 */
{15, 6},
{15, 6},
{15, 6},
{15, 6},
/* 11111100 = 30 11111101 = 30+ 11111110 = 31 11111111 = 31+ */
/* 11111100 = 30 11111101 = 30+ 11111110 = 31 11111111 = 31+ */
{30, 8},
{30, 0},
{31, 8},

View File

@@ -361,6 +361,12 @@ ifdef swd_enable
GLOBAL_DEFINES+=-DSWD_ENABLE
endif
ifeq ($(model),$(filter $(model),$(ALL_PINECIL_V2_MODELS)))
ifdef ws2812b_enable
GLOBAL_DEFINES += -DWS2812B_ENABLE
endif
endif
# Libs -------------------------------------------------------------------------
LIBS=
@@ -425,6 +431,7 @@ CHECKOPTIONS=-Wtrigraphs \
-Wmissing-field-initializers \
-Wshadow \
-Wno-unused-parameter \
-Wno-undef \
-Wdouble-promotion
CHECKOPTIONS_C=$(CHECKOPTIONS) -Wbad-function-cast
@@ -454,6 +461,7 @@ CFLAGS=$(DEV_CFLAGS) \
-D${COMPILER} \
-MMD \
-std=gnu11 \
-g3 \
$(OPTIM) \
-T$(LDSCRIPT) \
-c
@@ -549,14 +557,14 @@ Core/Gen/Translation.%.cpp $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle: ..
@test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files
@echo 'Generating translations for language $*'
@$(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation.$*.cpp \
--output-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \
--macros "$(CURDIR)/Core/Gen/macros.txt" \
-o "$(CURDIR)/Core/Gen/Translation.$*.cpp" \
--output-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle" \
$*
Core/Gen/macros.txt: Makefile
@test -d $(CURDIR)/Core/Gen || mkdir -p $(CURDIR)/Core/Gen
echo "#include <configuration.h>" | $(CC) -dM -E $(CFLAGS) -MF $(CURDIR)/Core/Gen/macros.tmp - > $(CURDIR)/Core/Gen/macros.txt
@test -d "$(CURDIR)/Core/Gen" || mkdir -p "$(CURDIR)/Core/Gen"
echo "#include <configuration.h>" | $(CC) -dM -E $(CFLAGS) -MF "$(CURDIR)/Core/Gen/macros.tmp" - > "$(CURDIR)/Core/Gen/macros.txt"
# The recipes to produce compressed translation data
@@ -579,10 +587,10 @@ Core/Gen/Translation_brieflz.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.o
@test -d $(@D) || mkdir -p $(@D)
@echo Generating BriefLZ compressed translation for $*
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation_brieflz.$*.cpp \
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle \
--strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/$*.o \
--macros "$(CURDIR)/Core/Gen/macros.txt" \
-o "$(CURDIR)/Core/Gen/Translation_brieflz.$*.cpp" \
--input-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/$*.pickle" \
--strings-obj "$(OUTPUT_DIR)/Core/Gen/translation.files/$*.o" \
$*
Core/Gen/Translation_brieflz_font.%.cpp: $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so Core/Gen/macros.txt
@@ -634,9 +642,9 @@ Core/Gen/Translation_multi.$(1).cpp: $(patsubst %,../Translations/translation_%.
@test -d $(OUTPUT_DIR)/Core/Gen/translation.files || mkdir -p $(OUTPUT_DIR)/Core/Gen/translation.files
@echo 'Generating translations for multi-language $(2)'
@$(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation_multi.$(1).cpp \
--output-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \
--macros "$(CURDIR)/Core/Gen/macros.txt" \
-o "$(CURDIR)/Core/Gen/Translation_multi.$(1).cpp" \
--output-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle" \
$(3)
$(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle: Core/Gen/Translation_multi.$(1).cpp
@@ -645,10 +653,10 @@ Core/Gen/Translation_brieflz_multi.$(1).cpp: $(OUTPUT_DIR)/Core/Gen/translation.
@test -d $$(@D) || mkdir -p $$(@D)
@echo Generating BriefLZ compressed translation for multi-language $(2)
@OBJCOPY=$(OBJCOPY) $(HOST_PYTHON) ../Translations/make_translation.py \
--macros $(CURDIR)/Core/Gen/macros.txt \
-o $(CURDIR)/Core/Gen/Translation_brieflz_multi.$(1).cpp \
--input-pickled $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle \
--strings-obj $(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o \
--macros "$(CURDIR)/Core/Gen/macros.txt" \
-o "$(CURDIR)/Core/Gen/Translation_brieflz_multi.$(1).cpp" \
--input-pickled "$(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).pickle" \
--strings-obj "$(OUTPUT_DIR)/Core/Gen/translation.files/multi.$(1).o" \
--compress-font \
$(3)

View File

@@ -8,6 +8,7 @@ AVAILABLE_LANGUAGES=()
BUILD_LANGUAGES=()
AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "S60P" "T55" "TS101")
BUILD_MODELS=()
OPTIONS=()
builder_info() {
echo -e "
@@ -28,17 +29,19 @@ usage() {
builder_info
echo -e "
Usage :
$(basename "$0") [-l <LANG_CODES>] [-m <MODELS>] [-h]
$(basename "$0") [-l <LANG_CODES>] [-m <MODELS>] [-o <OPTIONS>] [-h]
Parameters :
-l LANG_CODE : Force a specific language (${AVAILABLE_LANGUAGES[*]})
-m MODEL : Force a specific model (${AVAILABLE_MODELS[*]})
-o key=val : Pass options to make
-h : Show this help message
Example :
$(basename "$0") -l EN -m TS100 (Build one language and model)
$(basename "$0") -l EN -m \"TS100 MHP30\" (Build one language and multi models)
$(basename "$0") -l \"DE EN\" -m \"TS100 MHP30\" (Build multi languages and models)
$(basename "$0") -l EN -m Pinecilv2 -o ws2812b_enable=1
INFO :
By default, without parameters, the build is for all platforms and all languages
@@ -84,8 +87,9 @@ isInArray() {
declare -a margs=()
declare -a largs=()
declare -a oargs=()
while getopts "h:l:m:" option; do
while getopts "h:l:m:o:" option; do
case "${option}" in
h)
usage
@@ -96,6 +100,9 @@ while getopts "h:l:m:" option; do
m)
IFS=' ' read -r -a margs <<<"${OPTARG}"
;;
o)
IFS=' ' read -r -a oargs <<< "${OPTARG}"
;;
*)
usage
;;
@@ -156,6 +163,16 @@ fi
echo "********************************************"
echo -n "Requested options : "
if ((${#oargs[@]})); then
for i in "${oargs[@]}"; do
echo -n "$i "
OPTIONS+=("$i")
done
echo ""
fi
echo "********************************************"
##
#StartBuild
@@ -168,7 +185,7 @@ if [ ${#BUILD_LANGUAGES[@]} -gt 0 ] && [ ${#BUILD_MODELS[@]} -gt 0 ]; then
for model in "${BUILD_MODELS[@]}"; do
echo "Building firmware for $model in ${BUILD_LANGUAGES[*]}"
make -j"$(nproc)" model="$model" "${BUILD_LANGUAGES[@]/#/firmware-}" >/dev/null
make -j"$(nproc)" model="$model" "${BUILD_LANGUAGES[@]/#/firmware-}" "${OPTIONS[@]}" >/dev/null
checkLastCommand
done
else