Commit Graph

36 Commits

Author SHA1 Message Date
Ben V. Brown
6cc8b8184e WiP Thermal rewrite 2024-12-22 12:32:21 +11: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
Ben V. Brown
ec5f07ec0c Cleanup make includes and formatting rules (#1860)
* Draft cleanup of the folder definition mess

* Move old startup

* Fixup! broken hacky includes

* Update Makefile

* Update Makefile

* Update Makefile

* Bulk format

* Who knew, header guards are a wise idea

* Squash some sizing warnings

* Drop broken usb stack

* Fix BLE headers to be sensible

* Cleaning up proper c styling

* We have newer clang, it does bracketing now

* Run clang-format brackets

* We can drop the old messy bracket-checker with newer clang format

* WiP formatter

* Align grids of scripts by right side

Massively easier to read in nearly all cases

* Excempt the table for compression from formatter
2023-12-27 09:23:12 +11:00
Ben V. Brown
c308fe8cc2 Pinecil v2 tune via PID (#1827)
* Start PWM after adc irq fully done

* Filter len 4

* Use comparitor 2 on timer for wrap around

* Update IRQ.cpp

* Tip measurements are uint16_t

Update BSP.cpp

Update BSP.cpp

* WiP PID

move pid tuning to config

Update PIDThread.cpp

* Handle PWM Timer gitchy comparitor

* Tuning

* Dampen with Kd

* Cleaning up

* Use TemperatureType_t for getTipTemp()

* Add small rolling average to user GUI temp to reduce flicker

* Trigger PID when adc is skipped (will use old values)
2023-10-21 08:21:08 +11:00
Ben V. Brown
c0a5e244b9 Temperature code updates (#1814)
* Create a typedef for temperatures

* Quick parse replace temp types

* Fixup for fast/slow PWM on PinecilV2

* Update PIDThread.cpp

* Pinecil small tips need less smoothing

* Remove incorrect comment

* Remove unused function

* Update PinecilV2 Tune as well
2023-09-22 10:19:50 +10:00
Ben V. Brown
e7bcf920ba Refactor PinecilV2 Tuning
Closes #1688
2023-06-04 12:13:26 +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
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
Ben V. Brown
dd239375b1 All Ticks as the right TickType
Update usb-pd
2022-07-25 16:45:29 +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
a461577ee2 Update PIDThread.cpp
Should use osDelay to be scheduler safe
2022-02-05 10:23:42 +11:00
Ben V. Brown
c38dfb6007 Dont wrap negative deltas 2022-02-05 09:59:45 +11:00
Ben V. Brown
ed374ffb57 Update PIDThread.cpp 2021-09-15 21:55:43 +10:00
Ben V. Brown
bfca4c9336 Better limiter in the PID 2021-09-15 19:05:11 +10:00
Ben V. Brown
6989f10829 Remove old PID 2021-09-15 18:54:11 +10:00
Ben V. Brown
ad857a08ab QC code does not get control of vin filter 2021-09-14 22:01:10 +10:00
Ben V. Brown
0f3aff6619 Cleaning up new PID 2021-09-14 21:52:10 +10:00
Ben V. Brown
159ae7a8e2 Rough pass new PID 2021-09-12 20:59:40 +10:00
Ben V. Brown
416af2ff70 Refactor PID inner core out 2021-09-12 20:44:09 +10:00
Ben V. Brown
c99d6b731e Update PIDThread.cpp 2021-09-12 20:37:05 +10:00
Ben V. Brown
9c3cc12726 Update PIDThread.cpp 2021-09-12 20:10:09 +10:00
Ben V. Brown
3165fbe592 Pull out PID irrelevant filters 2021-09-12 20:06:12 +10:00
Ben V. Brown
3220fdeeff Update PIDThread.cpp 2021-09-12 19:56:27 +10:00
Ben V. Brown
55a2cb3f24 Merge branch 'master' into refactor-adc 2021-09-12 19:18:58 +10:00
Ben V. Brown
eb2a748e3f Pass one settings refactor 2021-09-12 13:31:03 +10:00
Ben V. Brown
af0adb0708 Reworking raw adc, handle temp done
Pre seed adc values

Pinecil port

Update PIDThread.cpp

TRGO is more stable for timing (buffered)?
2021-09-11 22:25:57 +10:00
Ben V. Brown
966f4d732d Approx thermal runaway config 2021-06-06 08:14:40 +10:00
Ben V. Brown
293c09cffa Add slew rate to the PID output for MHP 2021-05-06 21:35:43 +10:00
Ben V. Brown
ee12c99d9e Update PD to support awareness of having inductor for DCDC op
+ fix voltage divider to be more on point
+ Create adjustment for thermal mass causes overshoot
2021-05-03 22:36:25 +10:00
Ben V. Brown
7a5c0ad20f Updated cold junction temp curve
* Disabled the hack off on temp as we dont need it for MHP30
* faster ADC on MHP30
2021-05-02 15:45:45 +10:00
Devydd
c13991cd25 Add user-adjustable "time between Power Pulses" and "Power Pulse duration" 2021-03-16 01:15:05 +01:00
Ben V. Brown
7fbfde7b33 Correct a few missed time values from the tick rate change (#874)
* Pass over all refs to xTaskGetTickCount()

* That wasn't a second 😓

* Update FreeRTOSConfig.h

* Fix warning in usb code; style; fix slow description
2021-03-15 21:01:09 +11:00
Ben V. Brown
1f6a3ad167 Pinecil uart (#830)
* Creating uart debug handler

* Simpler get raw uV tip

* Update Setup.cpp

* Debug out working. Moved Logo

Need to update docs around logos before merging this in

* Add in current pwm level + fix signed int

* Update moving logo page for pinecil by 64k

* Update TipThermoModel.h
2021-02-02 19:53:19 +11:00
Ben V. Brown
f786901da0 Formatting the C/C++ files 2021-01-17 10:48:52 +11:00
Ben V. Brown
184b2c909f ./workspace/TS100 -> ./source/ 2021-01-17 09:43:55 +11:00