1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 10:06:13 +01:00
Commit Graph

98 Commits

Author SHA1 Message Date
Harald Barth
76c5608181 Protect port registers from change during interrupt code in differnet way 2022-08-09 13:12:04 +02:00
pmantoine
17bdd2d724 Teensy build support, STM32F411RE first beta 2022-08-06 16:53:14 +08:00
Harald Barth
33327d14c9 Current reading for ACK and overload on ESP32 2022-08-02 21:49:16 +02:00
Harald Barth
863f2f4a85 eliminate resetsCounterP/setResetCounterPointer and replace with isProgTrack/makeProgTrack method 2022-08-02 15:36:51 +02:00
Asbelos
385afdeb6c Merge remote-tracking branch 'origin/TrackManager_SAMD' into PORTX_HAL 2022-07-07 10:02:28 +01:00
Asbelos
06d1040da0 Merge remote-tracking branch 'origin/SAMD_Integration_PMA' into PORTX_HAL 2022-07-06 17:13:59 +01:00
Harald Barth
6687c6f46d when brake pin has inverted sense, honor that when running in DC mode as well 2022-07-04 23:15:02 +02:00
Harald Barth
9a98d10a86 rename fakePORT* to shadowPORT* 2022-06-13 23:18:10 +02:00
Harald Barth
4833eaac65 move all arch dependent port register declarations to MotorDriver.h 2022-06-13 23:15:35 +02:00
Harald Barth
7fba96417f Merge branch 'TM_nofloat' into TM-mergetest 2022-06-11 22:14:56 +02:00
Harald Barth
4297ed5572 remove global usePWM flag 2022-06-11 20:09:21 +02:00
Harald Barth
62e471606d remember the base case 2022-06-07 00:18:48 +02:00
Harald Barth
0ab96d28c4 make compile on Uno 2022-06-06 23:45:28 +02:00
Harald Barth
b24f6b27c6 protect setSignal() changes in setDCSignal from being changed back during interrupt vis setDCCSignal 2022-06-06 23:14:35 +02:00
Asbelos
2b2012ef1d float memory saver 2022-06-06 17:37:23 +01:00
Harald Barth
79ef114c0d protect from setting unused pin 2022-05-21 09:51:38 +02:00
pmantoine
6135272c32 SAMD Support Initial Patches 2022-05-17 18:06:08 +08:00
Harald Barth
d7a17b10b4 use ugly macros to make PORTX code portable 2022-05-13 00:05:25 +02:00
Harald Barth
af0d381e45 shadow PORTX (PoC) 2022-05-10 23:42:21 +02:00
Harald Barth
4a56998553 inline setSignal ; bugfix HA switching code by doing clearPWM 2022-05-10 23:37:24 +02:00
Harald Barth
7a2fd90bfc set the reset packet counter of the prog track to 0 every time the track is turned on 2022-04-30 23:24:51 +02:00
pmantoine
5dfc014f49 Some useful code plug debug goo 2022-04-05 09:24:29 +08:00
Asbelos
ece342f037 DC power fix 2022-03-31 22:19:13 +01:00
Asbelos
7dd680ccd5 Brake fix 2022-03-31 10:03:27 +01:00
Asbelos
99c7ff6c3f EXPERIMENTAL vpin for motorDriver power
No need to use fastpin for power, so we can allow a remoted vpin which helps when TrafficManger is running short of pins
2022-03-23 12:30:21 +00:00
Asbelos
678cccbd95 Add DC signal generation code. 2022-03-02 15:34:01 +00:00
Asbelos
6fc223d80b Timer stuff with incomplete teensy 2022-03-01 12:52:25 +00:00
Asbelos
74bbe595fc DC hooks
still requires pin jiggling
2022-02-23 16:21:45 +00:00
Asbelos
1afb4753ec Cleaner ack check
And drop CPU specific stuff no longer needed.
2022-02-23 16:03:15 +00:00
Asbelos
a7740d652d It builds....
massive track reorganization
2022-02-23 15:44:34 +00:00
Harald Barth
8af74f7082 protect analog read with cli() 2022-01-30 23:56:16 +01:00
Harald Barth
d45585ce3d update copyright notes 2022-01-07 02:28:35 +01:00
Harald Barth
434c292fd9 typo 2022-01-07 00:11:29 +01:00
Mike S
dd97c4ba49 Some additional fixes for typos. 2021-03-30 18:11:22 -04:00
Mike S
c70ef3ffaa Final Fix for T4 interrupts 2021-03-30 16:12:47 -04:00
Mike S
f5cdd88854 Cleanup of extra commented lines 2021-03-29 15:06:06 -04:00
Mike S
8839eb293c Update for T3.x to use SREG analogReads.
Still a bunch of commented out code but its a start.
2021-03-29 13:00:56 -04:00
Mike S
136e993418 Changed to Continuous analogReads for Teensy 2021-03-27 07:17:47 -04:00
Asbelos
85a2b9231b <* *> wrapped diags
And lots of \n cleanups.
2021-03-25 14:23:38 +00:00
Fred
d7b2cf3d76
Assorted bits (#138)
* LCN

* Prevent deprecated compiler warning

* Implement huge function numbers

* new commands

<! [cab]> forget locos.
<9> ESTOP ALL.
<D RESET> reboot arduino

* Waveform accuracy msg

* Drop post-write verify

* UNUSED_PIN current measure

and callback -2 for cv actions.

* Correct diags

* ESTOP a forget loco

* ESTOP loco on forget

* Avoid compiler warning

* current sensor offset

* Restore <1 JOIN> after prog track operation

* <!> ESTOP <-> FORGET

* Auto current offset detection

* manage current offset and diagnostics

* neater msg at startup

* Add startup message to LCN master

* DCC::setJoinRelayPin

Co-authored-by: Asbelos <asbelos@btinternet.com>
2021-03-23 10:37:05 -04:00
Fred
4861e592c7
Nano every2 (#129)
* Start adding back unowifi stuffz

* Uno Wifi compiling

* Fixes for compile arduino unowifi r2

* FlasString and Timers for Uno Wifi

ALL these changes should be portable back to master

* Remove extra timer that was already added

* Changed to EveryTimerB

* Add everytimerb.h

* Cleanup

* Linear address <a> cmd

* Allow lower case keywords

* Add the F define to be on safe side if it is not present in the library core code

* Clean simple Timer interface

Removes overkill files, puts all timer in a single small file. (DCCTimer)

* Timer port

* Timer working

And slow wave command removed

* Correcting non-portables merged from master

* Wave-state machine ( part 11)

* Microtuning waveform

Significant reduction in code paths and call overheads

* Current check cleanup

* Fix no-loco id

Has to handle -1 correctly

* fix wrong format letter

* redo flow through wifisetup again

* version++

* bugfixes wifi setup

* Retry harder for AP mode

* Remove unued if

* DIO2 replacement

Currently for writing signal pins during waveform.

* Drop analogReadFast (see DCCTimer)

AnalogRead speed set in DCCTimer for ease of porting.
Code tidy and diagnostics in MotorDriver

* UNTESTED fast power,brake,fault pins

* Distunguish between in/out of FASTPIN

* minor performance tweaks

* Config comments and example use

* Config/example loading

* IP/PORT on LCD

* Ethernet simulated mac

Plus fixed listening port

* Github SHA

* Committing a SHA

* Fix for nano compile

* Comments and a reliability fix.

* UnoRev2 protection

* PWM pin implementation

* fix wifi setup issue

* Reinstate IP_PORT

* Wifi channel and code cleaninga

* Reduce duplicated F() macros

Compiler isn't as clever as one might expect

* Committing a SHA

* Update config.example.h

Add comment to wifi channel section

* Committing a SHA

* Handle shields with common fault pins (Pololu)

* Committing a SHA

* remove warning

* Committing a SHA

* only do the sha generation on master

* yaml syntax

* Fast SSD1306 OLED driver

Incorporate code from SSD1306Ascii library to speed up OLED screen updates, reduce memory requirements and eliminate some library dependences.

* Fix auto-configure from cold boot.

Add call to Wire.begin().

* Update comment for OLED_DRIVER define.

* Update MotorDrivers.h

Add a motor board definition for using the IBT_2 board for a high current to the main track and keep the Arduino Motor Shield for operating the programming track.

* Committing a SHA

* Fix missing F  in motor drivers

* JOIN relay pin

* Swap Join Relay high/low

* Hide WIFI_CONNECT_TIMEOUT

This is not what the config suggests it is...  The timeout is in the ES and defaults to 15 seconds. Abandoning it early leads to confused setup.

* Enhance OLED/LCD speed

Write one character or position command per loop entry so as not to hold up the loop.  Add support for SH1106 OLED as 132x64 size option.

* Enhance OLED/LCD speed

* Delete comment about OLED on UNO.

* Trim unwanted code

* Handle display types correctly

* Update comments

* Speed up OLED writes

Add new flushDisplay() to end any in-progress I2C transaction.  Previously, an redundant command was sent that ended the in-progress transaction but also sent another complete, but unnecessary, transaction.

* Comments and copyright update

* Reduce RAM and flash requirement a few more bytes.

* Move statics into LCDDisplay class, and reduce RAM.

Some state variables were static in LCDDisplay.write().  Moved to class members.  Also, types of data items like row, column & character position changed to int8_t to save a few bytes of RAM.

* Type lcdCols and lcdRows to unsigned.

Since lcdCols is normally 128, it needs to be uint8_t, not int8_t.

* remove timeout from user config

* faultpin is common only if it exists ; make code prettier

* Rationalisation of SSD1306 driver

Merge SSD1306AsciiWire.cpp into SSD1306Ascii.cpp and rename SSD1306AsciiWire.h as SSD1306Ascii.h.
Merge allFonts.h into System5x7.h and rename as SSD1306font.h.
Move all SSD1306 files into root folder to facilitate compilation in Arduino IDE.

* Fix some font attributes as const.

* Remove unused initialisation sequences for tiny oled screens

* Add m_ to variables

* Bump up I2C speed

Speed was 100kHz (default).  Max for OLEDis 400kHz.

* Revert "Bump up I2C speed"

This reverts commit 1c1168f433.

* Bump up I2C speed

Speed was 100kHz (default). Max for OLEDis 400kHz.

* Drop duplicate DIAG

* ignore mySetup.h files

* Restore uno to default_envs

Restore uno (previously commented out) to default_envs.

* Update objdump.bat

Allows other editors as Notepad is very slow on large files

* Prog Track overload during cv read

* Faster LCD Driver

Extract LCD driver from library;
Trim unused functionality;
Reduce I2C communications to minimum;
Speed up I2C clock to 400kHz.

* Update config.example.h

Add IBT_2_WITH_ARDUINO to example config

* Update config.example.h

* Screen enhancements (#126)

* Add I2CManager to coordinate I2C shared parameters.

* Add use of I2CManager, and experimental scrolling strategies.

New scrolling capability by defining SCROLLMODE in Config.h to 0 (original), 1 (by page) or 2 (by line).  If not defined, defaults to 0.

* Scrolling updates

New scrolling capability by defining SCROLLMODE in Config.h to 0 (original), 1 (by page) or 2 (by line). If not defined, defaults to 0.
Reformat.

* Add I2CManager calls. Remove unnecessary delays.

* Add I2CManager calls, remove unnecessary I2C delays.

* SSD1306: Move methods from .h to .cpp and reformat.

* Fix compiler warning in LiquidCrystal_I2C

* Allow forcing of I2C clock speed.

New method forceClock allows the I2C speed to be overridden.  For example, if the I2C bus is long then the speed can be forced lower.  It can also be forced higher to gain performance if devices are capable.

* Make Config.h conditionally included.

Allow for non-existence of Config.h.

* Correct scrolling and allow longer messages

Correct the handling of scrolling in scrollmode 1 to avoid a blank page being displayed.  Also, allow MAX_MSG_SIZE to be optionally configured to override maximum message length on screens.

* compiler warning on uno

Co-authored-by: dexslab <dex35803@gmail.com>
Co-authored-by: Asbelos <asbelos@btinternet.com>
Co-authored-by: Harald Barth <haba@kth.se>
Co-authored-by: Neil McKechnie <neilmck999@gmail.com>
Co-authored-by: Neil McKechnie <75813993+Neil-McK@users.noreply.github.com>
2021-03-07 15:58:35 -05:00
Harald Barth
d248cccf81 special treatment for Pololu board 2020-11-01 10:16:29 +01:00
Harald Barth
5ad396fbf4 fix indent 2020-10-31 11:27:29 +01:00
Harald Barth
7a5b84ef18 handle motorboards with invereted brake pin (like pololu) 2020-10-31 11:26:23 +01:00
Harald Barth
c14596a252 current trip values on PROG depending on state 2020-09-27 12:14:25 +02:00
Asbelos
da7275d9a4 Motor drivers tested 2020-08-17 15:30:25 +01:00
Asbelos
cdcb01d300 Compiled motorDriver
New motorDriver design...
2020-08-15 11:32:32 +01:00
Asbelos
ddc3917519 stash incomplete 2020-08-14 22:54:12 +01:00