Commit graph

191 commits

Author SHA1 Message Date
3DSmitty 5b13abcacb Fix SPI_SD Outside of HAL_STM32F1 (#14306) 2019-06-18 02:38:18 -05:00
Scott Lahteine 651f3eeed0 Clean up trailing whitespace 2019-06-17 20:22:07 -05:00
Tanguy Pruvot 287df7a61f STM32F1: various small changes
- init the led pin as output (like other HALs)
- reduce sdio dma priority to normal.. highest is never the best...
- allow fsmc only on compatible STM32F1 (like HAL fsmc)
- fsmc: remove an useless C style cast
2019-06-17 10:27:30 +02:00
3DSmitty 66d51272af Fix SPI, SD for BIGTREETECH SKR Mini (#14287) 2019-06-15 18:12:05 -05:00
Tanguy Pruvot 7d1eafc80a STM32F1: C++14 for static_assert, etc. (#14278) 2019-06-12 18:44:32 -05:00
Msq001 26e7e33698 Fix bug in STM32F1 WRITE macro (#14275) 2019-06-12 06:30:24 -05:00
Tanguy Pruvot c3e5225531 Add SPI EEPROM to STM32F1 (#14239) 2019-06-10 23:30:23 -05:00
Tanguy Pruvot 764f0d9c1c STM32F1: Servo "soft" PWM via timer interrupt (#14187) 2019-06-07 07:11:48 -05:00
Tanguy Pruvot e3a468f2cd STM32F1: FSMC only on chips with 100/144 pins (#14180) 2019-05-30 15:51:02 -05:00
Tanguy Pruvot 24b1818245 Secure STM32F1 servo code and M280 detach (#14085) 2019-05-22 16:57:19 -05:00
Giuliano Zaro a74aad3b4a Clean up HALs / FastIO (#14082) 2019-05-21 18:28:12 -05:00
Tanguy Pruvot 402f1f7307 STM32F1: STM32_HIGH_DENSITY is auto defined in HAL (#14057)
- Fix the `fsmc` and `sdio` units which required hard defines for use.
2019-05-18 20:45:22 -05:00
Tanguy Pruvot 256f810df2 Add open-drain output mode to STM32F1 FastIO (#14050)
- This mode is often used/preferred to drive printer boards' MOSFETs.
- Can generally boost the allowed output power (for hotbed,nozzle and fans).
2019-05-18 16:12:00 -05:00
Scott Lahteine 0b056970c6 Fix file.open in STM32 eeprom emu 2019-05-17 18:26:53 -05:00
Tanguy Pruvot d7b0369e39 STM32: Fix SD EEPROM emulation conflict (#14012) 2019-05-15 02:42:10 -05:00
Tanguy Pruvot 8075893352 STM32: fix sdcard filename conversion 2019-05-12 04:26:21 +02:00
Tanguy Pruvot 93dd097b1c Use E2END, if defined, for STM32F1 (SD) (#13981) 2019-05-11 18:22:31 -05:00
Tanguy Pruvot 62b36d1b98 Fix STM32 timer warnings (#13946) 2019-05-10 20:00:21 -05:00
Scott Lahteine ad4ffa1d2f
Use C++ language supported 'nullptr' (#13944) 2019-05-09 11:45:55 -05:00
Tanguy Pruvot e53d7e5517 STM32: ADC warning fix (#13933) 2019-05-09 00:33:38 -05:00
Tanguy Pruvot a4c24511f7 STM32: Fix Marduino SBI/CBI redefine (#13912) 2019-05-05 22:06:30 -05:00
Scott Lahteine e7682eea42
Use Arduino.h include wrapper (#13877) 2019-05-02 00:45:50 -05:00
Scott Lahteine c8a83fb122 SPINDLE_LASER_ENABLE => SPINDLE_LASER_ENA 2019-04-08 18:13:41 -05:00
Alexander Gavrilenko 6d9aaca082 Fix compilation error for MKS Robin (#13506) 2019-03-29 12:40:24 -05:00
Alexander Amelkin e40636a7c1 Replace digitalPinHasPWM with HAS_TIMER (#13520) 2019-03-29 12:21:14 -05:00
Chris Pepper ffc2c2d7c5 Move FAST_PWM_FAN code to HALs (#13491) 2019-03-26 01:03:23 -05:00
pinchies ef3b93daa1 Fix STM32F1 SD-based EEPROM emulation (#13475)
If `openFile` is given `true`, then it has read-only access. Because all the writing occurs on the next line, this breaks SD card as EEPROM.
2019-03-24 20:07:31 -05:00
Scott Lahteine 380c771988 Handle word-padded flash-based eeprom (STM32F1)
Fix #13445
2019-03-24 19:14:04 -05:00
Scott Lahteine 49cf92dc36
Extended condition macros (#13419)
Allow `ENABLED`, `DISABLED`, `PIN_EXISTS`, and `BUTTON_EXISTS` to take multiple arguments. Also add:
- Alias `ANY(...)` for `!DISABLED(...)`
- Alias `ANY_PIN(...)` for `PIN_EXISTS(a) || PIN_EXISTS(b) ...`
- Alias `EITHER(A,B)` for `ANY(...)`
- Alias `ALL(...)` and `BOTH(A,B)` for `ENABLED(...)`
- `NONE(...)` for `DISABLED(...)`
2019-03-16 23:43:06 -05:00
Scott Lahteine 67bee06e43 No patch needed for non-libmaple analogWrite
See https://github.com/pinchies/Marlin/pull/1#issuecomment-471388743
2019-03-13 07:21:10 -05:00
Scott Lahteine f89b375fb9
Fixes and improvements for PWM pins (#13383) 2019-03-13 06:51:15 -05:00
Scott Lahteine 6214c997c0 Remove includes of <binary.h> 2019-03-13 05:32:33 -05:00
Scott Lahteine 51ff5b68fa Clean up fastIO ahead of PWM patch 2019-03-12 20:39:55 -05:00
jmz52 013bb469ca Fix compilation for STM32F1 with no SDIO (#13366) 2019-03-11 16:40:51 -05:00
Scott Lahteine 1f7e220387 Make HAL ISR macros function-like 2019-03-10 20:44:27 -05:00
Scott Lahteine 77b4176152 Use lib include for bit_constants.h 2019-03-10 19:09:28 -05:00
pinchies 4c43e6c48b Fix "spontaneous heating" issue (WRITE bug) on STM32 (#13356)
Should fix "spontanous heating" problems due to order of operations error. Error occurs at least with ststm32 v5.1.0 in PlatformIO.
2019-03-10 17:25:54 -05:00
Msq001 fb3302feda Fix STM32F1 Serial and ADC pins (#13331) 2019-03-08 02:21:32 -06:00
Scott Lahteine 44571775bd Further support for 6 extruders 2019-03-07 01:00:56 -06:00
Scott Lahteine 2212da453a
Distinguish between analog/digital auto fans (#13298) 2019-03-05 00:41:31 -06:00
Scott Lahteine 4200f9ed62 Hide freeMemory et.al. warnings 2019-02-26 18:03:00 -06:00
Scott Lahteine 631d867dc9 HAL cleanups 2019-02-20 06:27:26 -06:00
Scott Lahteine 3a1b6fe8c1 Coding standards 2019-02-19 14:58:39 -06:00
Scott Lahteine 0feeef2604 Update copyright in headers 2019-02-12 15:30:11 -06:00
Scott Lahteine d9a3fea022 Comments in HAL_spi_STM32F1.cpp 2019-02-11 18:06:33 -06:00
Scott Lahteine 8f9b246d0e Tweak some formatting, replace tabs 2019-01-24 13:18:56 -06:00
Scott Lahteine 3e867008f0 Fix some HAL_STM32F1 type declarations 2019-01-12 16:21:11 -06:00
InsanityAutomation a403d9a50c Improve menu pause / resume (#12876) 2019-01-11 20:42:11 -06:00
jmz52 d372e7e477 SDIO support for STM32F1 (#12782) 2019-01-04 13:38:07 -06:00
jmz52 813a4ea107 Add support for Mks Robin TFT display (#12706)
* Add support for MKS Robin TFT display

- Add support for MKS Robin TFT display and encoder for MKS Robin board.
- Generic 128x64 UI with x2 upscale is used (for now).
- Tested on MKS Robin TFT V2.0 with ST7789V controller.
2019-01-03 10:38:39 -06:00
jmz52 c4237b529f Fix MKS Mini and SD card conflct over SPI mode (#12783) 2019-01-03 10:27:53 -06:00
Phr3d13 01f75591c6 Fix GTM32_PRO_VB Serial and HAL via watchdog (#12753)
Move `watchdog_reset` from `.h` to `.cpp` to eliminate the need to include `MarlinConfig.h` in a HAL-related file.
2019-01-03 09:46:49 -06:00
Reece Kibble 7557f8d68c Rename all Stm32f1 to STM32F1 (#12639) 2018-12-31 16:36:49 -06:00
jmz52 33abb86b7e Add support for MKS Robin board (#12650)
Implement initial support for MKS Robin (STM32F103ZET6) board.
Custom build script is used to generate encrypted firmware compatible with original MSK Robin bootloader (i.e. safe firmware update from SD card and possibility to go back to original close-source firmware).
2018-12-20 17:23:27 -06:00
Scott Lahteine 66580f32c2
Make CardReader class static (#12451)
* Make CardReader a static class
* Make CardReader flags into bitfields
2018-11-16 22:39:16 -06:00
Scott Lahteine b3b4e6dc45
Change Marlin debug flag names to fix conflicts (#12340)
In reference to #11000
2018-11-05 22:48:28 -06:00
Scott Lahteine f5eab912ed
Apply #pragma once, misc cleanup (#12322)
* Apply #pragma once in headers
* Adjust some thermistors formatting
* Misc cleanup and formatting
2018-11-04 02:25:55 -06:00
Scott Lahteine 0bd54392b7 Use uint8_t in EEPROM code 2018-10-09 19:00:01 -05:00
Nils Hasenbanck 191df5e17d Correct PWM_PIN behavior for STM32 HALs (#12027) 2018-10-07 17:08:01 -05:00
Scott Lahteine 33056046a3
STM32 non-generic PWM_PIN and USEABLE_HARDWARE_PWM (#12016) 2018-10-06 00:14:12 -05:00
Alexander Amelkin 2ecfda80ac Improve support for JTAG/SWD pins reuse (#11963)
STM32 can reuse JTAG and SWD pins separately. Add `DISABLE_DEBUG` option to disable both interfaces and retain `DISABLE_JTAG` to disable JTAG only.
2018-09-29 19:00:49 -05:00
Scott Lahteine ad21a4f07b Tweaks to HAL format and order 2018-09-28 15:59:50 -05:00
Alexander Amelkin 84926b1d5a HAL general support for DISABLE_JTAG option (#11211)
Some STM32-based boards may use multiplexed JTAG pins as IO. Up to now the `DISABLE_JTAG` option (defined in pins files) was only supported for AT90-based boards. This commit generalizes the code and adds support for boards based on STM32F1 and STM32F4.
2018-09-27 19:02:50 -04:00
Holger Müller 1a6f2b29b8 Add support for Triple-Z steppers/endstops 2018-09-16 00:35:58 -05:00
Alexander Amelkin f417408df1 [STM32F1] Fix HAL for new PlatformIO (#11749) 2018-09-07 18:15:32 -05:00
Scott Lahteine 6a3207391f Remove obsolete HAL_timer_restrain 2018-08-31 16:17:22 -05:00
jmz52 a77f8c6dd5 Implement servo support for STM32F1 (#11580)
Implement servo support for STM32F1. Original code was incomplete and depended on Servo library from stm32duino which conflicts with `module/servo.h`.
2018-08-20 21:13:51 -05:00
jmz52 dfe18ac633 Fix compilation error for STM32F1 with U8GLIB_SSD1306 or U8GLIB_SH1106 enabled (#11583)
The `binary.h` file required by `lcd/dogm/dogm_bitmaps.h` is not present in stm32duino environment. Binary macros are defined in `bit_constants.h` in stm32duino framework.
2018-08-20 20:37:56 -05:00
jmz52 0b2d686160 Fix "SD init fail" problem for STM32F1 (#11579)
Fix "SD init fail" problem for STM32F1 caused by incorrect SS pin state and incorrect SPI mode. Issue #11225
2018-08-17 23:27:10 -05:00
Scott Lahteine 834ea7fcea Remove 'const' from PersistentStore::capacity 2018-08-14 04:46:10 -05:00
Dave Johnson c64199941e Compile only selected PIO environment (#11519) 2018-08-14 03:28:52 -05:00
Scott Lahteine 865ee5985f Followup persistent store with heading, const 2018-08-13 23:55:33 -05:00
Chris Pepper 66d2b48b59 Update PersistentStore api (#11538)
- Clean up the API to use a `static` class instance to adhere to Marlin convention
- Add `const` position data access for read/write
- Add Storage capacity to the interface
2018-08-13 17:30:25 -05:00
Andy Shaw 624986d423 Ensure ADC conversion is complete before reading (#11336)
The current Marlin implementation relies on a timer interrupt to start the ADC conversion and read it. However in some circumstances the interrupt can be delayed resulting in insufficient time being available for the ADC conversion. This results in a bad reading and false temperature fluctuations. These changes make sure that the conversion is complete (by checking the ADC hardware via the HAL) before reading a value.

See: https://github.com/MarlinFirmware/Marlin/issues/11323
2018-07-26 03:59:19 -05:00
Scott Lahteine d05e832f29 Add STM32F1 support for SD-based EEPROM 2018-07-06 23:45:47 -05:00
Alexander Amelkin ffdbc1f42c STM32F1: Fix SD card persistent store API (#11090) 2018-06-26 14:41:23 -04:00
Scott Lahteine 99591dc20c
Filter endstops state at all times (#11066) 2018-06-21 20:14:16 -05:00
etagle a215725df6 Fix stepper pulse timing
Always honor minimum period on stepper pulse generation, and fix timing calculations

Signed-off-by: etagle <ejtagle@hotmail.com>
2018-06-12 21:34:24 -05:00
Scott Lahteine cf53e502a2 No need to set input after attachInterrupt 2018-06-12 18:43:11 -05:00
Karl Andersson e0276d2f32 Official STMicroelectronics Arduino Core STM32F4 HAL compatibility (#11006) 2018-06-12 18:38:00 -05:00
Scott Lahteine 4dbec774b5 HAL_*_TIMER_RATE => *_TIMER_RATE 2018-06-12 16:39:12 -05:00
Scott Lahteine 9b945c13a1 Fix STM32F1 ISR_ENABLED 2018-06-11 22:09:45 -05:00
Alexey Shvetsov 2ddba201c0 STM32F1 HAL Fixes (#10999)
- Enable / disable interrupts with `__iSeiRetVal` / `__iCliRetVal`
- Add STM32F1 to Travis CI tests
2018-06-11 20:00:56 -05:00
Scott Lahteine a426986df8
Ensure pins set to INPUT after attachInterrupt (#10928) 2018-06-06 20:59:08 -05:00
Eduardo José Tagle d3c02410a8 [2.0.x] Small assorted collection of fixes and improvements (#10911)
* Misc fixes and improvements

- Get rid of most critical sections on the Serial port drivers for AVR and DUE. Proper usage of FIFOs should allow interrupts to stay enabled without harm to queuing and dequeuing.
  Also, with 8-bit indices (for AVR) and up to 32-bit indices (for ARM), there is no need to protect reads and writes to those indices.
- Simplify the XON/XOFF logic quite a bit. Much cleaner now (both for AVR and ARM)
- Prevent a race condition (edge case) that could happen when estimating the proper value for the stepper timer (by reading it) and writing the calculated value for the time to the next ISR by disabling interrupts in those critical and small sections of the code - The problem could lead to lost steps.
- Fix dual endstops not properly homing bug (maybe).

* Set position immediately when possible
2018-06-01 19:02:22 -05:00
Scott Lahteine cbcb284f4a Allow libServo::attach to work on Teensy 3.5/3.6 2018-05-28 20:56:24 -05:00
Scott Lahteine 9b9b62b218 delay(SERVO_DELAY) => safe_delay(servo_delay[servo_index]) 2018-05-28 03:44:32 -05:00
etagle 569df3fc0c Fix interrupt-based endstop detection
- Also implemented real endstop reading on interrupt.
2018-05-20 07:10:24 -05:00
Scott Lahteine 37b15fe4cf Reorder HAL timer header items 2018-05-13 16:50:39 -05:00
Scott Lahteine 99ecdf59af Smarter MIN, MAX, ABS macros
Use macros that explicitly avoid double-evaluation and can be used for any datatype, replacing `min`, `max`, `abs`, `fabs`, `labs`, and `FABS`.

Co-Authored-By: ejtagle <ejtagle@hotmail.com>
2018-05-13 04:52:56 -05:00
Scott Lahteine 81b632c255 Additional temp-oriented improvements 2018-05-02 08:43:22 -05:00
nightdemonx e911635fb1 Add thermocouple with AD8495 support 2018-05-02 08:43:16 -05:00
Scott Lahteine 456cf971af HAL FastIO cleanup and fixes 2018-04-26 00:40:16 -05:00
J.C. Nelson 5b5e322356 Set Interrupt Priorities and Grouping for STM32F103. (#10517) 2018-04-26 00:21:16 -05:00
Eduardo José Tagle c1e5ebbc1e [2.0.x] AVR: Atomic bit set and clear of upper pin ports without critical section (#10502)
* AVR: Atomic bit set and clear

The critical section can be dropped, saving 3 cycles per access. Also simplified pin toggling for all ports.
2018-04-24 13:45:43 -05:00
Scott Lahteine a3ce8a3fcd Add sanity checks for EMERGENCY_PARSER 2018-04-24 09:24:26 -05:00
Eduardo José Tagle 0c428a66d9 Proper AVR preemptive interrupt handling (#10496)
Also simplify logic on all ARM-based interrupts. Now, it is REQUIRED to properly configure interrupt priority. USART should have highest priority, followed by Stepper, and then all others.
2018-04-23 22:05:07 -05:00
Scott Lahteine cb46cb8480
Add HAS_HEATED_BED conditional (#10495) 2018-04-23 17:13:01 -05:00
Chris Pepper cc6d41e1d3 Use a macro for HAL header redirection (#10380) 2018-04-12 20:25:08 -05:00
Scott Lahteine 44a697ab04 Set STM32F1 TEMP_TIMER_FREQUENCY to 1K
Responding to https://github.com/MarlinFirmware/Marlin/pull/8833#issuecomment-379426803
2018-04-08 01:08:05 -05:00