Bump to head with stepper delay and M851XY

This commit is contained in:
InsanityAutomation
2019-09-17 21:08:53 -04:00
parent b3e7af57ad
commit 4d2c30e2a8
1103 changed files with 90266 additions and 19899 deletions
+5 -5
View File
@@ -240,14 +240,14 @@ jobs:
build_marlin_pio ./ ${TEST_PLATFORM}
restore_configs
echo testing STM32F1 targets...
export TEST_PLATFORM="-e STM32F1"
export TEST_PLATFORM="-e STM32F103R"
restore_configs
echo use_example_configs STM32F10
use_example_configs STM32F10
echo use_example_configs STM32/STM32F103R
use_example_configs STM32/STM32F103R
build_marlin_pio ./ ${TEST_PLATFORM}
restore_configs
echo use_example_configs stm32f103ret6
use_example_configs stm32f103ret6
echo use_example_configs STM32/stm32f103ret6
use_example_configs STM32/stm32f103ret6
build_marlin_pio ./ ${TEST_PLATFORM}
restore_configs
+35 -7
View File
@@ -9,18 +9,46 @@ notifications:
email: false
env:
- TEST_PLATFORM="megaatmega2560"
# Base Environments
- TEST_PLATFORM="DUE"
- TEST_PLATFORM="esp32"
- TEST_PLATFORM="linux_native"
- TEST_PLATFORM="LPC1768"
- TEST_PLATFORM="LPC1769"
- TEST_PLATFORM="STM32F1"
- TEST_PLATFORM="megaatmega2560"
- TEST_PLATFORM="STM32F103R"
- TEST_PLATFORM="teensy31"
- TEST_PLATFORM="teensy35"
- TEST_PLATFORM="linux_native"
- TEST_PLATFORM="esp32"
- TEST_PLATFORM="alfawise_U20"
- TEST_PLATFORM="black_stm32f407ve"
- TEST_PLATFORM="adafruit_grandcentral_m4"
# Extended AVR Environments
- TEST_PLATFORM="fysetc_f6_13"
- TEST_PLATFORM="megaatmega1280"
- TEST_PLATFORM="rambo"
- TEST_PLATFORM="sanguino_atmega1284p"
- TEST_PLATFORM="sanguino_atmega644p"
# Extended STM32 Environments
- TEST_PLATFORM="ARMED"
- TEST_PLATFORM="BIGTREE_BTT002"
- TEST_PLATFORM="BIGTREE_SKR_PRO"
- TEST_PLATFORM="STM32F103R_bigtree"
- TEST_PLATFORM="jgaurora_a5s_a1"
- TEST_PLATFORM="STM32F103V_longer"
- TEST_PLATFORM="STM32F407VE_black"
# Non-working environment tests
#- TEST_PLATFORM="at90usb1286_cdc"
#- TEST_PLATFORM="at90usb1286_dfu"
#- TEST_PLATFORM="malyanm200"
#- TEST_PLATFORM="mks_robin"
#- TEST_PLATFORM="mks_robin_lite"
#- TEST_PLATFORM="mks_robin_mini"
#- TEST_PLATFORM="mks_robin_nano"
#- TEST_PLATFORM="SAMD51_grandcentral_m4"
#- TEST_PLATFORM="STM32F103R_bigtree"
#- TEST_PLATFORM="STM32F103R_fysetc"
#- TEST_PLATFORM="STM32F4"
#- TEST_PLATFORM="STM32F7"
before_install:
#
+51 -47
View File
@@ -131,13 +131,8 @@
// @section info
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
// Author info of this build printed to the host during boot and M115
#define STRING_CONFIG_H_AUTHOR "Tinymachines3D" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
/**
* *** VENDORS PLEASE READ ***
@@ -150,10 +145,13 @@
* respectfully request that you retain the unmodified Marlin boot screen.
*/
// Enable to show the bitmap in Marlin/_Bootscreen.h on startup.
// Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION **
#define SHOW_BOOTSCREEN
// Show the bitmap in Marlin/_Bootscreen.h on startup.
#define SHOW_CUSTOM_BOOTSCREEN
// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen.
// Show the bitmap in Marlin/_Statusscreen.h on the status screen.
#define CUSTOM_STATUS_SCREEN_IMAGE
// @section machine
@@ -190,8 +188,7 @@
// Enable the Bluetooth serial interface on AT90USB devices
//#define BLUETOOTH
// The following define selects which electronics board you have.
// Please choose the name from boards.h that matches your setup
// Choose the name from boards.h that matches your setup
#ifndef MOTHERBOARD
#if ENABLED(TREX3)
#define MOTHERBOARD BOARD_FORMBOT_TREX3
@@ -388,9 +385,9 @@
#else
#define HOTEND_OFFSET_X {0.0, 442.0} // (mm) relative X-offset for each nozzle
#endif
//#define HOTEND_OFFSET_X {0.0, 20.00} // (mm) relative X-offset for each nozzle
//#define HOTEND_OFFSET_Y {0.0, 5.00} // (mm) relative Y-offset for each nozzle
//#define HOTEND_OFFSET_Z {0.0, 0.00} // (mm) relative Z-offset for each nozzle
//#define HOTEND_OFFSET_Y { 0.0, 5.00 } // (mm) relative Y-offset for each nozzle
//#define HOTEND_OFFSET_Z { 0.0, 0.00 } // (mm) relative Z-offset for each nozzle
// @section machine
@@ -437,6 +434,7 @@
* -1 : thermocouple with AD595
* 0 : not used
* 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
* 331 : (3.3V scaled thermistor 1 table)
* 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
* 3 : Mendel-parts thermistor (4.7k pullup)
* 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
@@ -480,7 +478,7 @@
* 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below.
* 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below.
*
* :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '512':"100k RPW-Ultra hotend thermistor", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"Pt100 (Ultimainboard V2.x)", '201':"Pt100 (Overlord)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" }
* :{ '0':"Not used", '1':"100k / 4.7k - EPCOS", '331':"(3.3V thermistor 1)", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '512':"100k RPW-Ultra hotend thermistor", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '18':"ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327" '20':"Pt100 (Ultimainboard V2.x)", '201':"Pt100 (Overlord)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '61':"100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup", '66':"Dyze Design 4.7M High Temperature thermistor", '67':"Slice Engineering 450C High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595", '998':"Dummy 1", '999':"Dummy 2", '1000':"Custom thermistor params" }
*/
#if ENABLED(TREX3)
#define TEMP_SENSOR_0 61
@@ -894,7 +892,7 @@
* https://reprap.org/forum/read.php?1,739819
* http://blog.kyneticcnc.com/2018/10/computing-junction-deviation-for-marlin.html
*/
//#define JUNCTION_DEVIATION
#define JUNCTION_DEVIATION
#if ENABLED(JUNCTION_DEVIATION)
#define JUNCTION_DEVIATION_MM 0.08 // (mm) Distance from real junction edge
#endif
@@ -909,7 +907,7 @@
*/
#if DISABLED(JUNCTION_DEVIATION)
#define DEFAULT_XJERK 10.0
#define DEFAULT_YJERK 5.0
#define DEFAULT_YJERK 10.0
#define DEFAULT_ZJERK 0.3
#endif
@@ -1028,11 +1026,12 @@
/**
* Z Probe to nozzle (X,Y) offset, relative to (0, 0).
* X and Y offsets must be integers.
*
* Default X and Y offsets must be integers.
* Floats may be set with M851 if required.
*
* In the following example the X and Y offsets are both positive:
* #define X_PROBE_OFFSET_FROM_EXTRUDER 10
* #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
*
* #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
*
* +-- BACK ---+
* | |
@@ -1044,16 +1043,14 @@
* | |
* O-- FRONT --+
* (0,0)
*
* Specify a Probe position as { X, Y, Z }
*/
#if ENABLED(TREX3)
#define X_PROBE_OFFSET_FROM_EXTRUDER -3 // X offset: -left +right [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER 31 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle]
#define NOZZLE_TO_PROBE_OFFSET { -3, 31, -1.5 }
#else
#define X_PROBE_OFFSET_FROM_EXTRUDER -7 // X offset: -left +right [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER 29 // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle]
#define NOZZLE_TO_PROBE_OFFSET { -7, 29, -1.5 }
#endif
// Certain types of probes need to stay away from edges
#define MIN_PROBE_EDGE 1
@@ -1087,7 +1084,7 @@
*
* Use these settings to specify the distance (mm) to raise the probe (or
* lower the bed). The values set here apply over and above any (negative)
* probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
* probe Z Offset set with NOZZLE_TO_PROBE_OFFSET, M851, or the LCD.
* Only integer values >= 1 are valid here.
*
* Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle.
@@ -1363,10 +1360,9 @@
// For Cartesian machines, instead of dividing moves on mesh boundaries,
// split up moves into short segments like a Delta. This follows the
// contours of the bed more closely than edge-to-edge straight moves.
#if ENABLED(ABL_Bilinear)
#define SEGMENT_LEVELED_MOVES
#define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one)
#endif
//#define SEGMENT_LEVELED_MOVES
//#define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one)
/**
* Enable the G26 Mesh Validation Pattern tool.
*/
@@ -1485,7 +1481,7 @@
* Commands to execute at the end of G29 probing.
* Useful to retract or move the Z probe out of the way.
*/
#define Z_PROBE_END_SCRIPT "M280 P0 S90"
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
// @section homing
@@ -1653,10 +1649,10 @@
#define NOZZLE_PARK_FEATURE
#if ENABLED(NOZZLE_PARK_FEATURE)
// Specify a park position as { X, Y, Z }
// Specify a park position as { X, Y, Z_raise }
#define NOZZLE_PARK_POINT { 150, (Y_MIN_POS + 10), 10 }
#define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis)
#define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers)
#define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis)
#define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers)
#endif
/**
@@ -1707,7 +1703,7 @@
#define NOZZLE_CLEAN_TRIANGLES 3
// Specify positions as { X, Y, Z }
#define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)}
#define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1) }
#define NOZZLE_CLEAN_END_POINT { 100, 60, (Z_MIN_POS + 1) }
// Circular pattern radius
@@ -1766,10 +1762,10 @@
*
* Select the language to display on the LCD. These languages are available:
*
* en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it,
* jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test
* en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, jp-kana,
* ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, vi, zh_CN, zh_TW, test
*
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
* :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'vi':'Vietnamese', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' }
*/
#define LCD_LANGUAGE en
@@ -2220,6 +2216,12 @@
//
//#define MALYAN_LCD
//
// LulzBot Color Touch UI for FTDI EVE (FT800/FT810) displays
// See Configuration_adv.h for all configuration options.
//
//#define LULZBOT_TOUCH_UI
//
// Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extensible_ui'.
@@ -2231,7 +2233,7 @@
//=============================================================================
//
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, A1, etc.)
// FSMC display (MKS Robin, Alfawise U20, JGAurora A5S, REXYZ A1, etc.)
//
//#define FSMC_GRAPHICAL_TFT
@@ -2244,6 +2246,9 @@
//
//#define TOUCH_BUTTONS
#if ENABLED(TOUCH_BUTTONS)
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus
#define XPT2046_X_CALIBRATION 12316
#define XPT2046_Y_CALIBRATION -8981
#define XPT2046_X_OFFSET -43
@@ -2254,11 +2259,8 @@
// RepRapWorld REPRAPWORLD_KEYPAD v1.1
// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
//
// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key
// is pressed, a value of 10.0 means 10mm per click.
//
//#define REPRAPWORLD_KEYPAD
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // (mm) Distance to move per key-press
//=============================================================================
//=============================== Extra Features ==============================
@@ -2345,8 +2347,10 @@
//#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 4 // LED driving pin
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip
#define NEOPIXEL_PIN 4 // LED driving pin
//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
//#define NEOPIXEL2_PIN 5
#define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip, larger of 2 strips if 2 neopixel strips are used
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
@@ -2385,7 +2389,7 @@
*/
//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
// (ms) Delay before the next move will start, to give the servo time to reach its target angle.
// 300ms is a good value but you can try less delay.
// If the servo can't reach the requested position, increase it.
#define SERVO_DELAY { 300 }
+209 -95
View File
@@ -279,9 +279,10 @@
*/
//#define USE_CONTROLLER_FAN
#if ENABLED(USE_CONTROLLER_FAN)
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
#define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
#define CONTROLLERFAN_SPEED 255 // 255 == full speed
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
#define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled
#define CONTROLLERFAN_SPEED 255 // 255 == full speed
//#define CONTROLLERFAN_SPEED_Z_ONLY 127 // Reduce noise on machines that keep Z enabled
#endif
// When first starting the main fan, run it at full speed for the
@@ -597,10 +598,10 @@
* This feature was designed for Delta's with very fast Z moves however higher speed cartesians may function
* If the machine cannot raise the probe fast enough after a trigger, it may enter a fault state.
*/
//#define BLTOUCH_HS_MODE
#define BLTOUCH_HS_MODE
// Safety: Enable voltage mode settings in the LCD menu.
#define BLTOUCH_LCD_VOLTAGE_MENU
//#define BLTOUCH_LCD_VOLTAGE_MENU
#endif // BLTOUCH
@@ -611,8 +612,8 @@
//#define Z_STEPPER_AUTO_ALIGN
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
// Define probe X and Y positions for Z1, Z2 [, Z3]
#define Z_STEPPER_ALIGN_X { 10, 150, 290 }
#define Z_STEPPER_ALIGN_Y { 290, 10, 290 }
#define Z_STEPPER_ALIGN_X { 10, 150, 290 }
#define Z_STEPPER_ALIGN_Y { 290, 10, 290 }
// Set number of iterations to align
#define Z_STEPPER_ALIGN_ITERATIONS 3
// Enable to restore leveling setup after operation
@@ -629,7 +630,7 @@
#define Z_STEPPER_ALIGN_ACC 0.02
#endif
// @section machine
// @section motion
#define AXIS_RELATIVE_MODES { false, false, false, false }
@@ -656,21 +657,8 @@
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd
#if EITHER(ULTIPANEL, EXTENSIBLE_UI)
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel
#define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm)
#if ENABLED(ULTIPANEL)
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen
#endif
#endif
// @section extras
// minimum time in microseconds that a movement needs to take if the buffer is emptied.
#define DEFAULT_MINSEGMENTTIME 20000
// Minimum time that a segment needs to take if the buffer is emptied
#define DEFAULT_MINSEGMENTTIME 20000 // (ms)
// If defined the movements slow down when the look ahead buffer is only half full
#define SLOWDOWN
@@ -748,8 +736,8 @@
//#define CALIBRATION_REPORTING
// The true location and dimension the cube/bolt/washer on the bed.
#define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0} // mm
#define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0} // mm
#define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } // mm
#define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } // mm
// Comment out any sides which are unreachable by the probe. For best
// auto-calibration results, all sides must be reachable.
@@ -777,7 +765,7 @@
* vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
* lowest stepping frequencies.
*/
#define ADAPTIVE_STEP_SMOOTHING
//#define ADAPTIVE_STEP_SMOOTHING
/**
* Custom Microstepping
@@ -846,6 +834,15 @@
// @section lcd
#if EITHER(ULTIPANEL, EXTENSIBLE_UI)
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 } // Feedrates for manual moves along X, Y, Z, E from panel
#define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm)
#if ENABLED(ULTIPANEL)
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
#define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen
#endif
#endif
// Change values more rapidly when the encoder is rotated faster
#define ENCODER_RATE_MULTIPLIER
#if ENABLED(ENCODER_RATE_MULTIPLIER)
@@ -860,11 +857,35 @@
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
#endif
// Include a page of printer information in the LCD Main Menu
#define LCD_INFO_MENU
#if ENABLED(LCD_INFO_MENU)
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif
#if HAS_LCD_MENU
// Include a page of printer information in the LCD Main Menu
#define LCD_INFO_MENU
#if ENABLED(LCD_INFO_MENU)
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif
// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM
/**
* LED Control Menu
* Add LED Control to the LCD menu
*/
//#define LED_CONTROL_MENU
#if ENABLED(LED_CONTROL_MENU)
#define LED_COLOR_PRESETS // Enable the Preset Color menu option
#if ENABLED(LED_COLOR_PRESETS)
#define LED_USER_PRESET_RED 255 // User defined RED value
#define LED_USER_PRESET_GREEN 128 // User defined GREEN value
#define LED_USER_PRESET_BLUE 0 // User defined BLUE value
#define LED_USER_PRESET_WHITE 255 // User defined WHITE value
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#endif
#endif // HAS_LCD_MENU
// Scroll a longer status message into view
#define STATUS_MESSAGE_SCROLLING
@@ -889,23 +910,6 @@
#endif
#endif
/**
* LED Control Menu
* Enable this feature to add LED Control to the LCD menu
*/
//#define LED_CONTROL_MENU
#if ENABLED(LED_CONTROL_MENU)
#define LED_COLOR_PRESETS // Enable the Preset Color menu option
#if ENABLED(LED_COLOR_PRESETS)
#define LED_USER_PRESET_RED 255 // User defined RED value
#define LED_USER_PRESET_GREEN 128 // User defined GREEN value
#define LED_USER_PRESET_BLUE 0 // User defined BLUE value
#define LED_USER_PRESET_WHITE 255 // User defined WHITE value
#define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity
//#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup
#endif
#endif // LED_CONTROL_MENU
#if ENABLED(SDSUPPORT)
// Some RAMPS and other boards don't detect when an SD card is inserted. You can work
@@ -940,6 +944,7 @@
#if ENABLED(POWER_LOSS_RECOVERY)
//#define POWER_LOSS_PIN 44 // Pin to detect power loss
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
//#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
@@ -1019,17 +1024,31 @@
* equivalent MAX3421E breakout board. The USB thumb drive will appear
* to Marlin as an SD card.
*
* The MAX3421E must be assigned the same pins as the SD card reader, with
* The MAX3421E can be assigned the same pins as the SD card reader, with
* the following pin mapping:
*
* SCLK, MOSI, MISO --> SCLK, MOSI, MISO
* INT --> SD_DETECT_PIN
* INT --> SD_DETECT_PIN [1]
* SS --> SDSS
*
* [1] On AVR an interrupt-capable pin is best for UHS3 compatibility.
*/
//#define USB_FLASH_DRIVE_SUPPORT
#if ENABLED(USB_FLASH_DRIVE_SUPPORT)
#define USB_CS_PIN SDSS
#define USB_INTR_PIN SD_DETECT_PIN
#define USB_CS_PIN SDSS
#define USB_INTR_PIN SD_DETECT_PIN
/**
* USB Host Shield Library
*
* - UHS2 uses no interrupts and has been production-tested
* on a LulzBot TAZ Pro with a 32-bit Archim board.
*
* - UHS3 is newer code with better USB compatibility. But it
* is less tested and is known to interfere with Servos.
* [1] This requires USB_INTR_PIN to be interrupt-capable.
*/
//#define USE_UHS3_USB
#endif
/**
@@ -1144,6 +1163,7 @@
//#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames
//#define STATUS_HEAT_PERCENT // Show heating in a progress bar
#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving 399 bytes of flash)
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of PROGMEM.
// Frivolous Game Options
//#define MARLIN_BRICKOUT
@@ -1153,6 +1173,77 @@
#endif // HAS_GRAPHICAL_LCD
//
// Lulzbot Touch UI
//
#if ENABLED(LULZBOT_TOUCH_UI)
// Display board used
//#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240)
//#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272)
//#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272)
//#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480)
//#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI
// Correct the resolution if not using the stock TFT panel.
//#define TOUCH_UI_320x240
//#define TOUCH_UI_480x272
//#define TOUCH_UI_800x480
// Mappings for boards with a standard RepRapDiscount Display connector
//#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping
//#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping
//#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping
//#define OTHER_PIN_LAYOUT // Define pins manually below
#if ENABLED(OTHER_PIN_LAYOUT)
// The pins for CS and MOD_RESET (PD) must be chosen.
#define CLCD_MOD_RESET 9
#define CLCD_SPI_CS 10
// If using software SPI, specify pins for SCLK, MOSI, MISO
//#define CLCD_USE_SOFT_SPI
#if ENABLED(CLCD_USE_SOFT_SPI)
#define CLCD_SOFT_SPI_MOSI 11
#define CLCD_SOFT_SPI_MISO 12
#define CLCD_SOFT_SPI_SCLK 13
#endif
#endif
// Display Orientation. An inverted (i.e. upside-down) display
// is supported on the FT800. The FT810 and beyond also support
// portrait and mirrored orientations.
//#define TOUCH_UI_INVERTED
//#define TOUCH_UI_PORTRAIT
//#define TOUCH_UI_MIRRORED
// Enable UTF8 rendering capabilities.
//#define TOUCH_UI_USE_UTF8
#if ENABLED(TOUCH_UI_USE_UTF8)
#define TOUCH_UI_UTF8_WESTERN_CHARSET
#endif
// When labels do not fit buttons, use smaller font
#define TOUCH_UI_FIT_TEXT
// Runtime language selection (otherwise LCD_LANGUAGE)
//#define TOUCH_UI_LANGUAGE_MENU
// Use a numeric passcode for "Screen lock" keypad.
// (recommended for smaller displays)
//#define TOUCH_UI_PASSCODE
#endif
//
// FSMC Graphical TFT
//
#if ENABLED(FSMC_GRAPHICAL_TFT)
//#define TFT_MARLINUI_COLOR 0xFFFF // White
//#define TFT_MARLINBG_COLOR 0x0000 // Black
//#define TFT_DISABLED_COLOR 0x0003 // Almost black
//#define TFT_BTCANCEL_COLOR 0xF800 // Red
//#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow
//#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
#endif
// @section safety
/**
@@ -1235,29 +1326,10 @@
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
// Override the mesh area if the automatic (max) area is too large
#if( (X_PROBE_OFFSET_FROM_EXTRUDER + (MIN_PROBE_EDGE + MESH_INSET)) > 0 )
#define MESH_MIN_X (X_PROBE_OFFSET_FROM_EXTRUDER + MIN_PROBE_EDGE + MESH_INSET)
#else
#define MESH_MIN_X 10
#endif
#if( (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 10) < X_BED_SIZE)
#define MESH_MAX_X (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - (MIN_PROBE_EDGE + MESH_INSET))
#else
#define MESH_MAX_X (X_BED_SIZE - 10)
#endif
#if ( (Y_PROBE_OFFSET_FROM_EXTRUDER + 10) > 5 )
#define MESH_MIN_Y (Y_PROBE_OFFSET_FROM_EXTRUDER + MIN_PROBE_EDGE + MESH_INSET)
#else
#define MESH_MIN_Y 25
#endif
#if( (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 10) < Y_BED_SIZE)
#define MESH_MAX_Y (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 10)
#else
#define MESH_MAX_Y (Y_BED_SIZE - Y_PROBE_OFFSET_FROM_EXTRUDER - (MIN_PROBE_EDGE + MESH_INSET))
#endif
//#define MESH_MIN_X MESH_INSET
//#define MESH_MIN_Y MESH_INSET
//#define MESH_MAX_X X_BED_SIZE - (MESH_INSET)
//#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET)
#endif
/**
@@ -1461,19 +1533,19 @@
#define FWRETRACT
#endif
#if ENABLED(FWRETRACT)
#define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM
#define FWRETRACT_AUTORETRACT // Override slicer retractions
#if ENABLED(FWRETRACT_AUTORETRACT)
#define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over
#define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion
#define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length
#define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length
#endif
#define RETRACT_LENGTH 3 // Default retract length (positive mm)
#define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change
#define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s)
#define RETRACT_ZRAISE 0 // Default retract Z-raise (mm)
#define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering)
#define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change)
#define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s)
#define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s)
#define RETRACT_LENGTH 3 // (mm) Default retract length (positive value)
#define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value)
#define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting
#define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise
#define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover)
#define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange)
#define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction
#define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction
#if ENABLED(MIXING_EXTRUDER)
//#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously
#endif
@@ -1678,78 +1750,91 @@
#define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current.
#define X_MICROSTEPS 16 // 0..256
#define X_RSENSE 0.11
#define X_CHAIN_POS 0 // 0 - Not chained, 1 - MCU MOSI connected, 2 - next in chain, ...
#endif
#if AXIS_IS_TMC(X2)
#define X2_CURRENT 800
#define X2_MICROSTEPS 16
#define X2_RSENSE 0.11
#define X2_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(Y)
#define Y_CURRENT 800
#define Y_MICROSTEPS 16
#define Y_RSENSE 0.11
#define Y_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(Y2)
#define Y2_CURRENT 800
#define Y2_MICROSTEPS 16
#define Y2_RSENSE 0.11
#define Y2_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(Z)
#define Z_CURRENT 800
#define Z_MICROSTEPS 16
#define Z_RSENSE 0.11
#define Z_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(Z2)
#define Z2_CURRENT 800
#define Z2_MICROSTEPS 16
#define Z2_RSENSE 0.11
#define Z2_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(Z3)
#define Z3_CURRENT 800
#define Z3_MICROSTEPS 16
#define Z3_RSENSE 0.11
#define Z3_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(E0)
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
#define E0_RSENSE 0.11
#define E0_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(E1)
#define E1_CURRENT 800
#define E1_MICROSTEPS 16
#define E1_RSENSE 0.11
#define E1_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(E2)
#define E2_CURRENT 800
#define E2_MICROSTEPS 16
#define E2_RSENSE 0.11
#define E2_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(E3)
#define E3_CURRENT 800
#define E3_MICROSTEPS 16
#define E3_RSENSE 0.11
#define E3_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(E4)
#define E4_CURRENT 800
#define E4_MICROSTEPS 16
#define E4_RSENSE 0.11
#define E4_CHAIN_POS 0
#endif
#if AXIS_IS_TMC(E5)
#define E5_CURRENT 800
#define E5_MICROSTEPS 16
#define E5_RSENSE 0.11
#define E5_CHAIN_POS 0
#endif
/**
@@ -1841,7 +1926,7 @@
/**
* Monitor Trinamic drivers for error conditions,
* like overtemperature and short to ground. TMC2208 requires hardware serial.
* like overtemperature and short to ground.
* In the case of overtemperature Marlin can decrease the driver current until error condition clears.
* Other detected conditions can be used to stop the current print.
* Relevant g-codes:
@@ -1888,10 +1973,12 @@
* Connect the stepper driver's DIAG1 pin to the X/Y endstop pin.
* X, Y, and Z homing will always be done in spreadCycle mode.
*
* X/Y/Z_STALL_SENSITIVITY is used to tune the trigger sensitivity.
* Use M914 X Y Z to live-adjust the sensitivity.
* Higher: LESS sensitive. (Too high => failure to trigger)
* Lower: MORE sensitive. (Too low => false positives)
* X/Y/Z_STALL_SENSITIVITY is the default stall threshold.
* Use M914 X Y Z to set the stall threshold at runtime:
*
* Sensitivity TMC2209 Others
* HIGHEST 255 -64 (Too sensitive => False positive)
* LOWEST 0 63 (Too insensitive => No trigger)
*
* It is recommended to set [XYZ]_HOME_BUMP_MM to 0.
*
@@ -1915,6 +2002,7 @@
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
// TMC2209: 0...255. TMC2130: -64...63
#define X_STALL_SENSITIVITY 8
#define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY
#define Y_STALL_SENSITIVITY 8
//#define Z_STALL_SENSITIVITY 8
//#define SPI_ENDSTOPS // TMC2130 only
@@ -2275,6 +2363,13 @@
*/
#define EXTENDED_CAPABILITIES_REPORT
/**
* Expected Printer Check
* Add the M16 G-code to compare a string to the MACHINE_NAME.
* M16 with a non-matching string causes the printer to halt.
*/
//#define EXPECTED_PRINTER_CHECK
/**
* Disable all Volumetric extrusion options
*/
@@ -2329,6 +2424,13 @@
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
#endif
/**
* Startup commands
*
* Execute certain G-code commands immediately after power-on.
*/
//#define STARTUP_COMMANDS "M17 Z"
/**
* G-code Macros
*
@@ -2396,10 +2498,6 @@
#define HOST_PROMPT_SUPPORT
#endif
//===========================================================================
//====================== I2C Position Encoder Settings ======================
//===========================================================================
/**
* I2C position encoders for closed loop control.
* Developed by Chris Barr at Aus3D.
@@ -2480,6 +2578,22 @@
#endif // I2C_POSITION_ENCODERS
/**
* Analog Joystick(s)
*/
//#define JOYSTICK
#if ENABLED(JOYSTICK)
#define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2
#define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2
#define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2
#define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2
// Use M119 to find reasonable values after connecting your hardware:
#define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max
#define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 }
#define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 }
#endif
/**
* MAX7219 Debug Matrix
*
+1 -1
View File
@@ -35,7 +35,7 @@
// Public functions
// ------------------------
void HAL_init(void) {
void HAL_init() {
// Init Servo Pins
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
#if HAS_SERVO_0
+17 -17
View File
@@ -20,9 +20,9 @@
#include "../shared/Marduino.h"
#include "../shared/HAL_SPI.h"
#include "fastio_AVR.h"
#include "watchdog_AVR.h"
#include "math_AVR.h"
#include "fastio.h"
#include "watchdog.h"
#include "math.h"
#ifdef USBCON
#include "HardwareSerial.h"
@@ -105,19 +105,19 @@ typedef int8_t pin_t;
// Public functions
// ------------------------
void HAL_init(void);
void HAL_init();
//void cli(void);
//void cli();
//void _delay_ms(const int delay);
inline void HAL_clear_reset_source(void) { MCUSR = 0; }
inline uint8_t HAL_get_reset_source(void) { return MCUSR; }
inline void HAL_clear_reset_source() { MCUSR = 0; }
inline uint8_t HAL_get_reset_source() { return MCUSR; }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
extern "C" {
int freeMemory(void);
int freeMemory();
}
#pragma GCC diagnostic pop
@@ -199,9 +199,9 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t freque
/* 18 cycles maximum latency */
#define HAL_STEP_TIMER_ISR() \
extern "C" void TIMER1_COMPA_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER1_COMPA_vect_bottom (void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER1_COMPA_vect (void) { \
extern "C" void TIMER1_COMPA_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER1_COMPA_vect_bottom() asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER1_COMPA_vect() { \
__asm__ __volatile__ ( \
A("push r16") /* 2 Save R16 */ \
A("in r16, __SREG__") /* 1 Get SREG */ \
@@ -268,13 +268,13 @@ void TIMER1_COMPA_vect (void) { \
: \
); \
} \
void TIMER1_COMPA_vect_bottom(void)
void TIMER1_COMPA_vect_bottom()
/* 14 cycles maximum latency */
#define HAL_TEMP_TIMER_ISR() \
extern "C" void TIMER0_COMPB_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER0_COMPB_vect_bottom(void) asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER0_COMPB_vect (void) { \
extern "C" void TIMER0_COMPB_vect() __attribute__ ((signal, naked, used, externally_visible)); \
extern "C" void TIMER0_COMPB_vect_bottom() asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
void TIMER0_COMPB_vect() { \
__asm__ __volatile__ ( \
A("push r16") /* 2 Save R16 */ \
A("in r16, __SREG__") /* 1 Get SREG */ \
@@ -334,7 +334,7 @@ void TIMER0_COMPB_vect (void) { \
: \
); \
} \
void TIMER0_COMPB_vect_bottom(void)
void TIMER0_COMPB_vect_bottom()
// ADC
#ifdef DIDR2
@@ -343,7 +343,7 @@ void TIMER0_COMPB_vect_bottom(void)
#define HAL_ANALOG_SELECT(pin) do{ SBI(DIDR0, pin); }while(0)
#endif
inline void HAL_adc_init(void) {
inline void HAL_adc_init() {
ADCSRA = _BV(ADEN) | _BV(ADSC) | _BV(ADIF) | 0x07;
DIDR0 = 0;
#ifdef DIDR2
@@ -33,7 +33,7 @@
#include "../../inc/MarlinConfig.h"
void spiBegin(void) {
void spiBegin() {
OUT_WRITE(SS_PIN, HIGH);
SET_OUTPUT(SCK_PIN);
SET_INPUT(MISO_PIN);
@@ -81,7 +81,7 @@ void spiBegin(void) {
}
/** SPI receive a byte */
uint8_t spiRec(void) {
uint8_t spiRec() {
SPDR = 0xFF;
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
return SPDR;
+7 -7
View File
@@ -271,7 +271,7 @@
// (called with TX irqs disabled)
template<typename Cfg>
FORCE_INLINE void MarlinSerial<Cfg>::_tx_udr_empty_irq(void) {
FORCE_INLINE void MarlinSerial<Cfg>::_tx_udr_empty_irq() {
if (Cfg::TX_SIZE > 0) {
// Read positions
uint8_t t = tx_buffer.tail;
@@ -363,13 +363,13 @@
}
template<typename Cfg>
int MarlinSerial<Cfg>::peek(void) {
int MarlinSerial<Cfg>::peek() {
const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
return h == t ? -1 : rx_buffer.buffer[t];
}
template<typename Cfg>
int MarlinSerial<Cfg>::read(void) {
int MarlinSerial<Cfg>::read() {
const ring_buffer_pos_t h = atomic_read_rx_head();
// Read the tail. Main thread owns it, so it is safe to directly read it
@@ -412,13 +412,13 @@
}
template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available(void) {
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available() {
const ring_buffer_pos_t h = atomic_read_rx_head(), t = rx_buffer.tail;
return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
}
template<typename Cfg>
void MarlinSerial<Cfg>::flush(void) {
void MarlinSerial<Cfg>::flush() {
// Set the tail to the head:
// - Read the RX head index in a safe way. (See atomic_read_rx_head.)
@@ -505,7 +505,7 @@
}
template<typename Cfg>
void MarlinSerial<Cfg>::flushTX(void) {
void MarlinSerial<Cfg>::flushTX() {
if (Cfg::TX_SIZE == 0) {
// No bytes written, no need to flush. This special case is needed since there's
@@ -595,7 +595,7 @@
}
template<typename Cfg>
void MarlinSerial<Cfg>::println(void) {
void MarlinSerial<Cfg>::println() {
print('\r');
print('\n');
}
+7 -7
View File
@@ -205,18 +205,18 @@
public:
FORCE_INLINE static void store_rxd_char();
FORCE_INLINE static void _tx_udr_empty_irq(void);
FORCE_INLINE static void _tx_udr_empty_irq();
public:
MarlinSerial() {};
static void begin(const long);
static void end();
static int peek(void);
static int read(void);
static void flush(void);
static ring_buffer_pos_t available(void);
static int peek();
static int read();
static void flush();
static ring_buffer_pos_t available();
static void write(const uint8_t c);
static void flushTX(void);
static void flushTX();
FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
@@ -245,7 +245,7 @@
static void println(long, int = DEC);
static void println(unsigned long, int = DEC);
static void println(double, int = 2);
static void println(void);
static void println();
operator bool() { return true; }
private:
+21 -50
View File
@@ -41,7 +41,7 @@
#include <stdint.h>
// One ISR for all EXT-Interrupts
void endstop_ISR(void) { endstops.update(); }
void endstop_ISR() { endstops.update(); }
/**
* Patch for pins_arduino.h (...\Arduino\hardware\arduino\avr\variants\mega\pins_arduino.h)
@@ -102,153 +102,124 @@ void pciSetup(const int8_t pin) {
ISR(PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
#endif
void setup_endstop_interrupts( void ) {
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
#if HAS_X_MAX
#if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT) // if pin has an external interrupt
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
#if (digitalPinToInterrupt(X_MAX_PIN) != NOT_AN_INTERRUPT)
_ATTACH(X_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable"); // if pin has no pin change interrupt - error
pciSetup(X_MAX_PIN); // assign it
static_assert(digitalPinToPCICR(X_MAX_PIN), "X_MAX_PIN is not interrupt-capable");
pciSetup(X_MAX_PIN);
#endif
#endif
#if HAS_X_MIN
#if (digitalPinToInterrupt(X_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(X_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(X_MIN_PIN), "X_MIN_PIN is not interrupt-capable");
pciSetup(X_MIN_PIN);
#endif
#endif
#if HAS_Y_MAX
#if (digitalPinToInterrupt(Y_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Y_MAX_PIN), "Y_MAX_PIN is not interrupt-capable");
pciSetup(Y_MAX_PIN);
#endif
#endif
#if HAS_Y_MIN
#if (digitalPinToInterrupt(Y_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Y_MIN_PIN), "Y_MIN_PIN is not interrupt-capable");
pciSetup(Y_MIN_PIN);
#endif
#endif
#if HAS_Z_MAX
#if (digitalPinToInterrupt(Z_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z_MAX_PIN), "Z_MAX_PIN is not interrupt-capable");
pciSetup(Z_MAX_PIN);
#endif
#endif
#if HAS_Z_MIN
#if (digitalPinToInterrupt(Z_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z_MIN_PIN), "Z_MIN_PIN is not interrupt-capable");
pciSetup(Z_MIN_PIN);
#endif
#endif
#if HAS_X2_MAX
#if (digitalPinToInterrupt(X2_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(X2_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(X2_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(X2_MAX_PIN), "X2_MAX_PIN is not interrupt-capable");
pciSetup(X2_MAX_PIN);
#endif
#endif
#if HAS_X2_MIN
#if (digitalPinToInterrupt(X2_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(X2_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(X2_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(X2_MIN_PIN), "X2_MIN_PIN is not interrupt-capable");
pciSetup(X2_MIN_PIN);
#endif
#endif
#if HAS_Y2_MAX
#if (digitalPinToInterrupt(Y2_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Y2_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Y2_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Y2_MAX_PIN), "Y2_MAX_PIN is not interrupt-capable");
pciSetup(Y2_MAX_PIN);
#endif
#endif
#if HAS_Y2_MIN
#if (digitalPinToInterrupt(Y2_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Y2_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Y2_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Y2_MIN_PIN), "Y2_MIN_PIN is not interrupt-capable");
pciSetup(Y2_MIN_PIN);
#endif
#endif
#if HAS_Z2_MAX
#if (digitalPinToInterrupt(Z2_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z2_MAX_PIN), "Z2_MAX_PIN is not interrupt-capable");
pciSetup(Z2_MAX_PIN);
#endif
#endif
#if HAS_Z2_MIN
#if (digitalPinToInterrupt(Z2_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z2_MIN_PIN), "Z2_MIN_PIN is not interrupt-capable");
pciSetup(Z2_MIN_PIN);
#endif
#endif
#if HAS_Z3_MAX
#if (digitalPinToInterrupt(Z3_MAX_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MAX_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z3_MAX_PIN), "Z3_MAX_PIN is not interrupt-capable");
pciSetup(Z3_MAX_PIN);
#endif
#endif
#if HAS_Z3_MIN
#if (digitalPinToInterrupt(Z3_MIN_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MIN_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z3_MIN_PIN), "Z3_MIN_PIN is not interrupt-capable");
pciSetup(Z3_MIN_PIN);
#endif
#endif
#if HAS_Z_MIN_PROBE_PIN
#if (digitalPinToInterrupt(Z_MIN_PROBE_PIN) != NOT_AN_INTERRUPT)
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PROBE_PIN);
#else
// Not all used endstop/probe -pins can raise interrupts. Please deactivate ENDSTOP_INTERRUPTS or change the pin configuration!
static_assert(digitalPinToPCICR(Z_MIN_PROBE_PIN), "Z_MIN_PROBE_PIN is not interrupt-capable");
pciSetup(Z_MIN_PROBE_PIN);
#endif
+1 -1
View File
@@ -65,7 +65,7 @@ Timer get_pwm_timer(const pin_t pin) {
/*n, q*/ 2, 0
};
}
#elif defined TCCR2A
#elif defined(TCCR2A)
#if ENABLED(USE_OCR2A_AS_TOP)
case TIMER2A: break; // protect TIMER2A
case TIMER2B: {
@@ -26,7 +26,7 @@
#ifdef __AVR__
#include "fastio_AVR.h"
#include "fastio.h"
#ifdef FASTIO_EXT_START
+1 -1
View File
@@ -29,7 +29,7 @@
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 72 75 76 77 74 xx xx xx xx xx
*/
#include "../fastio_AVR.h"
#include "../fastio.h"
// change for your board
#define DEBUG_LED DIO21
+1 -1
View File
@@ -28,7 +28,7 @@
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5
*/
#include "../fastio_AVR.h"
#include "../fastio.h"
// change for your board
#define DEBUG_LED DIO46
+1 -1
View File
@@ -28,7 +28,7 @@
* Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
*/
#include "../fastio_AVR.h"
#include "../fastio.h"
#define DEBUG_LED AIO5
+1 -1
View File
@@ -54,7 +54,7 @@
* +--------+
*/
#include "../fastio_AVR.h"
#include "../fastio.h"
#define DEBUG_LED DIO0
@@ -29,7 +29,7 @@
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
*/
#include "../fastio_AVR.h"
#include "../fastio.h"
// change for your board
#define DEBUG_LED DIO31 /* led D5 red */
@@ -26,7 +26,7 @@
#if ENABLED(USE_WATCHDOG)
#include "watchdog_AVR.h"
#include "watchdog.h"
#include "../../Marlin.h"
@@ -42,7 +42,7 @@
#define sw_barrier() __asm__ volatile("": : :"memory");
// (re)initialize UART0 as a monitor output to 250000,n,8,1
static void TXBegin(void) {
static void TXBegin() {
// Disable UART interrupt in NVIC
NVIC_DisableIRQ( UART_IRQn );
@@ -235,7 +235,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
for (;;) WDT_Restart(WDT);
}
__attribute__((naked)) void NMI_Handler(void) {
__attribute__((naked)) void NMI_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -248,7 +248,7 @@ __attribute__((naked)) void NMI_Handler(void) {
);
}
__attribute__((naked)) void HardFault_Handler(void) {
__attribute__((naked)) void HardFault_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -261,7 +261,7 @@ __attribute__((naked)) void HardFault_Handler(void) {
);
}
__attribute__((naked)) void MemManage_Handler(void) {
__attribute__((naked)) void MemManage_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -274,7 +274,7 @@ __attribute__((naked)) void MemManage_Handler(void) {
);
}
__attribute__((naked)) void BusFault_Handler(void) {
__attribute__((naked)) void BusFault_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -287,7 +287,7 @@ __attribute__((naked)) void BusFault_Handler(void) {
);
}
__attribute__((naked)) void UsageFault_Handler(void) {
__attribute__((naked)) void UsageFault_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -300,7 +300,7 @@ __attribute__((naked)) void UsageFault_Handler(void) {
);
}
__attribute__((naked)) void DebugMon_Handler(void) {
__attribute__((naked)) void DebugMon_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -314,7 +314,7 @@ __attribute__((naked)) void DebugMon_Handler(void) {
}
/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
__attribute__((naked)) void WDT_Handler(void) {
__attribute__((naked)) void WDT_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -327,7 +327,7 @@ __attribute__((naked)) void WDT_Handler(void) {
);
}
__attribute__((naked)) void RSTC_Handler(void) {
__attribute__((naked)) void RSTC_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -993,7 +993,7 @@ void eeprom_read_block(void* __dst, const void* __src, size_t __n) {
}
}
void eeprom_flush(void) {
void eeprom_flush() {
ee_Flush();
}
+7 -7
View File
@@ -42,7 +42,7 @@ uint16_t HAL_adc_result;
// ------------------------
// HAL initialization task
void HAL_init(void) {
void HAL_init() {
// Initialize the USB stack
#if ENABLED(SDSUPPORT)
OUT_WRITE(SDSS, HIGH); // Try to set SDSS inactive before any other SPI users start up
@@ -51,20 +51,20 @@ void HAL_init(void) {
}
// HAL idle task
void HAL_idletask(void) {
void HAL_idletask() {
// Perform USB stack housekeeping
usb_task_idle();
}
// Disable interrupts
void cli(void) { noInterrupts(); }
void cli() { noInterrupts(); }
// Enable interrupts
void sei(void) { interrupts(); }
void sei() { interrupts(); }
void HAL_clear_reset_source(void) { }
void HAL_clear_reset_source() { }
uint8_t HAL_get_reset_source(void) {
uint8_t HAL_get_reset_source() {
switch ((RSTC->RSTC_SR >> 8) & 0x07) {
case 0: return RST_POWER_ON;
case 1: return RST_BACKUP;
@@ -98,7 +98,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin);
}
uint16_t HAL_adc_get_result(void) {
uint16_t HAL_adc_get_result() {
// nop
return HAL_adc_result;
}
+14 -25
View File
@@ -32,9 +32,9 @@
#include "../shared/Marduino.h"
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
#include "fastio_Due.h"
#include "watchdog_Due.h"
#include "HAL_timers_Due.h"
#include "fastio.h"
#include "watchdog.h"
#include "timers.h"
#include <stdint.h>
@@ -58,8 +58,8 @@
#define NUM_SERIAL 1
#endif
#include "MarlinSerial_Due.h"
#include "MarlinSerialUSB_Due.h"
#include "MarlinSerial.h"
#include "MarlinSerialUSB.h"
// On AVR this is in math.h?
#define square(x) ((x)*(x))
@@ -88,22 +88,11 @@ typedef int8_t pin_t;
#define ENABLE_ISRS() __enable_irq()
#define DISABLE_ISRS() __disable_irq()
void cli(void); // Disable interrupts
void sei(void); // Enable interrupts
void cli(); // Disable interrupts
void sei(); // Enable interrupts
void HAL_clear_reset_source(void); // clear reset reason
uint8_t HAL_get_reset_source(void); // get reset reason
//
// SPI: Extended functions taking a channel number (Hardware SPI only)
//
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);
void HAL_clear_reset_source(); // clear reset reason
uint8_t HAL_get_reset_source(); // get reset reason
//
// EEPROM
@@ -124,14 +113,14 @@ extern uint16_t HAL_adc_result; // result of last ADC conversion
#define HAL_ANALOG_SELECT(pin)
inline void HAL_adc_init(void) {}//todo
inline void HAL_adc_init() {}//todo
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
#define HAL_ADC_READY() true
void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void);
uint16_t HAL_adc_get_result();
//
// Pin Map
@@ -149,8 +138,8 @@ void noTone(const pin_t _pin);
// Enable hooks into idle and setup for HAL
#define HAL_IDLETASK 1
void HAL_idletask(void);
void HAL_init(void);
void HAL_idletask();
void HAL_init();
//
// Utility functions
@@ -159,7 +148,7 @@ void _delay_ms(const int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
int freeMemory();
#pragma GCC diagnostic pop
#ifdef __cplusplus
@@ -428,7 +428,7 @@
static void spiTxBlockX(const uint8_t* buf, uint32_t todo) {
do {
(void) spiTransferTx(*buf++);
(void)spiTransferTx(*buf++);
} while (--todo);
}
@@ -34,7 +34,7 @@
#include "../../inc/MarlinConfig.h"
#include "HAL.h"
#include "InterruptVectors_Due.h"
#include "InterruptVectors.h"
/* The relocated Exception/Interrupt Table - According to the ARM
reference manual, alignment to 128 bytes should suffice, but in
@@ -48,7 +48,7 @@ static DeviceVectors ram_tab = { nullptr };
* If it is not, then it copies the ROM table to the SRAM and relocates the table
* by reprogramming the NVIC registers
*/
static pfnISR_Handler* get_relocated_table_addr(void) {
static pfnISR_Handler* get_relocated_table_addr() {
// Get the address of the interrupt/exception table
uint32_t isrtab = SCB->VTOR;
@@ -37,7 +37,7 @@
#ifdef ARDUINO_ARCH_SAM
// ISR handler type
typedef void (*pfnISR_Handler)(void);
typedef void (*pfnISR_Handler)();
// Install a new interrupt vector handler for the given irq, returning the old one
pfnISR_Handler install_isr(IRQn_Type irq, pfnISR_Handler newHandler);
@@ -29,8 +29,8 @@
#include "../../inc/MarlinConfig.h"
#include "MarlinSerial_Due.h"
#include "InterruptVectors_Due.h"
#include "MarlinSerial.h"
#include "InterruptVectors.h"
#include "../../Marlin.h"
template<typename Cfg> typename MarlinSerial<Cfg>::ring_buffer_r MarlinSerial<Cfg>::rx_buffer = { 0, 0, { 0 } };
@@ -178,7 +178,7 @@ FORCE_INLINE void MarlinSerial<Cfg>::store_rxd_char() {
}
template<typename Cfg>
FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq(void) {
FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq() {
if (Cfg::TX_SIZE > 0) {
// Read positions
uint8_t t = tx_buffer.tail;
@@ -221,7 +221,7 @@ FORCE_INLINE void MarlinSerial<Cfg>::_tx_thr_empty_irq(void) {
}
template<typename Cfg>
void MarlinSerial<Cfg>::UART_ISR(void) {
void MarlinSerial<Cfg>::UART_ISR() {
const uint32_t status = HWUART->UART_SR;
// Data received?
@@ -308,13 +308,13 @@ void MarlinSerial<Cfg>::end() {
}
template<typename Cfg>
int MarlinSerial<Cfg>::peek(void) {
int MarlinSerial<Cfg>::peek() {
const int v = rx_buffer.head == rx_buffer.tail ? -1 : rx_buffer.buffer[rx_buffer.tail];
return v;
}
template<typename Cfg>
int MarlinSerial<Cfg>::read(void) {
int MarlinSerial<Cfg>::read() {
const ring_buffer_pos_t h = rx_buffer.head;
ring_buffer_pos_t t = rx_buffer.tail;
@@ -354,13 +354,13 @@ int MarlinSerial<Cfg>::read(void) {
}
template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available(void) {
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::available() {
const ring_buffer_pos_t h = rx_buffer.head, t = rx_buffer.tail;
return (ring_buffer_pos_t)(Cfg::RX_SIZE + h - t) & (Cfg::RX_SIZE - 1);
}
template<typename Cfg>
void MarlinSerial<Cfg>::flush(void) {
void MarlinSerial<Cfg>::flush() {
rx_buffer.tail = rx_buffer.head;
if (Cfg::XONOFF) {
@@ -431,7 +431,7 @@ void MarlinSerial<Cfg>::write(const uint8_t c) {
}
template<typename Cfg>
void MarlinSerial<Cfg>::flushTX(void) {
void MarlinSerial<Cfg>::flushTX() {
// TX
if (Cfg::TX_SIZE == 0) {
@@ -520,7 +520,7 @@ void MarlinSerial<Cfg>::print(double n, int digits) {
}
template<typename Cfg>
void MarlinSerial<Cfg>::println(void) {
void MarlinSerial<Cfg>::println() {
print('\r');
print('\n');
}
@@ -108,19 +108,19 @@ protected:
static ring_buffer_pos_t rx_max_enqueued;
FORCE_INLINE static void store_rxd_char();
FORCE_INLINE static void _tx_thr_empty_irq(void);
static void UART_ISR(void);
FORCE_INLINE static void _tx_thr_empty_irq();
static void UART_ISR();
public:
MarlinSerial() {};
static void begin(const long);
static void end();
static int peek(void);
static int read(void);
static void flush(void);
static ring_buffer_pos_t available(void);
static int peek();
static int read();
static void flush();
static ring_buffer_pos_t available();
static void write(const uint8_t c);
static void flushTX(void);
static void flushTX();
FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }
FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }
@@ -149,7 +149,7 @@ public:
static void println(long, int = DEC);
static void println(unsigned long, int = DEC);
static void println(double, int = 2);
static void println(void);
static void println();
operator bool() { return true; }
private:
@@ -31,7 +31,7 @@
#if SERIAL_PORT == -1
#include "MarlinSerialUSB_Due.h"
#include "MarlinSerialUSB.h"
#if ENABLED(EMERGENCY_PARSER)
#include "../../feature/emergency_parser.h"
@@ -39,11 +39,11 @@
// Imports from Atmel USB Stack/CDC implementation
extern "C" {
bool usb_task_cdc_isenabled(void);
bool usb_task_cdc_dtr_active(void);
bool udi_cdc_is_rx_ready(void);
int udi_cdc_getc(void);
bool udi_cdc_is_tx_ready(void);
bool usb_task_cdc_isenabled();
bool usb_task_cdc_dtr_active();
bool udi_cdc_is_rx_ready();
int udi_cdc_getc();
bool udi_cdc_is_tx_ready();
int udi_cdc_putc(int value);
};
@@ -62,7 +62,7 @@ void MarlinSerialUSB::begin(const long baud_setting) {
void MarlinSerialUSB::end() {
}
int MarlinSerialUSB::peek(void) {
int MarlinSerialUSB::peek() {
if (pending_char >= 0)
return pending_char;
@@ -83,7 +83,7 @@ int MarlinSerialUSB::peek(void) {
return pending_char;
}
int MarlinSerialUSB::read(void) {
int MarlinSerialUSB::read() {
if (pending_char >= 0) {
int ret = pending_char;
pending_char = -1;
@@ -107,7 +107,7 @@ int MarlinSerialUSB::read(void) {
return c;
}
bool MarlinSerialUSB::available(void) {
bool MarlinSerialUSB::available() {
/* If Pending chars */
return pending_char >= 0 ||
/* or USB CDC enumerated and configured on the PC side and some
@@ -115,8 +115,8 @@ bool MarlinSerialUSB::available(void) {
(usb_task_cdc_isenabled() && udi_cdc_is_rx_ready());
}
void MarlinSerialUSB::flush(void) { }
void MarlinSerialUSB::flushTX(void) { }
void MarlinSerialUSB::flush() { }
void MarlinSerialUSB::flushTX() { }
void MarlinSerialUSB::write(const uint8_t c) {
@@ -186,7 +186,7 @@ void MarlinSerialUSB::print(double n, int digits) {
printFloat(n, digits);
}
void MarlinSerialUSB::println(void) {
void MarlinSerialUSB::println() {
print('\r');
print('\n');
}
@@ -43,11 +43,11 @@ public:
MarlinSerialUSB() {};
static void begin(const long);
static void end();
static int peek(void);
static int read(void);
static void flush(void);
static void flushTX(void);
static bool available(void);
static int peek();
static int read();
static void flush();
static void flushTX();
static bool available();
static void write(const uint8_t c);
#if ENABLED(SERIAL_STATS_DROPPED_RX)
@@ -80,7 +80,7 @@ public:
static void println(long, int = DEC);
static void println(unsigned long, int = DEC);
static void println(double, int = 2);
static void println(void);
static void println();
operator bool() { return true; }
private:
@@ -56,19 +56,19 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s
void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);
#ifdef _useTimer1
void HANDLER_FOR_TIMER1(void) { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
#endif
#ifdef _useTimer2
void HANDLER_FOR_TIMER2(void) { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); }
void HANDLER_FOR_TIMER2() { Servo_Handler(_timer2, TC_FOR_TIMER2, CHANNEL_FOR_TIMER2); }
#endif
#ifdef _useTimer3
void HANDLER_FOR_TIMER3(void) { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); }
void HANDLER_FOR_TIMER3() { Servo_Handler(_timer3, TC_FOR_TIMER3, CHANNEL_FOR_TIMER3); }
#endif
#ifdef _useTimer4
void HANDLER_FOR_TIMER4(void) { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); }
void HANDLER_FOR_TIMER4() { Servo_Handler(_timer4, TC_FOR_TIMER4, CHANNEL_FOR_TIMER4); }
#endif
#ifdef _useTimer5
void HANDLER_FOR_TIMER5(void) { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
#endif
void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) {
+1 -1
View File
@@ -31,7 +31,7 @@
#include "../../inc/MarlinConfig.h"
#include "HAL.h"
#include "HAL_timers_Due.h"
#include "timers.h"
static pin_t tone_pin;
volatile static int32_t toggles;
@@ -71,7 +71,7 @@ void spiSend(uint8_t b);
void spiSend(const uint8_t* buf, size_t n);
#include "../../shared/Marduino.h"
#include "../fastio_Due.h"
#include "../fastio.h"
void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) {
PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1,
@@ -23,6 +23,7 @@
#include "../../../inc/MarlinConfigPre.h"
#include "../../shared/Marduino.h"
#include <U8glib.h>
void u8g_SetPIOutput_DUE(u8g_t *u8g, uint8_t pin_index);
void u8g_SetPILevel_DUE(u8g_t *u8g, uint8_t pin_index, uint8_t level);
+14 -13
View File
@@ -38,45 +38,46 @@
#include "../../module/endstops.h"
// One ISR for all EXT-Interrupts
void endstop_ISR(void) { endstops.update(); }
void endstop_ISR() { endstops.update(); }
/**
* Endstop interrupts for Due based targets.
* On Due, all pins support external interrupt capability.
*/
void setup_endstop_interrupts(void) {
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
#if HAS_X_MAX
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE); // assign it
_ATTACH(X_MAX_PIN);
#endif
#if HAS_X_MIN
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(X_MIN_PIN);
#endif
#if HAS_Y_MAX
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MAX_PIN);
#endif
#if HAS_Y_MIN
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MIN_PIN);
#endif
#if HAS_Z_MAX
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MAX_PIN);
#endif
#if HAS_Z_MIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PIN);
#endif
#if HAS_Z2_MAX
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MIN_PIN);
#endif
#if HAS_Z3_MAX
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MAX_PIN);
#endif
#if HAS_Z3_MIN
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PROBE_PIN);
#endif
}
@@ -70,7 +70,7 @@
const uint32_t mask = MASK(DIO ## IO ## _PIN); \
if (V) port->PIO_SODR = mask; \
else port->PIO_CODR = mask; \
} while(0)
}while(0)
// Toggle a pin
#define _TOGGLE(IO) _WRITE(IO, !READ(IO))
@@ -33,7 +33,7 @@
#define E2END 0xFFF // Default to Flash emulated EEPROM size (EepromEmulation_Due.cpp)
#endif
extern void eeprom_flush(void);
extern void eeprom_flush();
bool PersistentStore::access_start() { return true; }
@@ -34,7 +34,7 @@
#include "../../inc/MarlinConfig.h"
#include "HAL.h"
#include "HAL_timers_Due.h"
#include "timers.h"
// ------------------------
// Local defines
+9 -9
View File
@@ -112,7 +112,7 @@
* \def unused
* \brief Marking \a v as a unused parameter or value.
*/
#define unused(v) do { (void)(v); } while(0)
#define unused(v) do { (void)(v); }while(0)
/**
* \def barrier
@@ -169,7 +169,7 @@
* heuristics and inline the function no matter how big it thinks it
* becomes.
*/
#if defined(__CC_ARM)
#ifdef __CC_ARM
# define __always_inline __forceinline
#elif (defined __GNUC__)
#ifdef __always_inline
@@ -187,7 +187,7 @@
* This annotation instructs the compiler to ignore its inlining
* heuristics and not inline the function.
*/
#if defined(__CC_ARM)
#ifdef __CC_ARM
# define __no_inline __attribute__((noinline))
#elif (defined __GNUC__)
# define __no_inline __attribute__((__noinline__))
@@ -204,7 +204,7 @@
*
* \param expr Expression to evaluate and supposed to be nonzero.
*/
#if defined(_ASSERT_ENABLE_)
#ifdef _ASSERT_ENABLE_
# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO)
// Assert() is defined in unit_test/suite.h
# include "unit_test/suite.h"
@@ -230,7 +230,7 @@
/* Define NO_INIT attribute */
#if 0 //ndef NO_INIT
#if defined ( __CC_ARM )
#ifdef __CC_ARM
# define NO_INIT __attribute__((zero_init))
#elif defined ( __ICCARM__ )
# define NO_INIT __no_init
@@ -262,7 +262,7 @@
//! @{
typedef unsigned char Bool; //!< Boolean.
#ifndef __cplusplus
#if !defined(__bool_true_false_are_defined)
#ifndef __bool_true_false_are_defined
typedef unsigned char bool; //!< Boolean.
#endif
#endif
@@ -443,7 +443,7 @@ typedef struct
#define DISABLE 0
#define ENABLE 1
#ifndef __cplusplus
#if !defined(__bool_true_false_are_defined)
#ifndef __bool_true_false_are_defined
#define false 0
#define true 1
#endif
@@ -998,14 +998,14 @@ typedef U8 Byte; //!< 8-bit unsigned integer.
#endif // #ifndef __ASSEMBLY__
#if defined(__ICCARM__)
#ifdef __ICCARM__
#define SHORTENUM __packed
#elif defined(__GNUC__)
#define SHORTENUM __attribute__((packed))
#endif
/* No operation */
#if defined(__ICCARM__)
#ifdef __ICCARM__
#define nop() __no_operation()
#elif defined(__GNUC__)
#define nop() (__NOP())
+7 -7
View File
@@ -174,11 +174,11 @@ static xSemaphoreHandle ctrl_access_semphr = NULL;
//! LUN descriptor table.
static const struct
{
Ctrl_status (*test_unit_ready)(void);
Ctrl_status (*test_unit_ready)();
Ctrl_status (*read_capacity)(U32 *);
bool (*unload)(bool);
bool (*wr_protect)(void);
bool (*removal)(void);
bool (*wr_protect)();
bool (*removal)();
#if ACCESS_USB == true
Ctrl_status (*usb_read_10)(U32, U16);
Ctrl_status (*usb_write_10)(U32, U16);
@@ -255,7 +255,7 @@ bool g_wr_protect;
#ifdef FREERTOS_USED
bool ctrl_access_init(void)
bool ctrl_access_init()
{
// If the handle to the protecting semaphore is not valid,
if (!ctrl_access_semphr)
@@ -275,7 +275,7 @@ bool ctrl_access_init(void)
*
* \return \c true if the access was successfully locked, else \c false.
*/
static bool ctrl_access_lock(void)
static bool ctrl_access_lock()
{
// If the semaphore could not be created, there is no backup solution.
if (!ctrl_access_semphr) return false;
@@ -289,7 +289,7 @@ static bool ctrl_access_lock(void)
#endif // FREERTOS_USED
U8 get_nb_lun(void)
U8 get_nb_lun()
{
#if MEM_USB == ENABLE
# ifndef Lun_usb_get_lun
@@ -310,7 +310,7 @@ U8 get_nb_lun(void)
}
U8 get_cur_lun(void)
U8 get_cur_lun()
{
return LUN_ID_0;
}
+3 -3
View File
@@ -191,7 +191,7 @@ extern bool g_wr_protect;
*
* \return \c true if the locker was successfully initialized, else \c false.
*/
extern bool ctrl_access_init(void);
extern bool ctrl_access_init();
#endif // FREERTOS_USED
@@ -199,7 +199,7 @@ extern bool ctrl_access_init(void);
*
* \return Number of LUNs in the system.
*/
extern U8 get_nb_lun(void);
extern U8 get_nb_lun();
/*! \brief Returns the current LUN.
*
@@ -207,7 +207,7 @@ extern U8 get_nb_lun(void);
*
* \todo Implement.
*/
extern U8 get_cur_lun(void);
extern U8 get_cur_lun();
/*! \brief Tests the memory state and initializes the memory if required.
*
+5 -5
View File
@@ -61,27 +61,27 @@ extern "C" {
* Below BOARD_XXX macros are related to the specific board, and
* should be defined by the board code, otherwise default value are used.
*/
#if !defined(BOARD_FREQ_SLCK_XTAL)
#ifndef BOARD_FREQ_SLCK_XTAL
# warning The board slow clock xtal frequency has not been defined.
# define BOARD_FREQ_SLCK_XTAL (32768UL)
#endif
#if !defined(BOARD_FREQ_SLCK_BYPASS)
#ifndef BOARD_FREQ_SLCK_BYPASS
# warning The board slow clock bypass frequency has not been defined.
# define BOARD_FREQ_SLCK_BYPASS (32768UL)
#endif
#if !defined(BOARD_FREQ_MAINCK_XTAL)
#ifndef BOARD_FREQ_MAINCK_XTAL
# warning The board main clock xtal frequency has not been defined.
# define BOARD_FREQ_MAINCK_XTAL (12000000UL)
#endif
#if !defined(BOARD_FREQ_MAINCK_BYPASS)
#ifndef BOARD_FREQ_MAINCK_BYPASS
# warning The board main clock bypass frequency has not been defined.
# define BOARD_FREQ_MAINCK_BYPASS (12000000UL)
#endif
#if !defined(BOARD_OSC_STARTUP_US)
#ifndef BOARD_OSC_STARTUP_US
# warning The board main clock xtal startup time has not been defined.
# define BOARD_OSC_STARTUP_US (15625UL)
#endif
@@ -15,11 +15,11 @@ extern "C" {
#define SD_MMC_BLOCK_SIZE 512
void sd_mmc_spi_mem_init(void) {
void sd_mmc_spi_mem_init() {
}
Ctrl_status sd_mmc_spi_test_unit_ready(void) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
Ctrl_status sd_mmc_spi_test_unit_ready() {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
return CTRL_GOOD;
}
@@ -27,7 +27,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready(void) {
// NOTE: This function is defined as returning the address of the last block
// in the card, which is cardSize() - 1
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
*nb_sector = card.getSd2Card().cardSize() - 1;
return CTRL_GOOD;
@@ -38,12 +38,12 @@ bool sd_mmc_spi_unload(bool unload) {
return true;
}
bool sd_mmc_spi_wr_protect(void) {
bool sd_mmc_spi_wr_protect() {
return false;
}
bool sd_mmc_spi_removal(void) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
bool sd_mmc_spi_removal() {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return true;
return false;
}
@@ -62,7 +62,7 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE];
// #define DEBUG_MMC
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC
@@ -99,7 +99,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
}
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isDetected())
if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC
+4 -4
View File
@@ -78,7 +78,7 @@
//!
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
//!/
extern void sd_mmc_spi_mem_init(void);
extern void sd_mmc_spi_mem_init();
//!
//! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
@@ -91,7 +91,7 @@ extern void sd_mmc_spi_mem_init(void);
//! Media not present -> CTRL_NO_PRESENT
//! Media has changed -> CTRL_BUSY
//!/
extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
extern Ctrl_status sd_mmc_spi_test_unit_ready();
//!
//! @brief This function gives the address of the last valid sector.
@@ -124,14 +124,14 @@ extern bool sd_mmc_spi_unload(bool unload);
//!
//! @return false -> the memory is not write-protected (always)
//!/
extern bool sd_mmc_spi_wr_protect(void);
extern bool sd_mmc_spi_wr_protect();
//!
//! @brief This function tells if the memory has been removed or not.
//!
//! @return false -> The memory isn't removed
//!
extern bool sd_mmc_spi_removal(void);
extern bool sd_mmc_spi_removal();
//---- ACCESS DATA FONCTIONS ----
+3 -3
View File
@@ -43,12 +43,12 @@
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef _SPC_PROTOCOL_H_
#define _SPC_PROTOCOL_H_
#ifndef _SPC_PROTOCOL_H_
#define _SPC_PROTOCOL_H_
/**
* \ingroup usb_msc_protocol
+2 -2
View File
@@ -71,7 +71,7 @@ extern "C" {
* \param pll_id Source of the USB clock.
* \param div Actual clock divisor. Must be superior to 0.
*/
void sysclk_enable_usb(void)
void sysclk_enable_usb()
{
Assert(CONFIG_USBCLK_DIV > 0);
@@ -103,7 +103,7 @@ void sysclk_enable_usb(void)
*
* \note This implementation does not switch off the PLL, it just turns off the USB clock.
*/
void sysclk_disable_usb(void)
void sysclk_disable_usb()
{
pmc_disable_udpck();
}
+2 -2
View File
@@ -213,8 +213,8 @@ extern "C" {
#endif
extern void sysclk_enable_usb(void);
extern void sysclk_disable_usb(void);
extern void sysclk_enable_usb();
extern void sysclk_disable_usb();
//! @}
+26 -26
View File
@@ -132,14 +132,14 @@ static uint8_t udc_string_product_name[] = USB_DEVICE_PRODUCT_NAME;
* define USB_DEVICE_GET_SERIAL_NAME_LENGTH.
*/
#if defined USB_DEVICE_GET_SERIAL_NAME_POINTER
static const uint8_t *udc_get_string_serial_name(void)
static const uint8_t *udc_get_string_serial_name()
{
return (const uint8_t *)USB_DEVICE_GET_SERIAL_NAME_POINTER;
}
# define USB_DEVICE_SERIAL_NAME_SIZE \
USB_DEVICE_GET_SERIAL_NAME_LENGTH
#elif defined USB_DEVICE_SERIAL_NAME
static const uint8_t *udc_get_string_serial_name(void)
static const uint8_t *udc_get_string_serial_name()
{
return (const uint8_t *)USB_DEVICE_SERIAL_NAME;
}
@@ -164,7 +164,7 @@ static UDC_DESC_STORAGE struct udc_string_desc_t udc_string_desc = {
};
//! @}
usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void)
usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc()
{
return udc_ptr_iface;
}
@@ -174,7 +174,7 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void)
*
* \return address after the last byte of USB Configuration descriptor
*/
static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void)
static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf()
{
return (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *)
udc_ptr_conf->desc +
@@ -360,14 +360,14 @@ static bool udc_iface_enable(uint8_t iface_num, uint8_t setting_num)
/*! \brief Start the USB Device stack
*/
void udc_start(void)
void udc_start()
{
udd_enable();
}
/*! \brief Stop the USB Device stack
*/
void udc_stop(void)
void udc_stop()
{
udd_disable();
udc_reset();
@@ -377,7 +377,7 @@ void udc_stop(void)
* \brief Reset the current configuration of the USB device,
* This routines can be called by UDD when a RESET on the USB line occurs.
*/
void udc_reset(void)
void udc_reset()
{
uint8_t iface_num;
@@ -404,7 +404,7 @@ void udc_reset(void)
#endif
}
void udc_sof_notify(void)
void udc_sof_notify()
{
uint8_t iface_num;
@@ -424,7 +424,7 @@ void udc_sof_notify(void)
*
* \return true if success
*/
static bool udc_req_std_dev_get_status(void)
static bool udc_req_std_dev_get_status()
{
if (udd_g_ctrlreq.req.wLength != sizeof(udc_device_status)) {
return false;
@@ -441,7 +441,7 @@ static bool udc_req_std_dev_get_status(void)
*
* \return true if success
*/
static bool udc_req_std_ep_get_status(void)
static bool udc_req_std_ep_get_status()
{
static le16_t udc_ep_status;
@@ -463,7 +463,7 @@ static bool udc_req_std_ep_get_status(void)
*
* \return true if success
*/
static bool udc_req_std_dev_clear_feature(void)
static bool udc_req_std_dev_clear_feature()
{
if (udd_g_ctrlreq.req.wLength) {
return false;
@@ -486,7 +486,7 @@ static bool udc_req_std_dev_clear_feature(void)
*
* \return true if success
*/
static bool udc_req_std_ep_clear_feature(void)
static bool udc_req_std_ep_clear_feature()
{
if (udd_g_ctrlreq.req.wLength) {
return false;
@@ -504,7 +504,7 @@ static bool udc_req_std_ep_clear_feature(void)
*
* \return true if success
*/
static bool udc_req_std_dev_set_feature(void)
static bool udc_req_std_dev_set_feature()
{
if (udd_g_ctrlreq.req.wLength) {
return false;
@@ -567,7 +567,7 @@ static bool udc_req_std_dev_set_feature(void)
* \return true if success
*/
#if (0!=USB_DEVICE_MAX_EP)
static bool udc_req_std_ep_set_feature(void)
static bool udc_req_std_ep_set_feature()
{
if (udd_g_ctrlreq.req.wLength) {
return false;
@@ -584,7 +584,7 @@ static bool udc_req_std_ep_set_feature(void)
* \brief Change the address of device
* Callback called at the end of request set address
*/
static void udc_valid_address(void)
static void udc_valid_address()
{
udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F);
}
@@ -594,7 +594,7 @@ static void udc_valid_address(void)
*
* \return true if success
*/
static bool udc_req_std_dev_set_address(void)
static bool udc_req_std_dev_set_address()
{
if (udd_g_ctrlreq.req.wLength) {
return false;
@@ -611,7 +611,7 @@ static bool udc_req_std_dev_set_address(void)
*
* \return true if success
*/
static bool udc_req_std_dev_get_str_desc(void)
static bool udc_req_std_dev_get_str_desc()
{
uint8_t i;
const uint8_t *str;
@@ -670,7 +670,7 @@ static bool udc_req_std_dev_get_str_desc(void)
*
* \return true if success
*/
static bool udc_req_std_dev_get_descriptor(void)
static bool udc_req_std_dev_get_descriptor()
{
uint8_t conf_num;
@@ -787,7 +787,7 @@ static bool udc_req_std_dev_get_descriptor(void)
*
* \return true if success
*/
static bool udc_req_std_dev_get_configuration(void)
static bool udc_req_std_dev_get_configuration()
{
if (udd_g_ctrlreq.req.wLength != 1) {
return false;
@@ -802,7 +802,7 @@ static bool udc_req_std_dev_get_configuration(void)
*
* \return true if success
*/
static bool udc_req_std_dev_set_configuration(void)
static bool udc_req_std_dev_set_configuration()
{
uint8_t iface_num;
@@ -867,7 +867,7 @@ static bool udc_req_std_dev_set_configuration(void)
*
* \return true if success
*/
static bool udc_req_std_iface_get_setting(void)
static bool udc_req_std_iface_get_setting()
{
uint8_t iface_num;
udi_api_t UDC_DESC_STORAGE *udi_api;
@@ -905,7 +905,7 @@ static bool udc_req_std_iface_get_setting(void)
*
* \return true if success
*/
static bool udc_req_std_iface_set_setting(void)
static bool udc_req_std_iface_set_setting()
{
uint8_t iface_num, setting_num;
@@ -933,7 +933,7 @@ static bool udc_req_std_iface_set_setting(void)
*
* \return true if the request is supported
*/
static bool udc_reqstd(void)
static bool udc_reqstd()
{
if (Udd_setup_is_in()) {
// GET Standard Requests
@@ -1027,7 +1027,7 @@ static bool udc_reqstd(void)
*
* \return true if the request is supported
*/
static bool udc_req_iface(void)
static bool udc_req_iface()
{
uint8_t iface_num;
udi_api_t UDC_DESC_STORAGE *udi_api;
@@ -1062,7 +1062,7 @@ static bool udc_req_iface(void)
*
* \return true if the request is supported
*/
static bool udc_req_ep(void)
static bool udc_req_ep()
{
uint8_t iface_num;
udi_api_t UDC_DESC_STORAGE *udi_api;
@@ -1101,7 +1101,7 @@ static bool udc_req_ep(void)
*
* \return true if the request is supported, else the request is stalled by UDD
*/
bool udc_process_setup(void)
bool udc_process_setup()
{
// By default no data (receive/send) and no callbacks registered
udd_g_ctrlreq.payload_size = 0;
+24 -24
View File
@@ -172,18 +172,18 @@ extern "C" {
}
\endcode
*/
static inline bool udc_include_vbus_monitoring(void)
static inline bool udc_include_vbus_monitoring()
{
return udd_include_vbus_monitoring();
}
/*! \brief Start the USB Device stack
*/
void udc_start(void);
void udc_start();
/*! \brief Stop the USB Device stack
*/
void udc_stop(void);
void udc_stop();
/**
* \brief Attach device to the bus when possible
@@ -192,7 +192,7 @@ void udc_stop(void);
* then it will attach device when an acceptable Vbus
* level from the host is detected.
*/
static inline void udc_attach(void)
static inline void udc_attach()
{
udd_attach();
}
@@ -203,7 +203,7 @@ static inline void udc_attach(void)
*
* The driver must remove pull-up on USB line D- or D+.
*/
static inline void udc_detach(void)
static inline void udc_detach()
{
udd_detach();
}
@@ -212,7 +212,7 @@ static inline void udc_detach(void)
/*! \brief The USB driver sends a resume signal called \e "Upstream Resume"
* This is authorized only when the remote wakeup feature is enabled by host.
*/
static inline void udc_remotewakeup(void)
static inline void udc_remotewakeup()
{
udd_send_remotewakeup();
}
@@ -223,7 +223,7 @@ static inline void udc_remotewakeup(void)
*
* \return pointer on the current interface descriptor.
*/
usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc();
//@}
@@ -334,7 +334,7 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
*
* Add to application C-file:
* \code
void usb_init(void)
void usb_init()
{
udc_start();
}
@@ -551,23 +551,23 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
#define USB_DEVICE_ATTR \
(USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED)
#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
extern void my_callback_remotewakeup_enable(void);
extern void my_callback_remotewakeup_enable();
#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
extern void my_callback_remotewakeup_disable(void);
extern void my_callback_remotewakeup_disable();
\endcode
*
* Add to application C-file:
* \code
void my_callback_remotewakeup_enable(void)
void my_callback_remotewakeup_enable()
{
// Enable application wakeup events (e.g. enable GPIO interrupt)
}
void my_callback_remotewakeup_disable(void)
void my_callback_remotewakeup_disable()
{
// Disable application wakeup events (e.g. disable GPIO interrupt)
}
void my_interrupt_event(void)
void my_interrupt_event()
{
udc_remotewakeup();
}
@@ -580,10 +580,10 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
#define USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_..._POWERED) \endcode
* - \code // Define callback called when the host enables the remotewakeup feature
#define UDC_REMOTEWAKEUP_ENABLE() my_callback_remotewakeup_enable()
extern void my_callback_remotewakeup_enable(void); \endcode
extern void my_callback_remotewakeup_enable(); \endcode
* - \code // Define callback called when the host disables the remotewakeup feature
#define UDC_REMOTEWAKEUP_DISABLE() my_callback_remotewakeup_disable()
extern void my_callback_remotewakeup_disable(void); \endcode
extern void my_callback_remotewakeup_disable(); \endcode
* -# Send a remote wakeup (USB upstream):
* - \code udc_remotewakeup(); \endcode
*/
@@ -605,18 +605,18 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
* \code
#define USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED)
#define UDC_SUSPEND_EVENT() user_callback_suspend_action()
extern void user_callback_suspend_action(void)
extern void user_callback_suspend_action()
#define UDC_RESUME_EVENT() user_callback_resume_action()
extern void user_callback_resume_action(void)
extern void user_callback_resume_action()
\endcode
*
* Add to application C-file:
* \code
void user_callback_suspend_action(void)
void user_callback_suspend_action()
{
// Disable hardware component to reduce power consumption
}
void user_callback_resume_action(void)
void user_callback_resume_action()
{
// Re-enable hardware component
}
@@ -628,12 +628,12 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
#define USB_DEVICE_ATTR (USB_CONFIG_ATTR_BUS_POWERED) \endcode
* - \code // Define callback called when the host suspend the USB line
#define UDC_SUSPEND_EVENT() user_callback_suspend_action()
extern void user_callback_suspend_action(void); \endcode
extern void user_callback_suspend_action(); \endcode
* - \code // Define callback called when the host or device resume the USB line
#define UDC_RESUME_EVENT() user_callback_resume_action()
extern void user_callback_resume_action(void); \endcode
extern void user_callback_resume_action(); \endcode
* -# Reduce power consumption in suspend mode (max. 2.5mA on Vbus):
* - \code void user_callback_suspend_action(void)
* - \code void user_callback_suspend_action()
{
turn_off_components();
} \endcode
@@ -664,7 +664,7 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
* \code
uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH];
void init_build_usb_serial_number(void)
void init_build_usb_serial_number()
{
serial_number[0] = 'A';
serial_number[1] = 'B';
@@ -683,7 +683,7 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
* - \code
uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH];
void init_build_usb_serial_number(void)
void init_build_usb_serial_number()
{
serial_number[0] = 'A';
serial_number[1] = 'B';
+20 -20
View File
@@ -94,11 +94,11 @@ typedef struct {
uint16_t payload_size;
//! Callback called after reception of ZLP from setup request
void (*callback) (void);
void (*callback)();
//! Callback called when the buffer given (.payload) is full or empty.
//! This one return false to abort data transfer, or true with a new buffer in .payload.
bool(*over_under_run) (void);
bool (*over_under_run)();
} udd_ctrl_request_t;
extern udd_ctrl_request_t udd_g_ctrlreq;
@@ -123,7 +123,7 @@ extern udd_ctrl_request_t udd_g_ctrlreq;
* Registered by routine udd_ep_wait_stall_clear()
* Callback called when endpoint stall is cleared.
*/
typedef void (*udd_callback_halt_cleared_t) (void);
typedef void (*udd_callback_halt_cleared_t)();
/**
* \brief End of transfer callback function type.
@@ -142,17 +142,17 @@ typedef void (*udd_callback_trans_t) (udd_ep_status_t status,
*
* \return true, if the VBUS monitoring is possible.
*/
bool udd_include_vbus_monitoring(void);
bool udd_include_vbus_monitoring();
/**
* \brief Enables the USB Device mode
*/
void udd_enable(void);
void udd_enable();
/**
* \brief Disables the USB Device mode
*/
void udd_disable(void);
void udd_disable();
/**
* \brief Attach device to the bus when possible
@@ -161,14 +161,14 @@ void udd_disable(void);
* then it will attach device when an acceptable Vbus
* level from the host is detected.
*/
void udd_attach(void);
void udd_attach();
/**
* \brief Detaches the device from the bus
*
* The driver must remove pull-up on USB line D- or D+.
*/
void udd_detach(void);
void udd_detach();
/**
* \brief Test whether the USB Device Controller is running at high
@@ -176,7 +176,7 @@ void udd_detach(void);
*
* \return \c true if the Device is running at high speed mode, otherwise \c false.
*/
bool udd_is_high_speed(void);
bool udd_is_high_speed();
/**
* \brief Changes the USB address of device
@@ -190,25 +190,25 @@ void udd_set_address(uint8_t address);
*
* \return USB address
*/
uint8_t udd_getaddress(void);
uint8_t udd_getaddress();
/**
* \brief Returns the current start of frame number
*
* \return current start of frame number.
*/
uint16_t udd_get_frame_number(void);
uint16_t udd_get_frame_number();
/**
* \brief Returns the current micro start of frame number
*
* \return current micro start of frame number required in high speed mode.
*/
uint16_t udd_get_micro_frame_number(void);
uint16_t udd_get_micro_frame_number();
/*! \brief The USB driver sends a resume signal called Upstream Resume
*/
void udd_send_remotewakeup(void);
void udd_send_remotewakeup();
/**
* \brief Load setup payload
@@ -346,10 +346,10 @@ void udd_ep_abort(udd_ep_id_t ep);
* The following functions allow the device to jump to a specific test mode required in high speed mode.
*/
//@{
void udd_test_mode_j(void);
void udd_test_mode_k(void);
void udd_test_mode_se0_nak(void);
void udd_test_mode_packet(void);
void udd_test_mode_j();
void udd_test_mode_k();
void udd_test_mode_se0_nak();
void udd_test_mode_packet();
//@}
@@ -370,21 +370,21 @@ void udd_test_mode_packet(void);
*
* \return \c 1 if the request is accepted, otherwise \c 0.
*/
extern bool udc_process_setup(void);
extern bool udc_process_setup();
/**
* \brief Reset the UDC
*
* The UDC must reset all configuration.
*/
extern void udc_reset(void);
extern void udc_reset();
/**
* \brief To signal that a SOF is occurred
*
* The UDC must send the signal to all UDIs enabled
*/
extern void udc_sof_notify(void);
extern void udc_sof_notify();
//@}
+5 -5
View File
@@ -82,7 +82,7 @@ typedef struct {
*
* \return \c 1 if function was successfully done, otherwise \c 0.
*/
bool(*enable) (void);
bool (*enable)();
/**
* \brief Disable the interface.
@@ -95,7 +95,7 @@ typedef struct {
* - the device is detached from the host (i.e. Vbus is no
* longer present)
*/
void (*disable) (void);
void (*disable)();
/**
* \brief Handle a control request directed at an interface.
@@ -108,7 +108,7 @@ typedef struct {
*
* \return \c 1 if this interface supports the SETUP request, otherwise \c 0.
*/
bool(*setup) (void);
bool (*setup)();
/**
* \brief Returns the current setting of the selected interface.
@@ -117,12 +117,12 @@ typedef struct {
*
* \return alternate setting of selected interface
*/
uint8_t(*getsetting) (void);
uint8_t (*getsetting)();
/**
* \brief To signal that a SOF is occurred
*/
void(*sof_notify) (void);
void (*sof_notify)();
} udi_api_t;
//@}
+28 -28
View File
@@ -84,14 +84,14 @@
*
* @{
*/
bool udi_cdc_comm_enable(void);
void udi_cdc_comm_disable(void);
bool udi_cdc_comm_setup(void);
bool udi_cdc_data_enable(void);
void udi_cdc_data_disable(void);
bool udi_cdc_data_setup(void);
uint8_t udi_cdc_getsetting(void);
void udi_cdc_data_sof_notify(void);
bool udi_cdc_comm_enable();
void udi_cdc_comm_disable();
bool udi_cdc_comm_setup();
bool udi_cdc_data_enable();
void udi_cdc_data_disable();
bool udi_cdc_data_setup();
uint8_t udi_cdc_getsetting();
void udi_cdc_data_sof_notify();
UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = {
.enable = udi_cdc_comm_enable,
.disable = udi_cdc_comm_disable,
@@ -130,14 +130,14 @@ UDC_DESC_STORAGE udi_api_t udi_api_cdc_data = {
*
* \return port number
*/
static uint8_t udi_cdc_setup_to_port(void);
static uint8_t udi_cdc_setup_to_port();
/**
* \brief Sends line coding to application
*
* Called after SETUP request when line coding data is received.
*/
static void udi_cdc_line_coding_received(void);
static void udi_cdc_line_coding_received();
/**
* \brief Records new state
@@ -267,7 +267,7 @@ static volatile bool udi_cdc_tx_both_buf_to_send[UDI_CDC_PORT_NB];
//@}
bool udi_cdc_comm_enable(void)
bool udi_cdc_comm_enable()
{
uint8_t port;
uint8_t iface_comm_num;
@@ -321,7 +321,7 @@ bool udi_cdc_comm_enable(void)
return true;
}
bool udi_cdc_data_enable(void)
bool udi_cdc_data_enable()
{
uint8_t port;
@@ -360,13 +360,13 @@ bool udi_cdc_data_enable(void)
return true;
}
void udi_cdc_comm_disable(void)
void udi_cdc_comm_disable()
{
Assert(udi_cdc_nb_comm_enabled != 0);
udi_cdc_nb_comm_enabled--;
}
void udi_cdc_data_disable(void)
void udi_cdc_data_disable()
{
uint8_t port;
@@ -377,7 +377,7 @@ void udi_cdc_data_disable(void)
udi_cdc_data_running = false;
}
bool udi_cdc_comm_setup(void)
bool udi_cdc_comm_setup()
{
uint8_t port = udi_cdc_setup_to_port();
@@ -433,17 +433,17 @@ bool udi_cdc_comm_setup(void)
return false; // request Not supported
}
bool udi_cdc_data_setup(void)
bool udi_cdc_data_setup()
{
return false; // request Not supported
}
uint8_t udi_cdc_getsetting(void)
uint8_t udi_cdc_getsetting()
{
return 0; // CDC don't have multiple alternate setting
}
void udi_cdc_data_sof_notify(void)
void udi_cdc_data_sof_notify()
{
static uint8_t port_notify = 0;
@@ -461,7 +461,7 @@ void udi_cdc_data_sof_notify(void)
// ------------------------
//------- Internal routines to control serial line
static uint8_t udi_cdc_setup_to_port(void)
static uint8_t udi_cdc_setup_to_port()
{
uint8_t port;
@@ -479,7 +479,7 @@ static uint8_t udi_cdc_setup_to_port(void)
return port;
}
static void udi_cdc_line_coding_received(void)
static void udi_cdc_line_coding_received()
{
uint8_t port = udi_cdc_setup_to_port();
UNUSED(port);
@@ -797,17 +797,17 @@ void udi_cdc_ctrl_signal_dsr(bool b_set)
udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR);
}
void udi_cdc_signal_framing_error(void)
void udi_cdc_signal_framing_error()
{
udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING);
}
void udi_cdc_signal_parity_error(void)
void udi_cdc_signal_parity_error()
{
udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY);
}
void udi_cdc_signal_overrun(void)
void udi_cdc_signal_overrun()
{
udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN);
}
@@ -853,7 +853,7 @@ iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port)
return nb_received;
}
iram_size_t udi_cdc_get_nb_received_data(void)
iram_size_t udi_cdc_get_nb_received_data()
{
return udi_cdc_multi_get_nb_received_data(0);
}
@@ -863,7 +863,7 @@ bool udi_cdc_multi_is_rx_ready(uint8_t port)
return (udi_cdc_multi_get_nb_received_data(port) > 0);
}
bool udi_cdc_is_rx_ready(void)
bool udi_cdc_is_rx_ready()
{
return udi_cdc_multi_is_rx_ready(0);
}
@@ -912,7 +912,7 @@ udi_cdc_getc_process_one_byte:
return rx_data;
}
int udi_cdc_getc(void)
int udi_cdc_getc()
{
return udi_cdc_multi_getc(0);
}
@@ -1041,7 +1041,7 @@ iram_size_t __attribute__((optimize("O0"))) udi_cdc_multi_get_free_tx_buffer(uin
return retval;
}
iram_size_t udi_cdc_get_free_tx_buffer(void)
iram_size_t udi_cdc_get_free_tx_buffer()
{
return udi_cdc_multi_get_free_tx_buffer(0);
}
@@ -1051,7 +1051,7 @@ bool udi_cdc_multi_is_tx_ready(uint8_t port)
return (udi_cdc_multi_get_free_tx_buffer(port) != 0);
}
bool udi_cdc_is_tx_ready(void)
bool udi_cdc_is_tx_ready()
{
return udi_cdc_multi_is_tx_ready(0);
}
+17 -17
View File
@@ -55,7 +55,7 @@
#include "udi.h"
// Check the number of port
#ifndef UDI_CDC_PORT_NB
#ifndef UDI_CDC_PORT_NB
# define UDI_CDC_PORT_NB 1
#endif
#if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7)
@@ -366,38 +366,38 @@ void udi_cdc_ctrl_signal_dsr(bool b_set);
/**
* \brief Notify a framing error
*/
void udi_cdc_signal_framing_error(void);
void udi_cdc_signal_framing_error();
/**
* \brief Notify a parity error
*/
void udi_cdc_signal_parity_error(void);
void udi_cdc_signal_parity_error();
/**
* \brief Notify a overrun
*/
void udi_cdc_signal_overrun(void);
void udi_cdc_signal_overrun();
/**
* \brief Gets the number of byte received
*
* \return the number of data available
*/
iram_size_t udi_cdc_get_nb_received_data(void);
iram_size_t udi_cdc_get_nb_received_data();
/**
* \brief This function checks if a character has been received on the CDC line
*
* \return \c 1 if a byte is ready to be read.
*/
bool udi_cdc_is_rx_ready(void);
bool udi_cdc_is_rx_ready();
/**
* \brief Waits and gets a value on CDC line
*
* \return value read on CDC line
*/
int udi_cdc_getc(void);
int udi_cdc_getc();
/**
* \brief Reads a RAM buffer on CDC line
@@ -425,7 +425,7 @@ iram_size_t udi_cdc_read_no_polling(void* buf, iram_size_t size);
*
* \return the number of free byte in TX buffer
*/
iram_size_t udi_cdc_get_free_tx_buffer(void);
iram_size_t udi_cdc_get_free_tx_buffer();
/**
* \brief This function checks if a new character sent is possible
@@ -433,7 +433,7 @@ iram_size_t udi_cdc_get_free_tx_buffer(void);
*
* \return \c 1 if a new character can be sent
*/
bool udi_cdc_is_tx_ready(void);
bool udi_cdc_is_tx_ready();
/**
* \brief Puts a byte on CDC line
@@ -611,9 +611,9 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t s
* Content of conf_usb.h:
* \code
#define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
extern bool my_callback_cdc_enable(void);
extern bool my_callback_cdc_enable();
#define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable()
extern void my_callback_cdc_disable(void);
extern void my_callback_cdc_disable();
#define UDI_CDC_LOW_RATE
#define UDI_CDC_DEFAULT_RATE 115200
@@ -627,17 +627,17 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t s
* Add to application C-file:
* \code
static bool my_flag_autorize_cdc_transfert = false;
bool my_callback_cdc_enable(void)
bool my_callback_cdc_enable()
{
my_flag_autorize_cdc_transfert = true;
return true;
}
void my_callback_cdc_disable(void)
void my_callback_cdc_disable()
{
my_flag_autorize_cdc_transfert = false;
}
void task(void)
void task()
{
if (my_flag_autorize_cdc_transfert) {
udi_cdc_putc('A');
@@ -652,14 +652,14 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t s
* - \code #define USB_DEVICE_SERIAL_NAME "12...EF" // Disk SN for CDC \endcode
* \note The USB serial number is mandatory when a CDC interface is used.
* - \code #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
extern bool my_callback_cdc_enable(void); \endcode
extern bool my_callback_cdc_enable(); \endcode
* \note After the device enumeration (detecting and identifying USB devices),
* the USB host starts the device configuration. When the USB CDC interface
* from the device is accepted by the host, the USB host enables this interface and the
* UDI_CDC_ENABLE_EXT() callback function is called and return true.
* Thus, when this event is received, the data transfer on CDC interface are authorized.
* - \code #define UDI_CDC_DISABLE_EXT(port) my_callback_cdc_disable()
extern void my_callback_cdc_disable(void); \endcode
extern void my_callback_cdc_disable(); \endcode
* \note When the USB device is unplugged or is reset by the USB host, the USB
* interface is disabled and the UDI_CDC_DISABLE_EXT() callback function
* is called. Thus, the data transfer must be stopped on CDC interface.
@@ -673,7 +673,7 @@ iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t s
* \note Default configuration of communication port at startup.
* -# Send or wait data on CDC line:
* - \code // Waits and gets a value on CDC line
int udi_cdc_getc(void);
int udi_cdc_getc();
// Reads a RAM buffer on CDC line
iram_size_t udi_cdc_read_buf(int* buf, iram_size_t size);
// Puts a byte on CDC line
+1 -1
View File
@@ -50,7 +50,7 @@
#include "usb_protocol_cdc.h"
#include "conf_usb.h"
#ifndef UDI_CDC_PORT_NB
#ifndef UDI_CDC_PORT_NB
# define UDI_CDC_PORT_NB 1
#endif
+49 -49
View File
@@ -71,10 +71,10 @@
*
* @{
*/
bool udi_msc_enable(void);
void udi_msc_disable(void);
bool udi_msc_setup(void);
uint8_t udi_msc_getsetting(void);
bool udi_msc_enable();
void udi_msc_disable();
bool udi_msc_setup();
uint8_t udi_msc_getsetting();
//! Global structure which contains standard UDI API for UDC
UDC_DESC_STORAGE udi_api_t udi_api_msc = {
@@ -151,12 +151,12 @@ volatile bool udi_msc_b_reset_trans = true;
/**
* \brief Stall CBW request
*/
static void udi_msc_cbw_invalid(void);
static void udi_msc_cbw_invalid();
/**
* \brief Stall CSW request
*/
static void udi_msc_csw_invalid(void);
static void udi_msc_csw_invalid();
/**
* \brief Links a callback and buffer on endpoint OUT reception
@@ -165,7 +165,7 @@ static void udi_msc_csw_invalid(void);
* - enable interface
* - at the end of previous command after sending the CSW
*/
static void udi_msc_cbw_wait(void);
static void udi_msc_cbw_wait();
/**
* \brief Callback called after CBW reception
@@ -228,7 +228,7 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
*
* Called at the end of SCSI command
*/
static void udi_msc_csw_process(void);
static void udi_msc_csw_process();
/**
* \brief Sends CSW
@@ -236,7 +236,7 @@ static void udi_msc_csw_process(void);
* Called by #udi_msc_csw_process()
* or UDD callback when endpoint halt is cleared
*/
void udi_msc_csw_send(void);
void udi_msc_csw_send();
/**
* \brief Callback called after CSW sent
@@ -259,7 +259,7 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
/**
* \brief Reinitialize sense data.
*/
static void udi_msc_clear_sense(void);
static void udi_msc_clear_sense();
/**
* \brief Update sense data with new value to signal a fail
@@ -274,37 +274,37 @@ static void udi_msc_sense_fail(uint8_t sense_key, uint16_t add_sense,
/**
* \brief Update sense data with new value to signal success
*/
static void udi_msc_sense_pass(void);
static void udi_msc_sense_pass();
/**
* \brief Update sense data to signal that memory is not present
*/
static void udi_msc_sense_fail_not_present(void);
static void udi_msc_sense_fail_not_present();
/**
* \brief Update sense data to signal that memory is busy
*/
static void udi_msc_sense_fail_busy_or_change(void);
static void udi_msc_sense_fail_busy_or_change();
/**
* \brief Update sense data to signal a hardware error on memory
*/
static void udi_msc_sense_fail_hardware(void);
static void udi_msc_sense_fail_hardware();
/**
* \brief Update sense data to signal that memory is protected
*/
static void udi_msc_sense_fail_protected(void);
static void udi_msc_sense_fail_protected();
/**
* \brief Update sense data to signal that CDB fields are not valid
*/
static void udi_msc_sense_fail_cdb_invalid(void);
static void udi_msc_sense_fail_cdb_invalid();
/**
* \brief Update sense data to signal that command is not supported
*/
static void udi_msc_sense_command_invalid(void);
static void udi_msc_sense_command_invalid();
//@}
@@ -317,31 +317,31 @@ static void udi_msc_sense_command_invalid(void);
* \brief Process SPC Request Sense command
* Returns error information about last command
*/
static void udi_msc_spc_requestsense(void);
static void udi_msc_spc_requestsense();
/**
* \brief Process SPC Inquiry command
* Returns information (name,version) about disk
*/
static void udi_msc_spc_inquiry(void);
static void udi_msc_spc_inquiry();
/**
* \brief Checks state of disk
*
* \retval true if disk is ready, otherwise false and updates sense data
*/
static bool udi_msc_spc_testunitready_global(void);
static bool udi_msc_spc_testunitready_global();
/**
* \brief Process test unit ready command
* Returns state of logical unit
*/
static void udi_msc_spc_testunitready(void);
static void udi_msc_spc_testunitready();
/**
* \brief Process prevent allow medium removal command
*/
static void udi_msc_spc_prevent_allow_medium_removal(void);
static void udi_msc_spc_prevent_allow_medium_removal();
/**
* \brief Process mode sense command
@@ -354,12 +354,12 @@ static void udi_msc_spc_mode_sense(bool b_sense10);
/**
* \brief Process start stop command
*/
static void udi_msc_sbc_start_stop(void);
static void udi_msc_sbc_start_stop();
/**
* \brief Process read capacity command
*/
static void udi_msc_sbc_read_capacity(void);
static void udi_msc_sbc_read_capacity();
/**
* \brief Process read10 or write10 command
@@ -373,7 +373,7 @@ static void udi_msc_sbc_trans(bool b_read);
//@}
bool udi_msc_enable(void)
bool udi_msc_enable()
{
uint8_t lun;
udi_msc_b_trans_req = false;
@@ -398,7 +398,7 @@ bool udi_msc_enable(void)
}
void udi_msc_disable(void)
void udi_msc_disable()
{
udi_msc_b_trans_req = false;
udi_msc_b_ack_trans = true;
@@ -407,7 +407,7 @@ void udi_msc_disable(void)
}
bool udi_msc_setup(void)
bool udi_msc_setup()
{
if (Udd_setup_is_in()) {
// Requests Interface GET
@@ -451,7 +451,7 @@ bool udi_msc_setup(void)
return false; // Not supported request
}
uint8_t udi_msc_getsetting(void)
uint8_t udi_msc_getsetting()
{
return 0; // MSC don't have multiple alternate setting
}
@@ -460,7 +460,7 @@ uint8_t udi_msc_getsetting(void)
// ------------------------
//------- Routines to process CBW packet
static void udi_msc_cbw_invalid(void)
static void udi_msc_cbw_invalid()
{
if (!udi_msc_b_cbw_invalid)
return; // Don't re-stall endpoint if error reseted by setup
@@ -469,7 +469,7 @@ static void udi_msc_cbw_invalid(void)
udd_ep_wait_stall_clear(UDI_MSC_EP_OUT, udi_msc_cbw_invalid);
}
static void udi_msc_csw_invalid(void)
static void udi_msc_csw_invalid()
{
if (!udi_msc_b_cbw_invalid)
return; // Don't re-stall endpoint if error reseted by setup
@@ -478,7 +478,7 @@ static void udi_msc_csw_invalid(void)
udd_ep_wait_stall_clear(UDI_MSC_EP_IN, udi_msc_csw_invalid);
}
static void udi_msc_cbw_wait(void)
static void udi_msc_cbw_wait()
{
// Register buffer and callback on OUT endpoint
if (!udd_ep_run(UDI_MSC_EP_OUT, true,
@@ -648,7 +648,7 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
// ------------------------
//------- Routines to process CSW packet
static void udi_msc_csw_process(void)
static void udi_msc_csw_process()
{
if (0 != udi_msc_csw.dCSWDataResidue) {
// Residue not NULL
@@ -665,7 +665,7 @@ static void udi_msc_csw_process(void)
}
void udi_msc_csw_send(void)
void udi_msc_csw_send()
{
// Sends CSW on IN endpoint
if (!udd_ep_run(UDI_MSC_EP_IN, false,
@@ -694,7 +694,7 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
// ------------------------
//------- Routines manage sense data
static void udi_msc_clear_sense(void)
static void udi_msc_clear_sense()
{
memset((uint8_t*)&udi_msc_sense, 0, sizeof(struct scsi_request_sense_data));
udi_msc_sense.valid_reponse_code = SCSI_SENSE_VALID | SCSI_SENSE_CURRENT;
@@ -715,42 +715,42 @@ static void udi_msc_sense_fail(uint8_t sense_key, uint16_t add_sense,
udi_msc_sense.AddSnsCodeQlfr = add_sense;
}
static void udi_msc_sense_pass(void)
static void udi_msc_sense_pass()
{
udi_msc_clear_sense();
udi_msc_csw.bCSWStatus = USB_CSW_STATUS_PASS;
}
static void udi_msc_sense_fail_not_present(void)
static void udi_msc_sense_fail_not_present()
{
udi_msc_sense_fail(SCSI_SK_NOT_READY, SCSI_ASC_MEDIUM_NOT_PRESENT, 0);
}
static void udi_msc_sense_fail_busy_or_change(void)
static void udi_msc_sense_fail_busy_or_change()
{
udi_msc_sense_fail(SCSI_SK_UNIT_ATTENTION,
SCSI_ASC_NOT_READY_TO_READY_CHANGE, 0);
}
static void udi_msc_sense_fail_hardware(void)
static void udi_msc_sense_fail_hardware()
{
udi_msc_sense_fail(SCSI_SK_HARDWARE_ERROR,
SCSI_ASC_NO_ADDITIONAL_SENSE_INFO, 0);
}
static void udi_msc_sense_fail_protected(void)
static void udi_msc_sense_fail_protected()
{
udi_msc_sense_fail(SCSI_SK_DATA_PROTECT, SCSI_ASC_WRITE_PROTECTED, 0);
}
static void udi_msc_sense_fail_cdb_invalid(void)
static void udi_msc_sense_fail_cdb_invalid()
{
udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST,
SCSI_ASC_INVALID_FIELD_IN_CDB, 0);
}
static void udi_msc_sense_command_invalid(void)
static void udi_msc_sense_command_invalid()
{
udi_msc_sense_fail(SCSI_SK_ILLEGAL_REQUEST,
SCSI_ASC_INVALID_COMMAND_OPERATION_CODE, 0);
@@ -760,7 +760,7 @@ static void udi_msc_sense_command_invalid(void)
// ------------------------
//------- Routines manage SCSI Commands
static void udi_msc_spc_requestsense(void)
static void udi_msc_spc_requestsense()
{
uint8_t length = udi_msc_cbw.CDB[4];
@@ -775,7 +775,7 @@ static void udi_msc_spc_requestsense(void)
}
static void udi_msc_spc_inquiry(void)
static void udi_msc_spc_inquiry()
{
uint8_t length, i;
UDC_DATA(4)
@@ -836,7 +836,7 @@ static void udi_msc_spc_inquiry(void)
}
static bool udi_msc_spc_testunitready_global(void)
static bool udi_msc_spc_testunitready_global()
{
switch (mem_test_unit_ready(udi_msc_cbw.bCBWLUN)) {
case CTRL_GOOD:
@@ -856,7 +856,7 @@ static bool udi_msc_spc_testunitready_global(void)
}
static void udi_msc_spc_testunitready(void)
static void udi_msc_spc_testunitready()
{
if (udi_msc_spc_testunitready_global()) {
// LUN ready, then update sense data with status pass
@@ -944,7 +944,7 @@ static void udi_msc_spc_mode_sense(bool b_sense10)
}
static void udi_msc_spc_prevent_allow_medium_removal(void)
static void udi_msc_spc_prevent_allow_medium_removal()
{
uint8_t prevent = udi_msc_cbw.CDB[4];
if (0 == prevent) {
@@ -956,7 +956,7 @@ static void udi_msc_spc_prevent_allow_medium_removal(void)
}
static void udi_msc_sbc_start_stop(void)
static void udi_msc_sbc_start_stop()
{
bool start = 0x1 & udi_msc_cbw.CDB[4];
bool loej = 0x2 & udi_msc_cbw.CDB[4];
@@ -968,7 +968,7 @@ static void udi_msc_sbc_start_stop(void)
}
static void udi_msc_sbc_read_capacity(void)
static void udi_msc_sbc_read_capacity()
{
UDC_BSS(4) static struct sbc_read_capacity10_data udi_msc_capacity;
@@ -1039,7 +1039,7 @@ static void udi_msc_sbc_trans(bool b_read)
}
bool udi_msc_process_trans(void)
bool udi_msc_process_trans()
{
Ctrl_status status;
+10 -10
View File
@@ -148,7 +148,7 @@ typedef struct {
*
* Routine called by the main loop
*/
bool udi_msc_process_trans(void);
bool udi_msc_process_trans();
/**
* \brief Transfers data to/from USB MSC endpoints
@@ -206,26 +206,26 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
#define UDI_MSC_GLOBAL_PRODUCT_VERSION \
'1', '.', '0', '0'
#define UDI_MSC_ENABLE_EXT() my_callback_msc_enable()
extern bool my_callback_msc_enable(void);
extern bool my_callback_msc_enable();
#define UDI_MSC_DISABLE_EXT() my_callback_msc_disable()
extern void my_callback_msc_disable(void);
extern void my_callback_msc_disable();
#include "udi_msc_conf.h" // At the end of conf_usb.h file
\endcode
*
* Add to application C-file:
* \code
static bool my_flag_autorize_msc_transfert = false;
bool my_callback_msc_enable(void)
bool my_callback_msc_enable()
{
my_flag_autorize_msc_transfert = true;
return true;
}
void my_callback_msc_disable(void)
void my_callback_msc_disable()
{
my_flag_autorize_msc_transfert = false;
}
void task(void)
void task()
{
udi_msc_process_trans();
}
@@ -244,7 +244,7 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
* \note The USB MSC interface requires a vendor ID (8 ASCII characters)
* and a product version (4 ASCII characters).
* - \code #define UDI_MSC_ENABLE_EXT() my_callback_msc_enable()
extern bool my_callback_msc_enable(void); \endcode
extern bool my_callback_msc_enable(); \endcode
* \note After the device enumeration (detecting and identifying USB devices),
* the USB host starts the device configuration. When the USB MSC interface
* from the device is accepted by the host, the USB host enables this interface and the
@@ -252,7 +252,7 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
* Thus, when this event is received, the tasks which call
* udi_msc_process_trans() must be enabled.
* - \code #define UDI_MSC_DISABLE_EXT() my_callback_msc_disable()
extern void my_callback_msc_disable(void); \endcode
extern void my_callback_msc_disable(); \endcode
* \note When the USB device is unplugged or is reset by the USB host, the USB
* interface is disabled and the UDI_MSC_DISABLE_EXT() callback function
* is called. Thus, it is recommended to disable the task which is called udi_msc_process_trans().
@@ -260,14 +260,14 @@ bool udi_msc_trans_block(bool b_read, uint8_t * block, iram_size_t block_size,
* which provides the memories interfaces. However, the memory data transfers
* must be done outside USB interrupt routine. This is done in the MSC process
* ("udi_msc_process_trans()") called by main loop:
* - \code * void task(void) {
* - \code * void task() {
udi_msc_process_trans();
} \endcode
* -# The MSC speed depends on task periodicity. To get the best speed
* the notification callback "UDI_MSC_NOTIFY_TRANS_EXT" can be used to wakeup
* this task (Example, through a mutex):
* - \code #define UDI_MSC_NOTIFY_TRANS_EXT() msc_notify_trans()
void msc_notify_trans(void) {
void msc_notify_trans() {
wakeup_my_task();
} \endcode
*
+46 -46
View File
@@ -357,41 +357,41 @@ static uint16_t udd_ctrl_payload_buf_cnt;
*
* Called after a USB line reset or when UDD is enabled
*/
static void udd_reset_ep_ctrl(void);
static void udd_reset_ep_ctrl();
/**
* \brief Reset control endpoint management
*
* Called after a USB line reset or at the end of SETUP request (after ZLP)
*/
static void udd_ctrl_init(void);
static void udd_ctrl_init();
//! \brief Managed reception of SETUP packet on control endpoint
static void udd_ctrl_setup_received(void);
static void udd_ctrl_setup_received();
//! \brief Managed reception of IN packet on control endpoint
static void udd_ctrl_in_sent(void);
static void udd_ctrl_in_sent();
//! \brief Managed reception of OUT packet on control endpoint
static void udd_ctrl_out_received(void);
static void udd_ctrl_out_received();
//! \brief Managed underflow event of IN packet on control endpoint
static void udd_ctrl_underflow(void);
static void udd_ctrl_underflow();
//! \brief Managed overflow event of OUT packet on control endpoint
static void udd_ctrl_overflow(void);
static void udd_ctrl_overflow();
//! \brief Managed stall event of IN/OUT packet on control endpoint
static void udd_ctrl_stall_data(void);
static void udd_ctrl_stall_data();
//! \brief Send a ZLP IN on control endpoint
static void udd_ctrl_send_zlp_in(void);
static void udd_ctrl_send_zlp_in();
//! \brief Send a ZLP OUT on control endpoint
static void udd_ctrl_send_zlp_out(void);
static void udd_ctrl_send_zlp_out();
//! \brief Call callback associated to setup request
static void udd_ctrl_endofrequest(void);
static void udd_ctrl_endofrequest();
/**
@@ -401,7 +401,7 @@ static void udd_ctrl_endofrequest(void);
*
* \return \c 1 if an event about control endpoint is occured, otherwise \c 0.
*/
static bool udd_ctrl_interrupt(void);
static bool udd_ctrl_interrupt();
//@}
@@ -448,10 +448,10 @@ typedef struct {
static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP];
//! \brief Reset all job table
static void udd_ep_job_table_reset(void);
static void udd_ep_job_table_reset();
//! \brief Abort all endpoint jobs on going
static void udd_ep_job_table_kill(void);
static void udd_ep_job_table_kill();
#ifdef UDD_EP_FIFO_SUPPORTED
/**
@@ -500,7 +500,7 @@ static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_n
*
* \return \c 1 if an event about bulk/interrupt/isochronous endpoints has occured, otherwise \c 0.
*/
static bool udd_ep_interrupt(void);
static bool udd_ep_interrupt();
#endif // (0!=USB_DEVICE_MAX_EP)
//@}
@@ -524,8 +524,8 @@ static bool udd_ep_interrupt(void);
* See Technical reference $3.8.3 Masking interrupt requests in peripheral modules.
*/
#ifdef UHD_ENABLE
void udd_interrupt(void);
void udd_interrupt(void)
void udd_interrupt();
void udd_interrupt()
#else
ISR(UDD_USB_INT_FUN)
#endif
@@ -643,13 +643,13 @@ udd_interrupt_sof_end:
}
bool udd_include_vbus_monitoring(void)
bool udd_include_vbus_monitoring()
{
return true;
}
void udd_enable(void)
void udd_enable()
{
irqflags_t flags;
@@ -736,7 +736,7 @@ void udd_enable(void)
}
void udd_disable(void)
void udd_disable()
{
irqflags_t flags;
@@ -777,7 +777,7 @@ void udd_disable(void)
}
void udd_attach(void)
void udd_attach()
{
irqflags_t flags;
flags = cpu_irq_save();
@@ -818,7 +818,7 @@ void udd_attach(void)
}
void udd_detach(void)
void udd_detach()
{
otg_unfreeze_clock();
@@ -829,7 +829,7 @@ void udd_detach(void)
}
bool udd_is_high_speed(void)
bool udd_is_high_speed()
{
#ifdef USB_DEVICE_HS_SUPPORT
return !Is_udd_full_speed_mode();
@@ -847,23 +847,23 @@ void udd_set_address(uint8_t address)
}
uint8_t udd_getaddress(void)
uint8_t udd_getaddress()
{
return udd_get_configured_address();
}
uint16_t udd_get_frame_number(void)
uint16_t udd_get_frame_number()
{
return udd_frame_number();
}
uint16_t udd_get_micro_frame_number(void)
uint16_t udd_get_micro_frame_number()
{
return udd_micro_frame_number();
}
void udd_send_remotewakeup(void)
void udd_send_remotewakeup()
{
#ifndef UDD_NO_SLEEP_MGR
if (!udd_b_idle)
@@ -1242,27 +1242,27 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
#ifdef USB_DEVICE_HS_SUPPORT
void udd_test_mode_j(void)
void udd_test_mode_j()
{
udd_enable_hs_test_mode();
udd_enable_hs_test_mode_j();
}
void udd_test_mode_k(void)
void udd_test_mode_k()
{
udd_enable_hs_test_mode();
udd_enable_hs_test_mode_k();
}
void udd_test_mode_se0_nak(void)
void udd_test_mode_se0_nak()
{
udd_enable_hs_test_mode();
}
void udd_test_mode_packet(void)
void udd_test_mode_packet()
{
uint8_t i;
uint8_t *ptr_dest;
@@ -1310,7 +1310,7 @@ void udd_test_mode_packet(void)
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT
static void udd_reset_ep_ctrl(void)
static void udd_reset_ep_ctrl()
{
irqflags_t flags;
@@ -1334,7 +1334,7 @@ static void udd_reset_ep_ctrl(void)
cpu_irq_restore(flags);
}
static void udd_ctrl_init(void)
static void udd_ctrl_init()
{
irqflags_t flags;
flags = cpu_irq_save();
@@ -1357,7 +1357,7 @@ static void udd_ctrl_init(void)
}
static void udd_ctrl_setup_received(void)
static void udd_ctrl_setup_received()
{
irqflags_t flags;
uint8_t i;
@@ -1419,7 +1419,7 @@ static void udd_ctrl_setup_received(void)
}
static void udd_ctrl_in_sent(void)
static void udd_ctrl_in_sent()
{
static bool b_shortpacket = false;
uint16_t nb_remain;
@@ -1503,7 +1503,7 @@ static void udd_ctrl_in_sent(void)
}
static void udd_ctrl_out_received(void)
static void udd_ctrl_out_received()
{
irqflags_t flags;
uint8_t i;
@@ -1594,7 +1594,7 @@ static void udd_ctrl_out_received(void)
}
static void udd_ctrl_underflow(void)
static void udd_ctrl_underflow()
{
if (Is_udd_out_received(0))
return; // Underflow ignored if OUT data is received
@@ -1611,7 +1611,7 @@ static void udd_ctrl_underflow(void)
}
static void udd_ctrl_overflow(void)
static void udd_ctrl_overflow()
{
if (Is_udd_in_send(0))
return; // Overflow ignored if IN data is received
@@ -1627,7 +1627,7 @@ static void udd_ctrl_overflow(void)
}
static void udd_ctrl_stall_data(void)
static void udd_ctrl_stall_data()
{
// Stall all packets on IN & OUT control endpoint
udd_ep_control_state = UDD_EPCTRL_STALL_REQ;
@@ -1635,7 +1635,7 @@ static void udd_ctrl_stall_data(void)
}
static void udd_ctrl_send_zlp_in(void)
static void udd_ctrl_send_zlp_in()
{
irqflags_t flags;
@@ -1653,7 +1653,7 @@ static void udd_ctrl_send_zlp_in(void)
}
static void udd_ctrl_send_zlp_out(void)
static void udd_ctrl_send_zlp_out()
{
irqflags_t flags;
@@ -1669,7 +1669,7 @@ static void udd_ctrl_send_zlp_out(void)
}
static void udd_ctrl_endofrequest(void)
static void udd_ctrl_endofrequest()
{
// If a callback is registered then call it
if (udd_g_ctrlreq.callback) {
@@ -1678,7 +1678,7 @@ static void udd_ctrl_endofrequest(void)
}
static bool udd_ctrl_interrupt(void)
static bool udd_ctrl_interrupt()
{
if (!Is_udd_endpoint_interrupt(0)) {
@@ -1734,7 +1734,7 @@ static bool udd_ctrl_interrupt(void)
#if (0 != USB_DEVICE_MAX_EP)
static void udd_ep_job_table_reset(void)
static void udd_ep_job_table_reset()
{
uint8_t i;
for (i = 0; i < USB_DEVICE_MAX_EP; i++) {
@@ -1744,7 +1744,7 @@ static void udd_ep_job_table_reset(void)
}
static void udd_ep_job_table_kill(void)
static void udd_ep_job_table_kill()
{
uint8_t i;
@@ -1970,7 +1970,7 @@ static void udd_ep_out_received(udd_ep_id_t ep)
}
#endif // #ifdef UDD_EP_FIFO_SUPPORTED
static bool udd_ep_interrupt(void)
static bool udd_ep_interrupt()
{
udd_ep_id_t ep;
udd_ep_job_t *ptr_job;
+2 -2
View File
@@ -66,13 +66,13 @@ extern "C" {
*
* \return \c true if the ID pin management has been started, otherwise \c false.
*/
bool otg_dual_enable(void);
bool otg_dual_enable();
/**
* \brief Uninitialize the dual role
* This function is implemented in uotghs_host.c file.
*/
void otg_dual_disable(void);
void otg_dual_disable();
//! @name UOTGHS OTG ID pin management
+9 -9
View File
@@ -56,7 +56,7 @@
static volatile bool main_b_cdc_enable = false;
static volatile bool main_b_dtr_active = false;
void usb_task_idle(void) {
void usb_task_idle() {
#if ENABLED(SDSUPPORT)
// Attend SD card access from the USB MSD -- Prioritize access to improve speed
int delay = 2;
@@ -70,14 +70,14 @@ void usb_task_idle(void) {
}
#if ENABLED(SDSUPPORT)
bool usb_task_msc_enable(void) { return ((main_b_msc_enable = true)); }
void usb_task_msc_disable(void) { main_b_msc_enable = false; }
bool usb_task_msc_isenabled(void) { return main_b_msc_enable; }
bool usb_task_msc_enable() { return ((main_b_msc_enable = true)); }
void usb_task_msc_disable() { main_b_msc_enable = false; }
bool usb_task_msc_isenabled() { return main_b_msc_enable; }
#endif
bool usb_task_cdc_enable(const uint8_t port) { UNUSED(port); return ((main_b_cdc_enable = true)); }
void usb_task_cdc_disable(const uint8_t port) { UNUSED(port); main_b_cdc_enable = false; main_b_dtr_active = false; }
bool usb_task_cdc_isenabled(void) { return main_b_cdc_enable; }
bool usb_task_cdc_isenabled() { return main_b_cdc_enable; }
/*! \brief Called by CDC interface
* Callback running when CDC device have received data
@@ -121,7 +121,7 @@ void usb_task_cdc_set_dtr(const uint8_t port, const bool b_enable) {
}
}
bool usb_task_cdc_dtr_active(void) { return main_b_dtr_active; }
bool usb_task_cdc_dtr_active() { return main_b_dtr_active; }
/// Microsoft WCID descriptor
typedef struct USB_MicrosoftCompatibleDescriptor_Interface {
@@ -202,7 +202,7 @@ static USB_MicrosoftExtendedPropertiesDescriptor microsoft_extended_properties_d
** WCID configuration information
** Hooked into UDC via UDC_GET_EXTRA_STRING #define.
*/
bool usb_task_extra_string(void) {
bool usb_task_extra_string() {
static uint8_t udi_msft_magic[] = "MSFT100\xEE";
static uint8_t udi_cdc_name[] = "CDC interface";
#if ENABLED(SDSUPPORT)
@@ -262,7 +262,7 @@ bool usb_task_extra_string(void) {
/**************************************************************************************************
** Handle device requests that the ASF stack doesn't
*/
bool usb_task_other_requests(void) {
bool usb_task_other_requests() {
uint8_t* ptr = 0;
uint16_t size = 0;
@@ -297,7 +297,7 @@ bool usb_task_other_requests(void) {
return true;
}
void usb_task_init(void) {
void usb_task_init() {
uint16_t *ptr;
+10 -10
View File
@@ -58,12 +58,12 @@ extern "C" {
*
* \retval true if MSC startup is ok
*/
bool usb_task_msc_enable(void);
bool usb_task_msc_enable();
/*! \brief Called by MSC interface
* Callback running when USB Host disable MSC interface
*/
void usb_task_msc_disable(void);
void usb_task_msc_disable();
/*! \brief Opens the communication port
* This is called by CDC interface when USB Host enable it.
@@ -84,25 +84,25 @@ void usb_task_cdc_set_dtr(const uint8_t port, const bool b_enable);
/*! \brief Check if MSC is enumerated and configured on the PC side
*/
bool usb_task_msc_isenabled(void);
bool usb_task_msc_isenabled();
/*! \brief Check if CDC is enumerated and configured on the PC side
*/
bool usb_task_cdc_isenabled(void);
bool usb_task_cdc_isenabled();
/*! \brief Check if CDC is actually OPEN by an application on the PC side
* assuming DTR signal means a program is listening to messages
*/
bool usb_task_cdc_dtr_active(void);
bool usb_task_cdc_dtr_active();
/*! \brief Called by UDC when USB Host request a extra string different
* of this specified in USB device descriptor
*/
bool usb_task_extra_string(void);
bool usb_task_extra_string();
/*! \brief Called by UDC when USB Host performs unknown requests
*/
bool usb_task_other_requests(void);
bool usb_task_other_requests();
/*! \brief Called by CDC interface
* Callback running when CDC device have received data
@@ -117,15 +117,15 @@ void usb_task_cdc_config(const uint8_t port, usb_cdc_line_coding_t *cfg);
/*! \brief The USB device interrupt
*/
void USBD_ISR(void);
void USBD_ISR();
/*! \brief USB task init
*/
void usb_task_init(void);
void usb_task_init();
/*! \brief USB task idle
*/
void usb_task_idle(void);
void usb_task_idle();
#ifdef __cplusplus
}
@@ -24,7 +24,7 @@
#include "../../inc/MarlinConfig.h"
#include "../../Marlin.h"
#include "watchdog_Due.h"
#include "watchdog.h"
// Override Arduino runtime to either config or disable the watchdog
//
@@ -32,7 +32,7 @@
// process, because watchdog initialization at hardware reset on SAM3X8E
// is unreliable, and there is risk of unintended resets if we delay
// that initialization to a later time.
void watchdogSetup(void) {
void watchdogSetup() {
#if ENABLED(USE_WATCHDOG)
@@ -106,7 +106,7 @@ void watchdogSetup(void) {
// Initialize watchdog - On SAM3X, Watchdog was already configured
// and enabled or disabled at startup, so no need to reconfigure it
// here.
void watchdog_init(void) {
void watchdog_init() {
// Reset watchdog to start clean
WDT_Restart(WDT);
}
@@ -29,7 +29,7 @@ class FlushableHardwareSerial : public HardwareSerial {
public:
FlushableHardwareSerial(int uart_nr);
inline void flushTX(void) { /* No need to flush the hardware serial, but defined here for compatibility. */ }
inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ }
};
extern FlushableHardwareSerial flushableSerial;
+6 -6
View File
@@ -23,7 +23,7 @@
#ifdef ARDUINO_ARCH_ESP32
#include "HAL.h"
#include "HAL_timers_ESP32.h"
#include "timers.h"
#include <rom/rtc.h>
#include <driver/adc.h>
#include <esp_adc_cal.h>
@@ -78,11 +78,11 @@ volatile int numPWMUsed = 0,
// Public functions
// ------------------------
void HAL_init(void) {
void HAL_init() {
i2s_init();
}
void HAL_init_board(void) {
void HAL_init_board() {
#if EITHER(EEPROM_SETTINGS, WEBSUPPORT)
spiffs_init();
#endif
@@ -99,15 +99,15 @@ void HAL_init_board(void) {
#endif
}
void HAL_idletask(void) {
void HAL_idletask() {
#if ENABLED(OTASUPPORT)
OTA_handle();
#endif
}
void HAL_clear_reset_source(void) { }
void HAL_clear_reset_source() { }
uint8_t HAL_get_reset_source(void) { return rtc_get_reset_reason(1); }
uint8_t HAL_get_reset_source() { return rtc_get_reset_reason(1); }
void _delay_ms(int delay_ms) { delay(delay_ms); }
+10 -10
View File
@@ -30,11 +30,11 @@
#include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h"
#include "fastio_ESP32.h"
#include "watchdog_ESP32.h"
#include "fastio.h"
#include "watchdog.h"
#include "i2s.h"
#include "HAL_timers_ESP32.h"
#include "timers.h"
#include "WebSocketSerial.h"
#include "FlushableHardwareSerial.h"
@@ -85,16 +85,16 @@ extern uint16_t HAL_adc_result;
// ------------------------
// clear reset reason
void HAL_clear_reset_source (void);
void HAL_clear_reset_source();
// reset reason
uint8_t HAL_get_reset_source(void);
uint8_t HAL_get_reset_source();
void _delay_ms(int delay);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
int freeMemory();
#pragma GCC diagnostic pop
void analogWrite(pin_t pin, int value);
@@ -108,7 +108,7 @@ void eeprom_update_block (const void *__src, void *__dst, size_t __n);
// ADC
#define HAL_ANALOG_SELECT(pin)
void HAL_adc_init(void);
void HAL_adc_init();
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_result
@@ -123,6 +123,6 @@ void HAL_adc_start_conversion(uint8_t adc_pin);
// Enable hooks into idle and setup for HAL
#define HAL_IDLETASK 1
#define BOARD_INIT() HAL_init_board();
void HAL_idletask(void);
void HAL_init(void);
void HAL_init_board(void);
void HAL_idletask();
void HAL_init();
void HAL_init_board();
@@ -27,9 +27,10 @@
#include "../shared/HAL_SPI.h"
#include <pins_arduino.h>
#include "spi_pins.h"
#include "../../core/macros.h"
#include <SPI.h>
#include "../../core/macros.h"
// ------------------------
// Public Variables
// ------------------------
@@ -79,7 +80,7 @@ void spiInit(uint8_t spiRate) {
SPI.begin();
}
uint8_t spiRec(void) {
uint8_t spiRec() {
SPI.beginTransaction(spiConfig);
uint8_t returnByte = SPI.transfer(0xFF);
SPI.endTransaction();
@@ -25,7 +25,7 @@
#if HAS_SERVOS
#include "HAL_Servo_ESP32.h"
#include "Servo.h"
// Adjacent channels (0/1, 2/3 etc.) share the same timer and therefore the same frequency and resolution settings on ESP32,
// so we only allocate servo channels up high to avoid side effects with regards to analogWrite (fans, leds, laser pwm etc.)
+9 -9
View File
@@ -66,15 +66,15 @@ ring_buffer_pos_t RingBuffer::write(const uint8_t *buffer, ring_buffer_pos_t siz
return written;
}
int RingBuffer::available(void) {
int RingBuffer::available() {
return (size - read_index + write_index) & (size - 1);
}
int RingBuffer::peek(void) {
int RingBuffer::peek() {
return available() ? data[read_index] : -1;
}
int RingBuffer::read(void) {
int RingBuffer::read() {
if (available()) {
const int ret = data[read_index];
read_index = NEXT_INDEX(read_index, size);
@@ -94,7 +94,7 @@ ring_buffer_pos_t RingBuffer::read(uint8_t *buffer) {
return len;
}
void RingBuffer::flush(void) { read_index = write_index; }
void RingBuffer::flush() { read_index = write_index; }
// WebSocketSerial impl
WebSocketSerial::WebSocketSerial()
@@ -120,10 +120,10 @@ void WebSocketSerial::begin(const long baud_setting) {
}
void WebSocketSerial::end() { }
int WebSocketSerial::peek(void) { return rx_buffer.peek(); }
int WebSocketSerial::read(void) { return rx_buffer.read(); }
int WebSocketSerial::available(void) { return rx_buffer.available(); }
void WebSocketSerial::flush(void) { rx_buffer.flush(); }
int WebSocketSerial::peek() { return rx_buffer.peek(); }
int WebSocketSerial::read() { return rx_buffer.read(); }
int WebSocketSerial::available() { return rx_buffer.available(); }
void WebSocketSerial::flush() { rx_buffer.flush(); }
size_t WebSocketSerial::write(const uint8_t c) {
size_t ret = tx_buffer.write(c);
@@ -145,7 +145,7 @@ size_t WebSocketSerial::write(const uint8_t* buffer, size_t size) {
return written;
}
void WebSocketSerial::flushTX(void) {
void WebSocketSerial::flushTX() {
// No need to do anything as there's no benefit to sending partial lines over the websocket connection.
}
+9 -9
View File
@@ -45,11 +45,11 @@ public:
RingBuffer(ring_buffer_pos_t size);
~RingBuffer();
int available(void);
int peek(void);
int read(void);
int available();
int peek();
int read();
ring_buffer_pos_t read(uint8_t *buffer);
void flush(void);
void flush();
ring_buffer_pos_t write(const uint8_t c);
ring_buffer_pos_t write(const uint8_t* buffer, ring_buffer_pos_t size);
};
@@ -62,11 +62,11 @@ public:
WebSocketSerial();
void begin(const long);
void end();
int available(void);
int peek(void);
int read(void);
void flush(void);
void flushTX(void);
int available();
int peek();
int read();
void flush();
void flushTX();
size_t write(const uint8_t c);
size_t write(const uint8_t* buffer, size_t size);
+14 -13
View File
@@ -38,40 +38,41 @@
#include "../../module/endstops.h"
// One ISR for all EXT-Interrupts
void ICACHE_RAM_ATTR endstop_ISR(void) { endstops.update(); }
void ICACHE_RAM_ATTR endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts(void) {
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
#if HAS_X_MAX
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(X_MAX_PIN);
#endif
#if HAS_X_MIN
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(X_MIN_PIN);
#endif
#if HAS_Y_MAX
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MAX_PIN);
#endif
#if HAS_Y_MIN
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MIN_PIN);
#endif
#if HAS_Z_MAX
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MAX_PIN);
#endif
#if HAS_Z_MIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PIN);
#endif
#if HAS_Z2_MAX
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MIN_PIN);
#endif
#if HAS_Z3_MAX
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MAX_PIN);
#endif
#if HAS_Z3_MIN
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PROBE_PIN);
#endif
}
@@ -30,7 +30,7 @@
#include "HAL.h"
#include "HAL_timers_ESP32.h"
#include "timers.h"
// ------------------------
// Local defines
@@ -79,13 +79,13 @@ typedef uint64_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void)
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void)
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler(void)
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler()
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler()
#define HAL_PWM_TIMER_ISR() extern "C" void pwmTC_Handler()
extern "C" void tempTC_Handler(void);
extern "C" void stepTC_Handler(void);
extern "C" void pwmTC_Handler(void);
extern "C" void tempTC_Handler();
extern "C" void stepTC_Handler();
extern "C" void pwmTC_Handler();
// ------------------------
// Types
@@ -95,7 +95,7 @@ typedef struct {
timer_group_t group;
timer_idx_t idx;
uint32_t divider;
void (*fn)(void);
void (*fn)();
} tTimerConfig;
// ------------------------
@@ -26,13 +26,13 @@
#if ENABLED(USE_WATCHDOG)
#include "watchdog_ESP32.h"
#include "watchdog.h"
void watchdogSetup(void) {
void watchdogSetup() {
// do whatever. don't remove this function.
}
void watchdog_init(void) {
void watchdog_init() {
// TODO
}
+4 -2
View File
@@ -22,16 +22,18 @@
#ifdef ARDUINO_ARCH_ESP32
#include <SPIFFS.h>
#undef DISABLED // esp32-hal-gpio.h
#include "../../inc/MarlinConfigPre.h"
#if ENABLED(WEBSUPPORT)
#include <SPIFFS.h>
#include "wifi.h"
AsyncEventSource events("/events"); // event source (Server-Sent events)
void onNotFound(AsyncWebServerRequest *request){
void onNotFound(AsyncWebServerRequest *request) {
request->send(404);
}
+6 -6
View File
@@ -31,10 +31,10 @@ HalSerial usb_serial;
extern "C" void u8g_xMicroDelay(uint16_t val) {
DELAY_US(val);
}
extern "C" void u8g_MicroDelay(void) {
extern "C" void u8g_MicroDelay() {
u8g_xMicroDelay(1);
}
extern "C" void u8g_10MicroDelay(void) {
extern "C" void u8g_10MicroDelay() {
u8g_xMicroDelay(10);
}
extern "C" void u8g_Delay(uint16_t val) {
@@ -51,7 +51,7 @@ int freeMemory() {
// ADC
// ------------------------
void HAL_adc_init(void) {
void HAL_adc_init() {
}
@@ -64,18 +64,18 @@ void HAL_adc_start_conversion(const uint8_t ch) {
active_ch = ch;
}
bool HAL_adc_finished(void) {
bool HAL_adc_finished() {
return true;
}
uint16_t HAL_adc_get_result(void) {
uint16_t HAL_adc_get_result() {
pin_t pin = analogInputToDigitalPin(active_ch);
if (!VALID_PIN(pin)) return 0;
uint16_t data = ((Gpio::get(pin) >> 2) & 0x3FF);
return data; // return 10bit value as Marlin expects
}
void HAL_pwm_init(void) {
void HAL_pwm_init() {
}
+5 -13
View File
@@ -56,7 +56,7 @@ uint8_t _getc();
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
#include "HAL_timers.h"
#include "timers.h"
#include "serial.h"
#define SHARED_SERVOS HAS_SERVOS
@@ -78,32 +78,24 @@ extern HalSerial usb_serial;
#define ENABLE_ISRS()
#define DISABLE_ISRS()
inline void HAL_init(void) { }
inline void HAL_init() { }
// Utility functions
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
int freeMemory();
#pragma GCC diagnostic pop
// SPI: Extended functions which take a channel number (hardware SPI only)
/** Write single byte to specified SPI channel */
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
uint8_t spiRec(uint32_t chan);
// ADC
#define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin)
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
#define HAL_READ_ADC() HAL_adc_get_result()
#define HAL_ADC_READY() true
void HAL_adc_init(void);
void HAL_adc_init();
void HAL_adc_enable_channel(int pin);
void HAL_adc_start_conversion(const uint8_t adc_pin);
uint16_t HAL_adc_get_result(void);
uint16_t HAL_adc_get_result();
/* ---------------- Delay in cycles */
FORCE_INLINE static void DELAY_CYCLES(uint64_t x) {
+3 -3
View File
@@ -28,8 +28,8 @@
#include "../shared/Delay.h"
// Interrupts
void cli(void) { } // Disable
void sei(void) { } // Enable
void cli() { } // Disable
void sei() { } // Enable
// Time functions
void _delay_ms(const int delay_ms) {
@@ -90,7 +90,7 @@ void eeprom_read_block(void *__dst, const void *__src, size_t __n) { }
void eeprom_update_block(const void *__src, void *__dst, size_t __n) { }
char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) {
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s) {
char format_string[20];
snprintf(format_string, 20, "%%%d.%df", __width, __prec);
sprintf(__s, format_string, __val);
+6 -8
View File
@@ -49,8 +49,6 @@ typedef uint8_t byte;
#define PGM_P const char *
// Used for libraries, preprocessor, and constants
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(x) ((x)>0?(x):-(x))
#ifndef isnan
@@ -65,9 +63,9 @@ typedef uint8_t byte;
#define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value)))
//Interrupts
void cli(void); // Disable
void sei(void); // Enable
void attachInterrupt(uint32_t pin, void (*callback)(void), uint32_t mode);
void cli(); // Disable
void sei(); // Enable
void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode);
void detachInterrupt(uint32_t pin);
extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
extern "C" void GpioDisableInt(uint32_t port, uint32_t pin);
@@ -111,13 +109,13 @@ uint16_t analogRead(pin_t);
// EEPROM
void eeprom_write_byte(unsigned char *pos, unsigned char value);
unsigned char eeprom_read_byte(unsigned char *pos);
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
void eeprom_read_block(void *__dst, const void *__src, size_t __n);
void eeprom_update_block(const void *__src, void *__dst, size_t __n);
int32_t random(int32_t);
int32_t random(int32_t, int32_t);
void randomSeed(uint32_t);
char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s);
char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max);
+7 -7
View File
@@ -108,11 +108,11 @@ public:
void flush() { receive_buffer.clear(); }
uint8_t availableForWrite(void){
uint8_t availableForWrite() {
return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free();
}
void flushTX(void){
void flushTX() {
if (host_connected)
while (transmit_buffer.available()) { /* nada */ }
}
@@ -142,10 +142,10 @@ public:
void print_bin(uint32_t value, uint8_t num_digits) {
uint32_t mask = 1 << (num_digits -1);
for (uint8_t i = 0; i < num_digits; i++) {
if (!(i % 4) && i) write(' ');
if (!(i % 16) && i) write(' ');
if (value & mask) write('1');
else write('0');
if (!(i % 4) && i) write(' ');
if (!(i % 16) && i) write(' ');
if (value & mask) write('1');
else write('0');
value <<= 1;
}
}
@@ -200,7 +200,7 @@ public:
void println(unsigned long value, int nbase = 0) { print(value, nbase); println(); }
void println(float value, int round = 6) { printf("%f\n" , value); }
void println(double value, int round = 6) { printf("%f\n" , value); }
void println(void) { print('\n'); }
void println() { print('\n'); }
volatile RingBuffer<uint8_t, 128> receive_buffer;
volatile RingBuffer<uint8_t, 128> transmit_buffer;
+1 -1
View File
@@ -104,7 +104,7 @@ void simulation_loop() {
}
}
int main(void) {
int main() {
std::thread write_serial (write_serial_thread);
std::thread read_serial (read_serial_thread);
@@ -25,7 +25,7 @@
#include "hardware/Timer.h"
#include "../../inc/MarlinConfig.h"
#include "HAL_timers.h"
#include "timers.h"
/**
* Use POSIX signals to attempt to emulate Interrupts
@@ -37,7 +37,7 @@ HAL_TEMP_TIMER_ISR();
Timer timers[2];
void HAL_timer_init(void) {
void HAL_timer_init() {
timers[0].init(0, STEPPER_TIMER_RATE, TIMER0_IRQHandler);
timers[1].init(1, TEMP_TIMER_RATE, TIMER1_IRQHandler);
}
@@ -59,16 +59,16 @@ typedef uint32_t hal_timer_t;
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler(void)
#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler(void)
#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler()
#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler()
// PWM timer
#define HAL_PWM_TIMER
#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler(void)
#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler()
#define HAL_PWM_TIMER_IRQn
void HAL_timer_init(void);
void HAL_timer_init();
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare);
+5 -5
View File
@@ -28,19 +28,19 @@
#include "watchdog.h"
void watchdog_init(void) {}
void watchdog_init() {}
void HAL_clear_reset_source(void) {}
void HAL_clear_reset_source() {}
uint8_t HAL_get_reset_source(void) {
uint8_t HAL_get_reset_source() {
return RST_POWER_ON;
}
void watchdog_reset() {}
#else
void HAL_clear_reset_source(void) {}
uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; }
void HAL_clear_reset_source() {}
uint8_t HAL_get_reset_source() { return RST_POWER_ON; }
#endif // USE_WATCHDOG
#endif // __PLAT_LINUX__
+4 -4
View File
@@ -23,7 +23,7 @@
#define WDT_TIMEOUT 4000000 // 4 second timeout
void watchdog_init(void);
void watchdog_reset(void);
void HAL_clear_reset_source(void);
uint8_t HAL_get_reset_source(void);
void watchdog_init();
void watchdog_reset();
void HAL_clear_reset_source();
uint8_t HAL_get_reset_source();
@@ -44,7 +44,7 @@
#define sw_barrier() __asm__ volatile("": : :"memory");
// (re)initialize UART0 as a monitor output to 250000,n,8,1
static void TXBegin(void) {
static void TXBegin() {
}
// Send character through UART with no interrupts
@@ -210,7 +210,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
}
extern "C" {
__attribute__((naked)) void NMI_Handler(void) {
__attribute__((naked)) void NMI_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -223,7 +223,7 @@ __attribute__((naked)) void NMI_Handler(void) {
);
}
__attribute__((naked)) void HardFault_Handler(void) {
__attribute__((naked)) void HardFault_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -236,7 +236,7 @@ __attribute__((naked)) void HardFault_Handler(void) {
);
}
__attribute__((naked)) void MemManage_Handler(void) {
__attribute__((naked)) void MemManage_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -249,7 +249,7 @@ __attribute__((naked)) void MemManage_Handler(void) {
);
}
__attribute__((naked)) void BusFault_Handler(void) {
__attribute__((naked)) void BusFault_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -262,7 +262,7 @@ __attribute__((naked)) void BusFault_Handler(void) {
);
}
__attribute__((naked)) void UsageFault_Handler(void) {
__attribute__((naked)) void UsageFault_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -275,7 +275,7 @@ __attribute__((naked)) void UsageFault_Handler(void) {
);
}
__attribute__((naked)) void DebugMon_Handler(void) {
__attribute__((naked)) void DebugMon_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -289,7 +289,7 @@ __attribute__((naked)) void DebugMon_Handler(void) {
}
/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */
__attribute__((naked)) void WDT_IRQHandler(void) {
__attribute__((naked)) void WDT_IRQHandler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
@@ -302,7 +302,7 @@ __attribute__((naked)) void WDT_IRQHandler(void) {
);
}
__attribute__((naked)) void RSTC_Handler(void) {
__attribute__((naked)) void RSTC_Handler() {
__asm__ __volatile__ (
".syntax unified" "\n\t"
A("tst lr, #4")
+2 -2
View File
@@ -30,10 +30,10 @@
extern "C" void u8g_xMicroDelay(uint16_t val) {
DELAY_US(val);
}
extern "C" void u8g_MicroDelay(void) {
extern "C" void u8g_MicroDelay() {
u8g_xMicroDelay(1);
}
extern "C" void u8g_10MicroDelay(void) {
extern "C" void u8g_10MicroDelay() {
u8g_xMicroDelay(10);
}
extern "C" void u8g_Delay(uint16_t val) {
+4 -15
View File
@@ -28,7 +28,7 @@
#define CPU_32_BIT
void HAL_init(void);
void HAL_init();
#include <stdint.h>
#include <stdarg.h>
@@ -41,7 +41,7 @@ extern "C" volatile uint32_t _millis;
#include "../shared/HAL_SPI.h"
#include "fastio.h"
#include "watchdog.h"
#include "HAL_timers.h"
#include "timers.h"
#include "MarlinSerial.h"
#include <adc.h>
@@ -113,20 +113,9 @@ extern "C" volatile uint32_t _millis;
//
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
int freeMemory(void);
int freeMemory();
#pragma GCC diagnostic pop
//
// SPI: Extended functions taking a channel number (Hardware SPI only)
//
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);
//
// ADC API
//
@@ -155,7 +144,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09
#define HAL_IDLETASK 1
void HAL_idletask(void);
void HAL_idletask();
#define PLATFORM_M997_SUPPORT
void flashFirmware(int16_t value);
+4 -4
View File
@@ -27,28 +27,28 @@
#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0)
MarlinSerial MSerial(LPC_UART0);
extern "C" void UART0_IRQHandler(void) {
extern "C" void UART0_IRQHandler() {
MSerial.IRQHandler();
}
#endif
#if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1)
MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1);
extern "C" void UART1_IRQHandler(void) {
extern "C" void UART1_IRQHandler() {
MSerial1.IRQHandler();
}
#endif
#if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2)
MarlinSerial MSerial2(LPC_UART2);
extern "C" void UART2_IRQHandler(void) {
extern "C" void UART2_IRQHandler() {
MSerial2.IRQHandler();
}
#endif
#if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3)
MarlinSerial MSerial3(LPC_UART3);
extern "C" void UART3_IRQHandler(void) {
extern "C" void UART3_IRQHandler() {
MSerial3.IRQHandler();
}
#endif
+25 -24
View File
@@ -38,73 +38,74 @@
#include "../../module/endstops.h"
// One ISR for all EXT-Interrupts
void endstop_ISR(void) { endstops.update(); }
void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts(void) {
void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(digitalPinToInterrupt(P), endstop_ISR, CHANGE)
#if HAS_X_MAX
#if !LPC1768_PIN_INTERRUPT_M(X_MAX_PIN)
#error "X_MAX_PIN is not an INTERRUPT capable pin."
#error "X_MAX_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(X_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(X_MAX_PIN);
#endif
#if HAS_X_MIN
#if !LPC1768_PIN_INTERRUPT_M(X_MIN_PIN)
#error "X_MIN_PIN is not an INTERRUPT capable pin."
#error "X_MIN_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(X_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(X_MIN_PIN);
#endif
#if HAS_Y_MAX
#if !LPC1768_PIN_INTERRUPT_M(Y_MAX_PIN)
#error "Y_MAX_PIN is not an INTERRUPT capable pin."
#error "Y_MAX_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Y_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MAX_PIN);
#endif
#if HAS_Y_MIN
#if !LPC1768_PIN_INTERRUPT_M(Y_MIN_PIN)
#error "Y_MIN_PIN is not an INTERRUPT capable pin."
#error "Y_MIN_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Y_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Y_MIN_PIN);
#endif
#if HAS_Z_MAX
#if !LPC1768_PIN_INTERRUPT_M(Z_MAX_PIN)
#error "Z_MAX_PIN is not an INTERRUPT capable pin."
#error "Z_MAX_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MAX_PIN);
#endif
#if HAS_Z_MIN
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PIN)
#error "Z_MIN_PIN is not an INTERRUPT capable pin."
#error "Z_MIN_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PIN);
#endif
#if HAS_Z2_MAX
#if !LPC1768_PIN_INTERRUPT_M(Z2_MAX_PIN)
#error "Z2_MAX_PIN is not an INTERRUPT capable pin."
#error "Z2_MAX_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z2_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
#if !LPC1768_PIN_INTERRUPT_M(Z2_MIN_PIN)
#error "Z2_MIN_PIN is not an INTERRUPT capable pin."
#error "Z2_MIN_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z2_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z2_MIN_PIN);
#endif
#if HAS_Z3_MAX
#if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
#error "Z3_MIN_PIN is not an INTERRUPT capable pin."
#error "Z3_MIN_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z3_MAX_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MAX_PIN);
#endif
#if HAS_Z3_MIN
#if !LPC1768_PIN_INTERRUPT_M(Z3_MIN_PIN)
#error "Z3_MIN_PIN is not an INTERRUPT capable pin."
#error "Z3_MIN_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z3_MIN_PIN), endstop_ISR, CHANGE);
_ATTACH(Z3_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
#if !LPC1768_PIN_INTERRUPT_M(Z_MIN_PROBE_PIN)
#error "Z_MIN_PROBE_PIN is not an INTERRUPT capable pin."
#error "Z_MIN_PROBE_PIN is not INTERRUPT-capable."
#endif
attachInterrupt(digitalPinToInterrupt(Z_MIN_PROBE_PIN), endstop_ISR, CHANGE);
_ATTACH(Z_MIN_PROBE_PIN);
#endif
}
@@ -89,7 +89,7 @@ uint8_t digipot_mcp4451_start(uint8_t sla) { // send slave address and write bi
return 1;
}
void digipot_mcp4451_init(void) {
void digipot_mcp4451_init() {
/**
* Init I2C pin connect
*/
@@ -45,7 +45,7 @@
#include <lpc17xx_libcfg_default.h>
uint8_t digipot_mcp4451_start(uint8_t sla);
void digipot_mcp4451_init(void);
void digipot_mcp4451_init();
uint8_t digipot_mcp4451_send_byte(uint8_t data);
#ifdef __cplusplus
+5 -5
View File
@@ -38,15 +38,15 @@ extern "C" {
#include "../../sd/cardreader.h"
#include "../../inc/MarlinConfig.h"
#include "HAL.h"
#include "HAL_timers.h"
#include "timers.h"
extern uint32_t MSC_SD_Init(uint8_t pdrv);
extern "C" int isLPC1769();
extern "C" void disk_timerproc(void);
extern "C" void disk_timerproc();
void SysTick_Callback() { disk_timerproc(); }
void HAL_init(void) {
void HAL_init() {
// Init LEDs
#if PIN_EXISTS(LED)
@@ -149,7 +149,7 @@ void HAL_init(void) {
}
// HAL idle task
void HAL_idletask(void) {
void HAL_idletask() {
#if ENABLED(SHARED_SD_CARD)
// If Marlin is using the SD card we need to lock it to prevent access from
// a PC via USB.
@@ -158,7 +158,7 @@ void HAL_idletask(void) {
// the disk if Marlin has it mounted. Unfortuately there is currently no way
// to unmount the disk from the LCD menu.
// if (IS_SD_PRINTING() || IS_SD_FILE_OPEN())
if (card.isDetected())
if (card.isMounted())
MSC_Aquire_Lock();
else
MSC_Release_Lock();

Some files were not shown because too many files have changed in this diff Show More