Skip to content

Commit db06ade

Browse files
teemuatlutRoxy-3D
authored andcommitted
Teensy-HAL (#6228)
* Teensy-HAL * Pins debugger HAL * Servo library type HAL * Add _ENABLE_ISRs into HAL structure * Enable UART and stepper isr only for non 32bit platforms * Make better use of the Teensy definition macros * Fix compiling with DUE
1 parent 3c33061 commit db06ade

38 files changed

+1829
-254
lines changed

.travis.yml

Lines changed: 303 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
language: c
33
#
4+
dist: trusty
5+
sudo: required
46
notifications:
57
email: false
68
#
@@ -18,12 +20,22 @@ before_install:
1820
- sleep 3
1921
- export DISPLAY=:1.0
2022
#
23+
# Teensy compiling
24+
- lsb_release -a
25+
- sudo apt-get -qq update
26+
- sudo apt-get install -y binutils-arm-none-eabi
27+
# - wget http://mirrors.kernel.org/ubuntu/pool/universe/b/binutils-arm-none-eabi/binutils-arm-none-eabi_2.24-2ubuntu2+4_amd64.deb
28+
# - sudo dpkg -i binutils-arm-none-eabi_2.24-2ubuntu2+4_amd64.deb
29+
- sudo apt-get install -y gcc-arm-none-eabi
30+
# - wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-arm-none-eabi/gcc-arm-none-eabi_4.8.2-14ubuntu1+6_amd64.deb
31+
# - sudo dpkg -i gcc-arm-none-eabi_4.8.2-14ubuntu1+6_amd64.deb
32+
#
2133
install:
2234
#
23-
# Install arduino 1.6.10
24-
- wget http://downloads-02.arduino.cc/arduino-1.6.10-linux64.tar.xz
25-
- tar xf arduino-1.6.10-linux64.tar.xz
26-
- sudo mv arduino-1.6.10 /usr/local/share/arduino
35+
# Install arduino 1.8.0
36+
- wget http://downloads-02.arduino.cc/arduino-1.8.0-linux64.tar.xz
37+
- tar xf arduino-1.8.0-linux64.tar.xz
38+
- sudo mv arduino-1.8.0 /usr/local/share/arduino
2739
- ln -s /usr/local/share/arduino/arduino ${TRAVIS_BUILD_DIR}/buildroot/bin/arduino
2840
#
2941
# Install: LiquidCrystal_I2C library
@@ -49,6 +61,32 @@ install:
4961
# Install: TMC2130 Stepper Motor Controller library
5062
- git clone https://github.com/teemuatlut/TMC2130Stepper.git
5163
- sudo mv TMC2130Stepper /usr/local/share/arduino/libraries/TMC2130Stepper
64+
65+
# Install Teensy stuff
66+
67+
- git clone https://github.com/ARM-software/CMSIS.git
68+
- sudo cp CMSIS/CMSIS/Lib/GCC/*.a /usr/lib/arm-none-eabi/lib/
69+
70+
- git clone https://github.com/teemuatlut/teensyfiles_for_marlin.git
71+
- sudo mkdir -p /usr/local/share/arduino/hardware/teensy/avr
72+
- sudo cp teensyfiles_for_marlin/*.txt /usr/local/share/arduino/hardware/teensy/avr/
73+
74+
- git clone https://github.com/PaulStoffregen/cores.git
75+
- sudo mv cores /usr/local/share/arduino/hardware/teensy/avr
76+
77+
# Teensy libraries
78+
79+
- git clone https://github.com/PaulStoffregen/Wire.git
80+
- git clone https://github.com/PaulStoffregen/SPI.git
81+
- git clone https://github.com/PaulStoffregen/Servo.git
82+
- sudo mkdir -p /usr/local/share/arduino/hardware/teensy/avr/libraries/
83+
- sudo mv Wire /usr/local/share/arduino/hardware/teensy/avr/libraries/
84+
- sudo mv SPI /usr/local/share/arduino/hardware/teensy/avr/libraries/
85+
- sudo mv Servo /usr/local/share/arduino/hardware/teensy/avr/libraries/
86+
87+
- mkdir -p /usr/local/share/arduino/hardware/tools/arm
88+
- sudo ln -s /usr/bin /usr/local/share/arduino/hardware/tools/arm/bin
89+
- sudo ln -s /usr/lib /usr/local/share/arduino/hardware/tools/arm/lib
5290
#
5391
before_script:
5492
#
@@ -239,11 +277,11 @@ script:
239277
#
240278
# Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS
241279
#
242-
- restore_configs
243-
- opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
244-
- pins_set RAMPS X_MAX_PIN -1
245-
- opt_set_adv Z2_MAX_PIN 2
246-
- build_marlin
280+
# - restore_configs
281+
# - opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
282+
# - pins_set RAMPS X_MAX_PIN -1
283+
# - opt_set_adv Z2_MAX_PIN 2
284+
# - build_marlin
247285
#
248286
# Test PRINTCOUNTER
249287
#
@@ -416,3 +454,259 @@ script:
416454
#
417455
# To be added in nightly test branch
418456
#
457+
# Backup Configuration.h, Configuration_adv.h, and pins_RAMPS.h
458+
#
459+
- restore_configs
460+
- opt_set MOTHERBOARD BOARD_TEENSY35_36
461+
- cp Marlin/Configuration.h Marlin/Configuration.h.backup
462+
- cp Marlin/Configuration_adv.h Marlin/Configuration_adv.h.backup
463+
- cp Marlin/pins_RAMPS.h Marlin/pins_RAMPS.h.backup
464+
#
465+
# Test Teensy3.5 with default config
466+
#
467+
- build_marlin_teensy35
468+
#
469+
# Test heated bed temperature sensor
470+
#
471+
- opt_set TEMP_SENSOR_BED 1
472+
- build_marlin_teensy35
473+
#
474+
# Test 2 extruders on basic RAMPS 1.4
475+
#
476+
- opt_set EXTRUDERS 2
477+
- opt_set TEMP_SENSOR_1 1
478+
- build_marlin_teensy35
479+
#
480+
# Test PIDTEMPBED
481+
#
482+
- restore_configs
483+
- opt_enable PIDTEMPBED
484+
- build_marlin_teensy35
485+
#
486+
# Test a "Fix Mounted" Probe along with Safe Homing
487+
#
488+
- restore_configs
489+
- opt_enable FIX_MOUNTED_PROBE Z_SAFE_HOMING
490+
- build_marlin_teensy35
491+
#
492+
# ...with AUTO_BED_LEVELING_LINEAR, Z_MIN_PROBE_REPEATABILITY_TEST, and DEBUG_LEVELING_FEATURE
493+
#
494+
- opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
495+
- opt_set ABL_GRID_POINTS_X 16
496+
- opt_set ABL_GRID_POINTS_Y 16
497+
- build_marlin_teensy35
498+
#
499+
# Test a Sled Z Probe
500+
#
501+
- restore_configs
502+
- opt_enable Z_PROBE_SLED
503+
- build_marlin_teensy35
504+
#
505+
# ...with AUTO_BED_LEVELING_LINEAR, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, and EEPROM_CHITCHAT
506+
#
507+
- opt_enable AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
508+
- build_marlin_teensy35
509+
#
510+
# Test a Servo Probe
511+
#
512+
- restore_configs
513+
- opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE
514+
- build_marlin_teensy35
515+
#
516+
# ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES
517+
#
518+
- opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT
519+
- opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES
520+
- build_marlin_teensy35
521+
#
522+
# Test MESH_BED_LEVELING feature, with LCD
523+
#
524+
- restore_configs
525+
- opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN MANUAL_BED_LEVELING ULTIMAKERCONTROLLER
526+
- build_marlin_teensy35
527+
#
528+
# Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER,
529+
# INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT
530+
#
531+
- restore_configs
532+
# - opt_enable M100_FREE_MEMORY_WATCHER // Compiler error!
533+
- opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT
534+
- build_marlin_teensy35
535+
#
536+
# Mixing Extruder
537+
#
538+
- restore_configs
539+
- opt_enable MIXING_EXTRUDER
540+
- opt_set MIXING_STEPPERS 2
541+
- build_marlin_teensy35
542+
#
543+
# Test DUAL_X_CARRIAGE
544+
#
545+
#- restore_configs
546+
#- opt_set EXTRUDERS 2
547+
#- opt_set TEMP_SENSOR_1 1
548+
#- opt_enable USE_XMAX_PLUG
549+
#- opt_enable_adv DUAL_X_CARRIAGE
550+
#- build_marlin_teensy35
551+
#
552+
# Test SWITCHING_EXTRUDER
553+
#
554+
- restore_configs
555+
- opt_set EXTRUDERS 2
556+
- opt_enable NUM_SERVOS
557+
- opt_set NUM_SERVOS 1
558+
- opt_set TEMP_SENSOR_1 1
559+
- opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER
560+
- build_marlin_teensy35
561+
#
562+
# Test FILAMENT_CHANGE_FEATURE and LCD_INFO_MENU
563+
#
564+
- restore_configs
565+
- opt_enable ULTIMAKERCONTROLLER
566+
- opt_enable_adv FILAMENT_CHANGE_FEATURE LCD_INFO_MENU
567+
- build_marlin_teensy35
568+
#
569+
# Enable filament sensor
570+
#
571+
- restore_configs
572+
- opt_enable FILAMENT_WIDTH_SENSOR
573+
- build_marlin_teensy35
574+
#
575+
# Enable filament sensor with LCD display
576+
#
577+
- opt_enable ULTIMAKERCONTROLLER FILAMENT_LCD_DISPLAY
578+
- build_marlin_teensy35
579+
#
580+
# Enable BEZIER_CURVE_SUPPORT, EXPERIMENTAL_I2CBUS, and I2C_SLAVE_ADDRESS
581+
#
582+
- restore_configs
583+
- opt_enable_adv BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS
584+
- opt_set_adv I2C_SLAVE_ADDRESS 63
585+
- build_marlin_teensy35
586+
#
587+
# Enable COREXY
588+
#
589+
- restore_configs
590+
- opt_enable COREXY
591+
- build_marlin_teensy35
592+
#
593+
# Enable COREXZ
594+
#
595+
- restore_configs
596+
- opt_enable COREXZ
597+
- build_marlin_teensy35
598+
#
599+
# Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS
600+
#
601+
- restore_configs
602+
- opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS
603+
- pins_set RAMPS X_MAX_PIN -1
604+
- opt_set_adv Z2_MAX_PIN 2
605+
- build_marlin_teensy35
606+
#
607+
# Test PRINTCOUNTER
608+
#
609+
- restore_configs
610+
- opt_enable PRINTCOUNTER
611+
- build_marlin_teensy35
612+
#
613+
# Test NOZZLE_PARK_FEATURE
614+
#
615+
- restore_configs
616+
- opt_enable NOZZLE_PARK_FEATURE
617+
- build_marlin_teensy35
618+
#
619+
# Test NOZZLE_CLEAN_FEATURE
620+
#
621+
- restore_configs
622+
- opt_enable NOZZLE_CLEAN_FEATURE
623+
- build_marlin_teensy35
624+
#
625+
#
626+
######## STANDARD LCD/PANELS ##############
627+
#
628+
# ULTRA_LCD
629+
#
630+
- restore_configs
631+
- opt_enable ULTRA_LCD
632+
- build_marlin_teensy35
633+
#
634+
# DOGLCD
635+
#
636+
- restore_configs
637+
- opt_enable DOGLCD
638+
- build_marlin_teensy35
639+
#
640+
# ULTIMAKERCONTROLLER
641+
#
642+
- restore_configs
643+
- opt_enable ULTIMAKERCONTROLLER
644+
- build_marlin_teensy35
645+
#
646+
# MAKRPANEL
647+
# Needs to use Melzi and Sanguino hardware
648+
#
649+
#- restore_configs
650+
#- opt_enable MAKRPANEL
651+
#- build_marlin
652+
#
653+
# REPRAP_DISCOUNT_SMART_CONTROLLER, SDSUPPORT, and BABYSTEPPING
654+
#
655+
- restore_configs
656+
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING
657+
- build_marlin_teensy35
658+
#
659+
# G3D_PANEL
660+
#
661+
- restore_configs
662+
- opt_enable G3D_PANEL SDSUPPORT
663+
- build_marlin_teensy35
664+
#
665+
# REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
666+
#
667+
- restore_configs
668+
- opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT
669+
- build_marlin_teensy35
670+
#
671+
# REPRAPWORLD_KEYPAD
672+
#
673+
# Cant find configuration details to get it to compile
674+
#- restore_configs
675+
#- opt_enable ULTRA_LCD REPRAPWORLD_KEYPAD REPRAPWORLD_KEYPAD_MOVE_STEP
676+
#- build_marlin
677+
#
678+
# RA_CONTROL_PANEL
679+
#
680+
- restore_configs
681+
- opt_enable RA_CONTROL_PANEL
682+
- build_marlin_teensy35
683+
#
684+
######## I2C LCD/PANELS ##############
685+
#
686+
# !!!ATTENTION!!!
687+
# Most I2C configurations are failing at the moment because they require
688+
# a different Liquid Crystal library "LiquidTWI2".
689+
#
690+
# LCD_I2C_SAINSMART_YWROBOT
691+
#
692+
#- restore_configs
693+
#- opt_enable LCD_I2C_SAINSMART_YWROBOT
694+
#- build_marlin
695+
#
696+
# LCD_I2C_PANELOLU2
697+
#
698+
#- restore_configs
699+
#- opt_enable LCD_I2C_PANELOLU2
700+
#- build_marlin
701+
#
702+
# LCD_I2C_VIKI
703+
#
704+
#- restore_configs
705+
#- opt_enable LCD_I2C_VIKI
706+
#- build_marlin
707+
#
708+
# LCM1602
709+
#
710+
- restore_configs
711+
- opt_enable LCM1602
712+
- build_marlin_teensy35

Marlin/Conditionals_post.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,4 +829,12 @@
829829
#define FMOD(x, y) fmodf(x, y)
830830
#endif
831831

832+
#if defined(TEENSYDUINO)
833+
#undef max
834+
#define max(a,b) ((a)>(b)?(a):(b))
835+
#undef min
836+
#define min(a,b) ((a)<(b)?(a):(b))
837+
838+
#define NOT_A_PIN 0 // For PINS_DEBUGGING
839+
#endif
832840
#endif // CONDITIONALS_POST_H

Marlin/Marlin_main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ float cartes[XYZ] = { 0 };
628628
static bool send_ok[BUFSIZE];
629629

630630
#if HAS_SERVOS
631-
Servo servo[NUM_SERVOS];
631+
HAL_SERVO_LIB servo[NUM_SERVOS];
632632
#define MOVE_SERVO(I, P) servo[I].move(P)
633633
#if HAS_Z_SERVO_ENDSTOP
634634
#define DEPLOY_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[0])
@@ -11056,6 +11056,7 @@ void setup() {
1105611056
#endif
1105711057

1105811058
MYSERIAL.begin(BAUDRATE);
11059+
while(!MYSERIAL);
1105911060
SERIAL_PROTOCOLLNPGM("start");
1106011061
SERIAL_ECHO_START;
1106111062

Marlin/boards.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#define BOARD_BRAINWAVE 82 // Brainwave (AT90USB646)
7272
#define BOARD_SAV_MKI 83 // SAV Mk-I (AT90USB1286)
7373
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: DEFINES=AT90USBxx_TEENSYPP_ASSIGNMENTS HARDWARE_MOTHERBOARD=84 make
74+
#define BOARD_TEENSY35_36 841 // Teensy3.5 and Teensy3.6
7475
#define BOARD_BRAINWAVE_PRO 85 // Brainwave Pro (AT90USB1286)
7576
#define BOARD_GEN3_PLUS 9 // Gen3+
7677
#define BOARD_GEN3_MONOLITHIC 22 // Gen3 Monolithic Electronics

0 commit comments

Comments
 (0)