Commit Graph

114 Commits

Author SHA1 Message Date
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
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
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
Ben V. Brown
48649908a7 WIP: Split Render for multiple screen resolutions (#1888)
* Create README.md

* Move to new folder

* Migrating

* Migrate Remainder

* format fix (all but one) (#1889)

* Update USBPDDebug_FS2711.cpp

* Delete PrintVoltage.cpp

* Copy in 128x32 template

* Mask drawing for 96x16

* Import #1819

* Update Font.h

* Homescreen

* Update draw_homescreen_detailed.cpp

* Fix oled normal draw for variable height

* Update OLED.cpp

* Draw settings icons

* Update draw_homescreen_simplified.cpp

* Update draw_power_source_icon.cpp

* Fixup oled drawing for fill area

* Update the region fill for mixed heights

* Fix newline height

* FIXUP! Draw icons in settings menu at correct size

* Fix scrollbar

* Update settingsGUI.cpp

* S60(P) Disable auto display rotation

* On tall oled, scroll in 2 line increments

* Bugfix transition L<->R

@discip I take it back, there was a bug :)

* Draw every other one on transitions

* .

* cleanup

* Bootup logo: Draw in centre

* Update OLED.hpp

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2024-07-12 08:27:05 +10:00
Ben V. Brown
baf2f26e59 Big overhaul of the UI framework (#1749)
* Starting GUI render refactor to be more immediate mode

Update TemperatureAdjust.cpp

.

Cleanup Soldering

Sleep

SolderingProfiles

Soldering Rework

Rough pass GUI

Temp Adjust

Cleanup old OperatingMode

Debug Menu

* Update TemperatureAdjust.cpp

* Roughing some transition work

* Fixup! Hook in the init starter helper

* Better home screen button handler

* FIXUP! Fix typo's

.

* Update SettingsMenu.cpp

* More settings rework

* More settings rendering

* Fixup

* Transitions

Update SolderingProfile.cpp

Hook in transistions

* Update TemperatureAdjust.cpp

* Update push.yml

* Add auto-repeat to settings menu

* Miniware: Use IT for I2C writes

* Update USBPDDebug_HUSB238.cpp

* Force write screen on side animation cancel

.

* Refactor moving down the settings list

* Update settingsGUI.cpp

* Update I2C_Wrapper.cpp

* Update OLED.cpp

* Rework button handling

* Fix PD debug at boot

* Fixup not showing right menu options

* silence some warnings

* Style cleanup

* Fkit use bit-bang I2C for Miniware

* Update GUIRendering.md

* Fixup transition on enter soldering mode

* Save Settings

* Fixes for some animations not running

Dont bail on animations if keypress is still held

* Fixup settings acceleration

* OLED Up animation

* Link up/down on debug meny

* Make all accelerometers I2C bus aware

Update accelerometers_common.h

* Make I2C mag optional

* Miniware -> Only Bit-Bang I2C

* Fixup for scrollbar

FIXUP! Debug menu returns to home screen

FIXUP! Up oled animation

Fix temp exit

* Settings menu -> Both buttons return a menu layer

* Merge fixup

* Update BMA223.cpp

* Re-Enable OLED sleep

* Save Setting on temp adjust exit

* WiP on startup mode

* Some autostart working

* Add hibernation mode & more autostart fixes

* If cant CJC; go to startup

* Hibernate in sleep

* Cleanup scroll indicator

* FIXUP! Ensure startup warnings are linked in

* FIXUP! Ensure we render out temp change before timing out

* Ensure 100ms delay between CJC samples

* Fix not re-calculating menu length on entering menu

* Implement NegotiationinProgress for USB-PD

* Mask heating until PD finishes negotiation

* Fixup staying in hibernate correctly

* Warning timeout

* Show reset settings warning

* Correctly compensate help text start time

* Update GUIThread.cpp

* Update USBPD.cpp

* .

* Fixup sleep time

* Update printSleepCountdown.cpp

* replacing countdown with big plus while in boost mode

* bringing back the + 1 since it was missing when not in boost mode

* Bail on USB-PD check after 3 seconds incase of DC source

* Fix hibernate

* Update PIDThread.cpp

* did center plus symbol (boost mode)

* Big refactor to not make settings increment handler handle the "is last item" return

* Fixup boot logo

* Fix flashing

* Fixup recalculate the menu length on long hold

* Fixup missing menu entries

* Fix junk left on screen after user confirmation

* Re-order button handler to use custom, then default order to allow setting associated setting

* Attach setting for settings using custom handler

* Fix swap +/- keys

* Fix boost temp

* Implement last menu option for Language selector

* Wait for init before CJC runs

* Check last setting via increment value

* Update BSP.cpp

* removed = from >=

Otherwise incrementing would stop and the scroll bar would already flash at the second to last value.

* (Hacky) Fix for Settings reset

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2024-02-18 09:42:08 +11:00
Ivan Zorin
a02f8c8ae3 Implement optional looping for animated boot logo [#1839] 2023-11-21 01:38:10 +03:00
Ben V. Brown
80c4b58976 Abstract out showing bootlogo
To improve support on PinecilV2
2023-08-01 21:18:27 +10:00
Ben V. Brown
d3d8e3d2d5 TS101 (#1695)
* Refactor I2C_SOFT to new #define

* Stitch in some of TS101

Update ShowStartupWarnings.cpp

Update OLED.hpp

Update stm32f1xx_hal_msp.c

Update Setup.cpp

Update Power.cpp

Update Pins.h

Update configuration.h

Power Muxing

Working dual input Voltage handler

Scan mode required for differing injected channels

Inject both dc readings

Update configuration.h

Update configuration.h

Use htim4 for adc control on TS101

Refactor htim names

Add ADC_TRIGGER

Speed up BB I2C a lil

Update configuration.h

Update startup_stm32f103t8ux.S

Update configuration.h

Add LIS2DH clone

LIS2DH gains another clone

Create tooling to allow mapping accelerometers onto different buses

Update startup_stm32f103t8ux.S

Ensure PD IRQ is pulled up

* Stitch in some of TS101

Update ShowStartupWarnings.cpp

Update OLED.hpp

Update stm32f1xx_hal_msp.c

Update Setup.cpp

Update Power.cpp

Update Pins.h

Update configuration.h

Power Muxing

Working dual input Voltage handler

Scan mode required for differing injected channels

Inject both dc readings

Update configuration.h

Update configuration.h

Use htim4 for adc control on TS101

Refactor htim names

Add ADC_TRIGGER

Speed up BB I2C a lil

Update configuration.h

Update startup_stm32f103t8ux.S

Update configuration.h

Add LIS2DH clone

LIS2DH gains another clone

Create tooling to allow mapping accelerometers onto different buses

Update startup_stm32f103t8ux.S

Ensure PD IRQ is pulled up

Allow toggle which button enters PD debug

* Update Pins.h

* Fix hard coded IRQ Pin

Update stm32f1xx_it.c

* Enable EPR

* Tip resistance measurement

* TS101 is a direct drive tip

Update BSP.cpp

* Add S60 and TS101 to builds

Update push.yml

* Update MOVThread.cpp

* Refactor power menu handler

* Correct prescaler

Forgot to update since I changed the period

* Tune in the timer divider for tip control to make PWM less audible

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2023-06-18 21:58:20 +10:00
Ben V. Brown
286afad919 S60 Support (#1692)
* Mock S60

* cleanup

* Start refactor of OLED init

* Setup timers roughly

* Set Vector table offset correctly

Update system_stm32f1xx.c

* Update OLED.cpp

* Update stm32f1xx_hal_msp.c

* Update configuration.h

* I2C init before GPIO

From Errata

Update stm32f1xx_hal_msp.c

Update Software_I2C.h

Allow no hardware I2C

* I2C BB run bus unlock at init

* cleanups

* Software I2C for now

* Mildly more graceful Interpolate

* Handle is powered by DC

Update Power.cpp

Update drawPowerSourceIcon.cpp

Update configuration.h

Update Setup.cpp

* Cleanup HomeScreen

* Segment remap oled at init

* Cleanup

* Update MOVThread.cpp

* Fix PWM Init

* Fix adc2 trigger

* Update configs

* Fixup warning

* Saner default config

* Update ThermoModel.cpp

* Util for current@voltage

* Hub238 warning

* Add hub238 handling in power mode

* Update USBPDDebug_FUSB.cpp

* HUSB238 debug

* Hook PSU Limit

* Use wrapping section of GRAM for scroll

Update OLED.hpp

* Update NTC table

* Fix HUB voltage picker

* Cleanup

* Larger tip filter

* Calibrate in a bunch closer

Update ThermoModel.cpp

* Update configuration.h

* Update HUB238.cpp

* Update configuration.h

* Movement Pin

* Update BSP.cpp

* tim2 irq

* Rough timer conversion (adc broken) but movement working

* Fix tim2 start

* Faster base PWM

* Ensure utils grabs config

* Add wattage limiter tolerance for device

* Speed up PWM and enable PWM current limiting

* tune for 12v

* Prevent start until PD done

* Update configuration.h

* Add HUB238 check for have re-negotiated

* Adjust timer to avoid noise when its possible
2023-06-03 20:05:31 +10:00
Ben V. Brown
6ca5f5c08d Merge branch 'dev' into refactor-gui-files 2022-11-25 21:24:49 +11:00
discip
c55ecbff6c fixed CJC calibration rule
Did not calibrate if *handle temp* was higher than *tip temp*.
2022-11-24 23:56:15 +01:00
Ben V. Brown
2c02f55139 Merge pull request #1436 from Ralim/test-slow-i2c
Improve I2C for PinecilV2
2022-11-23 21:09:04 +11:00
Ben V. Brown
6b8ee8ad48 Update GUIThread.cpp 2022-11-23 21:07:26 +11:00
Ben V. Brown
3007a44e45 Merge branch 'dev' into refactor-gui-files 2022-11-23 21:05:54 +11:00
Ben V. Brown
3b898ddc50 Refactor out home screen 2022-11-22 18:33:01 +11:00
Ben V. Brown
6cbb01db41 References 2022-11-22 18:26:16 +11:00
Ben V. Brown
461165e982 Bugfix display off 2022-11-20 18:38:35 +11:00
discip
161b8ba2cb reworked CJC appearance 2022-11-17 00:30:27 +01:00
discip
c89db78b45 Calibrate CJC at next boot (#1398)
Changes Cold Junction Compensation (Tip Offset / CJC) to be performed during bootup time. (After starting in settings)
2022-09-10 20:52:57 +10:00
discip
b5323d9c77 reorder debug menu . . . (#1380)
* Update DebugMenu.md

* Update make_translation.py

* Update GUIThread.cpp

* Update DebugMenu.md
2022-08-25 09:17:15 +10:00
discip
3a44259735 typo fix (#1368) 2022-08-20 23:01:24 +10:00
Ben V. Brown
1fbcdcdf98 Pinecil V2 (#1341)
* Add SDK

* fork

* massaging makefile

* Drop git module

* Bring in sdk as its broken

Far, Far to much crap to fix with regex now

* Remove bl706

* rf_para_flash_t is missing defs

* Remove crapton of junk

* Remove yet more

* Poking I2C

* Update peripheral_config.h

* Update pinmux_config.h

* Update preRTOS.cpp

* Update main.hpp

* Setup template

* Verbose boot

* I2C ish

* Update I2C_Wrapper.cpp

* Update main.cpp

* Turn off I2C reading for now

* Display running

* Roughing out scheduling timer0

* Starting ADC setup

* Working scheduling of ADC 🎉

* Format adc headers

* Update IRQ.cpp

* Buttons working

* Slow down I2C

* Poking IRQ

* Larger stack required

* Accel on

* Trying to chase down why __libc_init_array isnt working yet

* Working c++

* Cleanup

* Bump stacks

* I2C wake part workaround

* Cleanup

* Working PWM init

* qc draft

* Hookup PWM

* Stable enough ADC

* ADC timing faster + timer without HAL

* Silence

* Remove boot banner

* Tuning in ADC

* Wake PID after ADC

* Remove unused hal

* Draft flash settings

* Working settings save & restore

* Update to prod model

* Cleanup

* NTC thermistor

* Correct adc gain

* Rough tip resistance progress

* Scratch out resistance awareness of the tip

* better adc settings

* Tweaking ADC

* ADC tweaking

* Make adc range scalable

* Update Dockerfile

* Update configuration.h

* Can read same ADC twice in a row

* ADC Setup

* Update PIDThread.cpp

* Lesser adc backoff

* Update USBPD.h

* Add device ID

* Update BSP_Power.h

* Update BSP.cpp

* DrawHex dynamicLength

* Shorter ID padding

* Show validation code

* tip measurement

* Create access for w0w1

* Expose w0 w1

* Enable debug

* crc32

* Device validation

* wip starting epr

* Logic refactor

* Safer PWM Init

* PD cleanups

* Update bl702_pwm.c

* Update power.cpp

* Update usb-pd

* io

* EPR decode

* Better gui for showing pd specs

* Rough handler for capabilities

* EPR

* Fix > 25V input

* Perform pow step after PPS

* Update BSP.cpp

* Fix timer output

* QC3

* Add tip resistance view

* Hold PD negotiation until detection is done for tip res

* Get Thermal mass

* Tip res =0 protection

* Update PIDThread.cpp

* Update GUIThread.cpp

* Rewrite tip resistance measurement

* Update GUIThread.cpp

* Fix fallback

* Far better tip resistance measurement

* Fix QC 0.6V D-

* Convert the interpolator to int32

* Correct the NTC lookup

* Update BSP.cpp

* Update Setup.cpp

* .

Update configuration #defines

More backported functions

* Update usb-pd

* More missed updates

* Refactor BSP

Magic BSP -> PinecilV2
Pine64 BSP -> Pinecil

Update Makefile

* Add Pinecilv2 to CI

* Pinecil v2 multi-lang

Update push.yml

* Update HallSensor.md

* Update README.md

* Fix wrong prestartcheck default

* Fix logo mapping

* Update Makefile

* Remove unused font block

* Style

* Style

* Remove unused timer funcs

* More culling TS80P

* Revert "More culling TS80P"

This reverts commit 2078b89be7.

* Revert "Remove unused timer funcs"

This reverts commit 0c693a89cc.

* Make VBus check maskable

* Remove DMA half transfer

* Drop using brightness and invert icons and go back to text

Saves flash space

* Refactor settings UI drawing descriptions

* Shorten setting function names

* Store bin file assets

* Fix MHP prestart
2022-08-19 15:39:37 +10:00
Aaronjamt
972d2fffac Allow preheating iron during boot logo
Autostart (if enabled) _before_ showing boot logo (rather than waiting for the entire animation to finish). Only heats if the boot logo is on but not infinite (and autostart is set to heat). Heats to sleep temperature or 75*C, whichever is lower, for safety (and if the iron can get to 75* by the time the logo disappears then this really doesn't matter much). This is purely a preheat if your iron is low-powered and takes a long time to warm and so if autostart is set to heat to soldering temperature, it will start heating the rest of the way once the boot logo disappears.
2022-07-29 10:53:21 -07:00
Ben V. Brown
f1ceb0ec62 Merge branch 'dev' into pd-epr 2022-07-25 17:34:13 +10:00
Ben V. Brown
dd239375b1 All Ticks as the right TickType
Update usb-pd
2022-07-25 16:45:29 +10:00
Ben V. Brown
7166dd1f33 Update PD debug to be EPR aware 2022-07-18 22:59:51 +10:00
Ben V. Brown
078b8f5626 DeviceID (#1314)
* Ability to print hex

* Add device ID getter

* Refactor debug menu

* No longer need patch

* Update make_translation.py

* Fix typo

* Fix hex drawing
2022-06-16 21:39:53 +10:00
Ben V. Brown
165a9952c2 MHP30: Shutdown settings (#1307)
* Reduce PPS max to 20V to avoid instability

Some PSU's cant actually run at 21V

* Creating a rough draft of a "pre start check" concept

* Newer alpine

* Cleaning up MHP detection

* Cleanup comments

* PID: Run prestart based on ADC IRQ rather than times

* MHP30: Far better startup for detecting tip gain

* Newer alpine for github CI

* Bugfix: Exit on movement

* Feature: Shutdown timeout for MHP30
2022-06-16 20:28:49 +10:00
Ben V. Brown
3bb1b7bc32 Startup behaviour fixes (#1306)
* Reduce PPS max to 20V to avoid instability

Some PSU's cant actually run at 21V

* Creating a rough draft of a "pre start check" concept

* Newer alpine

* Cleaning up MHP detection

* Cleanup comments

* PID: Run prestart based on ADC IRQ rather than times

* MHP30: Far better startup for detecting tip gain

* Newer alpine for github CI
2022-06-16 20:21:46 +10:00
Ben V. Brown
d1d403376f Fix typo in PD info screen 2022-04-04 13:07:48 +10:00
Ben V. Brown
a73f634cff Pinecil pd tweaking (#1272)
* Raise PD max to 21V

* gui -> settingsGUI

* VBus probe cache

* Rough pass PD capabilities display

* Cleanup build errors

* PD Debug menu working

* Update make_translation.py

* settingsGUI

* Update GUIThread.cpp

* Nicer debug prints

* Show VBus in PD debug

* Update GUIThread.cpp

* Update make_translation.py

* Add docs

* Build tweaks for TS80P 😢

* Show PPS ranges
2022-04-03 12:58:07 +10:00
Ben V. Brown
232009bf54 Logo rework (#1232)
!Allows for new logo format that supports animation!
Also moves logos out of repo into their own repo for ease of management.


Changes:
* Remove deprecated logos
* Draft new Bootloader decoder
* Use new logo handler
* Simplify logo code further
* Fix time bug on static images
* Fix exit at end of animation
* Docs
* Interframe delay in 5ms increments
* Quick pass handling empty updates
* Exit at the end _after_ the frame delay
* One final delay
* Fix for overrun of logo data
* Fixes https://github.com/Ralim/IronOS-Meta/issues/7
2022-03-14 09:08:05 +11:00
Ben V. Brown
16882fee61 only vbus mod check on pinecil
If a TS80P has it connected, other things blow up first at 20V
2022-02-12 10:34:22 +11:00
Ben V. Brown
78344279d3 Merge branch 'master' into pinecil-mod-detect 2022-02-06 15:56:57 +11:00
Ben V. Brown
f715f77848 fix oled layout _again_ 2022-02-06 15:56:41 +11:00
Ben V. Brown
0735d4f704 Update GUIThread.cpp 2022-02-06 14:42:01 +11:00
Ben V. Brown
265e152c18 Add to debug menu 2022-02-06 13:15:01 +11:00
Ben V. Brown
0fcde2806d Update GUIThread.cpp 2022-02-05 13:11:15 +11:00
Ben V. Brown
1122d18526 Merge branch 'master' into rework 2022-02-05 12:43:53 +11:00
Ben V. Brown
513a2d66bb Always set cursor back to (0,0) 2022-02-05 12:34:08 +11:00
Ben V. Brown
15763dd55b Cleanup OLED_FLIP logic
Update OLED.hpp

Update OLED.hpp

Update OLED.hpp
2022-02-05 12:23:51 +11:00
discip
eba52bfd5b removing HALL from unsupported devices _2 2022-02-04 23:43:13 +01:00
Ben V. Brown
a19b33c85e Take absolute value of hall sensor for debug menu 2022-02-05 09:05:15 +11:00
Christian Rahl
6a9c648b62 < the place where 2 spaces should have been. 2022-01-22 22:58:46 -05:00
Christian Rahl
9eaa66f063 Tomato tomatoo, tabss or spacess 2022-01-22 22:53:32 -05:00
Christian Rahl
d91253a95b Clang 2.0 2022-01-22 22:51:19 -05:00
Christian Rahl
bf7909123c CLANG HATES ME 2022-01-22 22:45:00 -05:00