Browse Source

Merge pull request #8477 from thinkyhead/bf2_some_formatting

[2.0.x] Apply some formatting
pull/1/head
Scott Lahteine 7 years ago
committed by GitHub
parent
commit
ca6d408549
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 34
      Marlin/src/HAL/HAL_AVR/ServoTimers.h
  2. 4
      Marlin/src/HAL/HAL_AVR/fastio_AVR.h
  3. 23
      Marlin/src/HAL/HAL_DUE/fastio_Due.h
  4. 32
      Marlin/src/HAL/HAL_DUE/servotimers.h
  5. 4
      Marlin/src/HAL/HAL_LPC1768/HAL_LPC1768_LCD_defines.h
  6. 1
      Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp
  7. 57
      Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp
  8. 57
      Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.h
  9. 32
      Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp
  10. 14
      Marlin/src/HAL/HAL_LPC1768/fastio.h
  11. 43
      Marlin/src/HAL/HAL_LPC1768/include/Wire.h
  12. 19
      Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c
  13. 4
      Marlin/src/HAL/HAL_LPC1768/main.cpp
  14. 2
      Marlin/src/HAL/HAL_LPC1768/pinsDebug_LPC1768.h
  15. 33
      Marlin/src/HAL/HAL_LPC1768/servo_private.h
  16. 2
      Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.h
  17. 2
      Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h
  18. 80
      Marlin/src/HAL/servo.h
  19. 32
      Marlin/src/HAL/servo_private.h
  20. 5
      Marlin/src/feature/dac/dac_mcp4728.cpp
  21. 36
      Marlin/src/feature/dac/stepper_dac.cpp
  22. 36
      Marlin/src/feature/dac/stepper_dac.h
  23. 1
      Marlin/src/gcode/feature/leds/M150.cpp
  24. 32
      Marlin/src/libs/vector_3.cpp
  25. 32
      Marlin/src/libs/vector_3.h
  26. 3
      Marlin/src/module/planner_bezier.cpp
  27. 36
      Marlin/src/module/stepper_indirection.h

34
Marlin/src/HAL/HAL_AVR/ServoTimers.h

@ -20,23 +20,23 @@
* *
*/ */
/* /**
ServoTimers.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 * ServoTimers.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved. * Copyright (c) 2009 Michael Margolis. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _SERVOTIMERS_H_ #ifndef _SERVOTIMERS_H_

4
Marlin/src/HAL/HAL_AVR/fastio_AVR.h

@ -21,9 +21,9 @@
*/ */
/** /**
* Fast I/O Routines * Fast I/O Routines for AVR
* Use direct port manipulation to save scads of processor time. * Use direct port manipulation to save scads of processor time.
* Contributed by Triffid_Hunter. Modified by Kliment and the Marlin team. * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al.
*/ */
#ifndef _FASTIO_ARDUINO_H_ #ifndef _FASTIO_ARDUINO_H_

23
Marlin/src/HAL/HAL_DUE/fastio_Due.h

@ -21,8 +21,9 @@
*/ */
/** /**
This code contributed by Triffid_Hunter and modified by Kliment * Fast I/O Routines for SAM3X8E
why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html * Use direct port manipulation to save scads of processor time.
* Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al.
*/ */
/** /**
@ -35,7 +36,7 @@
#define _FASTIO_DUE_H #define _FASTIO_DUE_H
/** /**
utility functions * Utility functions
*/ */
#ifndef MASK #ifndef MASK
@ -43,8 +44,11 @@
#endif #endif
/** /**
magic I/O routines * Magic I/O routines
now you can simply SET_OUTPUT(STEP); WRITE(STEP, 1); WRITE(STEP, 0); *
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
*
* Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
*/ */
/// Read a pin /// Read a pin
@ -80,8 +84,6 @@
/// check if pin is an timer /// check if pin is an timer
#define _GET_TIMER(IO) #define _GET_TIMER(IO)
// why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
/// Read a pin wrapper /// Read a pin wrapper
#define READ(IO) _READ(IO) #define READ(IO) _READ(IO)
@ -111,9 +113,8 @@
#define OUT_WRITE(IO, v) { SET_OUTPUT(IO); WRITE(IO, v); } #define OUT_WRITE(IO, v) { SET_OUTPUT(IO); WRITE(IO, v); }
/** /**
ports and functions * Ports and functions
* Added as necessary or if I feel like it- not a comprehensive list!
added as necessary or if I feel like it- not a comprehensive list!
*/ */
// UART // UART
@ -125,7 +126,7 @@
#define SDA DIO20 #define SDA DIO20
/** /**
pins * pins
*/ */
#define DIO0_PIN 8 #define DIO0_PIN 8

32
Marlin/src/HAL/HAL_DUE/servotimers.h

@ -1,19 +1,19 @@
/* /**
Copyright (c) 2013 Arduino LLC. All right reserved. * Copyright (c) 2013 Arduino LLC. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/** /**

4
Marlin/src/HAL/HAL_LPC1768/HAL_LPC1768_LCD_defines.h

@ -21,10 +21,10 @@
*/ */
/** /**
* LPC1768 LCD specific defines * LPC1768 LCD-specific defines
*/ */
#if defined(TARGET_LPC1768) #ifdef TARGET_LPC1768
// pointers to low level routines - must always supply these // pointers to low level routines - must always supply these
//#define U8G_HAL_LINKS //#define U8G_HAL_LINKS

1
Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp

@ -60,7 +60,6 @@
* See the end of this file for details on the hardware/firmware interaction * See the end of this file for details on the hardware/firmware interaction
*/ */
#ifdef TARGET_LPC1768 #ifdef TARGET_LPC1768
#include <lpc17xx_pinsel.h> #include <lpc17xx_pinsel.h>
#include "LPC1768_PWM.h" #include "LPC1768_PWM.h"

57
Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.cpp

@ -1,32 +1,33 @@
/* /*
SoftwareSerial.cpp (formerly NewSoftSerial.cpp) - * SoftwareSerial.cpp (formerly NewSoftSerial.cpp)
Multi-instance software serial library for Arduino/Wiring *
-- Interrupt-driven receive and other improvements by ladyada * Multi-instance software serial library for Arduino/Wiring
(http://ladyada.net) * -- Interrupt-driven receive and other improvements by ladyada
-- Tuning, circular buffer, derivation from class Print/Stream, * (http://ladyada.net)
multi-instance support, porting to 8MHz processors, * -- Tuning, circular buffer, derivation from class Print/Stream,
various optimizations, PROGMEM delay tables, inverse logic and * multi-instance support, porting to 8MHz processors,
direct port writing by Mikal Hart (http://www.arduiniana.org) * various optimizations, PROGMEM delay tables, inverse logic and
-- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) * direct port writing by Mikal Hart (http://www.arduiniana.org)
-- 20MHz processor support by Garrett Mace (http://www.macetech.com) * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com)
-- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) * -- 20MHz processor support by Garrett Mace (http://www.macetech.com)
* -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/)
This library is free software; you can redistribute it and/or *
modify it under the terms of the GNU Lesser General Public * This library is free software; you can redistribute it and/or
License as published by the Free Software Foundation; either * modify it under the terms of the GNU Lesser General Public
version 2.1 of the License, or (at your option) any later version. * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, *
but WITHOUT ANY WARRANTY; without even the implied warranty of * This library is distributed in the hope that it will be useful,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * but WITHOUT ANY WARRANTY; without even the implied warranty of
Lesser General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public *
License along with this library; if not, write to the Free Software * You should have received a copy of the GNU Lesser General Public
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The latest version of this library can always be found at *
http://arduiniana.org. * The latest version of this library can always be found at
* http://arduiniana.org.
*/ */
#ifdef TARGET_LPC1768 #ifdef TARGET_LPC1768

57
Marlin/src/HAL/HAL_LPC1768/SoftwareSerial.h

@ -1,32 +1,33 @@
/* /*
SoftwareSerial.h (formerly NewSoftSerial.h) - * SoftwareSerial.h (formerly NewSoftSerial.h)
Multi-instance software serial library for Arduino/Wiring *
-- Interrupt-driven receive and other improvements by ladyada * Multi-instance software serial library for Arduino/Wiring
(http://ladyada.net) * -- Interrupt-driven receive and other improvements by ladyada
-- Tuning, circular buffer, derivation from class Print/Stream, * (http://ladyada.net)
multi-instance support, porting to 8MHz processors, * -- Tuning, circular buffer, derivation from class Print/Stream,
various optimizations, PROGMEM delay tables, inverse logic and * multi-instance support, porting to 8MHz processors,
direct port writing by Mikal Hart (http://www.arduiniana.org) * various optimizations, PROGMEM delay tables, inverse logic and
-- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) * direct port writing by Mikal Hart (http://www.arduiniana.org)
-- 20MHz processor support by Garrett Mace (http://www.macetech.com) * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com)
-- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) * -- 20MHz processor support by Garrett Mace (http://www.macetech.com)
* -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/)
This library is free software; you can redistribute it and/or *
modify it under the terms of the GNU Lesser General Public * This library is free software; you can redistribute it and/or
License as published by the Free Software Foundation; either * modify it under the terms of the GNU Lesser General Public
version 2.1 of the License, or (at your option) any later version. * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, *
but WITHOUT ANY WARRANTY; without even the implied warranty of * This library is distributed in the hope that it will be useful,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * but WITHOUT ANY WARRANTY; without even the implied warranty of
Lesser General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public *
License along with this library; if not, write to the Free Software * You should have received a copy of the GNU Lesser General Public
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The latest version of this library can always be found at *
http://arduiniana.org. * The latest version of this library can always be found at
* http://arduiniana.org.
*/ */
#ifndef SOFTWARESERIAL_H #ifndef SOFTWARESERIAL_H

32
Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp

@ -1,19 +1,19 @@
/* /**
Copyright (c) 2011-2012 Arduino. All right reserved. * Copyright (c) 2011-2012 Arduino. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details. * See the GNU Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef TARGET_LPC1768 #ifdef TARGET_LPC1768

14
Marlin/src/HAL/HAL_LPC1768/fastio.h

@ -21,8 +21,9 @@
*/ */
/** /**
This code contributed by Triffid_Hunter and modified by Kliment * Fast I/O Routines for LPC1768/9
why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html * Use direct port manipulation to save scads of processor time.
* Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al.
*/ */
/** /**
@ -57,8 +58,11 @@ bool useable_hardware_PWM(uint8_t pin);
#define WRITE_PIN(IO, v) ((v) ? WRITE_PIN_SET(IO) : WRITE_PIN_CLR(IO)) #define WRITE_PIN(IO, v) ((v) ? WRITE_PIN_SET(IO) : WRITE_PIN_CLR(IO))
/** /**
magic I/O routines * Magic I/O routines
now you can simply SET_OUTPUT(STEP); WRITE(STEP, 1); WRITE(STEP, 0); *
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW);
*
* Why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
*/ */
/// Read a pin /// Read a pin
@ -89,8 +93,6 @@ bool useable_hardware_PWM(uint8_t pin);
/// check if pin is an timer /// check if pin is an timer
#define _GET_TIMER(IO) #define _GET_TIMER(IO)
// why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
/// Read a pin wrapper /// Read a pin wrapper
#define READ(IO) _READ(IO) #define READ(IO) _READ(IO)

43
Marlin/src/HAL/HAL_LPC1768/include/Wire.h

@ -1,22 +1,22 @@
/* /*
TwoWire.h - TWI/I2C library for Arduino & Wiring * TwoWire.h - TWI/I2C library for Arduino & Wiring
Copyright (c) 2006 Nicholas Zambetti. All right reserved. * Copyright (c) 2006 Nicholas Zambetti. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts * Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts
*/ */
// Modified for use with the mcp4451 digipot routine // Modified for use with the mcp4451 digipot routine
@ -28,9 +28,7 @@
#include <inttypes.h> #include <inttypes.h>
class TwoWire class TwoWire {
{
public: public:
//TwoWire(); //TwoWire();
void begin(); void begin();
@ -39,11 +37,12 @@ class TwoWire
size_t write(uint8_t); size_t write(uint8_t);
}; };
//extern TwoWire Wire;// //extern TwoWire Wire;
TwoWire Wire; TwoWire Wire;
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
extern "C" uint8_t digipot_mcp4451_start(uint8_t sla); extern "C" uint8_t digipot_mcp4451_start(uint8_t sla);
extern "C" void digipot_mcp4451_init(void); extern "C" void digipot_mcp4451_init(void);
extern "C" uint8_t digipot_mcp4451_send_byte(uint8_t data); extern "C" uint8_t digipot_mcp4451_send_byte(uint8_t data);

19
Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c

@ -23,8 +23,6 @@
// adapted from I2C/master/master.c example // adapted from I2C/master/master.c example
// https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html // https://www-users.cs.york.ac.uk/~pcc/MCP/HAPR-Course-web/CMSIS/examples/html/master_8c_source.html
#ifdef TARGET_LPC1768 #ifdef TARGET_LPC1768
#ifdef __cplusplus #ifdef __cplusplus
@ -40,8 +38,7 @@
// These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to // These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to
// to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. // to the lpc17xx_i2c.c routines so had to copy them into this file & rename them.
static uint32_t _I2C_Start (LPC_I2C_TypeDef *I2Cx) static uint32_t _I2C_Start (LPC_I2C_TypeDef *I2Cx) {
{
// Reset STA, STO, SI // Reset STA, STO, SI
I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC; I2Cx->I2CONCLR = I2C_I2CONCLR_SIC|I2C_I2CONCLR_STOC|I2C_I2CONCLR_STAC;
@ -54,17 +51,12 @@
return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK); return (I2Cx->I2STAT & I2C_STAT_CODE_BITMASK);
} }
static void _I2C_Stop (LPC_I2C_TypeDef *I2Cx) static void _I2C_Stop (LPC_I2C_TypeDef *I2Cx) {
{
/* Make sure start bit is not active */ /* Make sure start bit is not active */
if (I2Cx->I2CONSET & I2C_I2CONSET_STA) if (I2Cx->I2CONSET & I2C_I2CONSET_STA)
{
I2Cx->I2CONCLR = I2C_I2CONCLR_STAC; I2Cx->I2CONCLR = I2C_I2CONCLR_STAC;
}
I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA; I2Cx->I2CONSET = I2C_I2CONSET_STO|I2C_I2CONSET_AA;
I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; I2Cx->I2CONCLR = I2C_I2CONCLR_SIC;
} }
@ -118,7 +110,7 @@
void digipot_mcp4451_init(void) { void digipot_mcp4451_init(void) {
/* /**
* Init I2C pin connect * Init I2C pin connect
*/ */
PinCfg.OpenDrain = 0; PinCfg.OpenDrain = 0;
@ -156,7 +148,6 @@
uint8_t digipot_mcp4451_send_byte(uint8_t data) { uint8_t digipot_mcp4451_send_byte(uint8_t data) {
LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data
LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; LPC_I2C1->I2CONSET = I2C_I2CONSET_AA;
LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC;
@ -164,8 +155,8 @@
return 1; return 1;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
#endif // TARGET_LPC1768

4
Marlin/src/HAL/HAL_LPC1768/main.cpp

@ -79,8 +79,8 @@ int main(void) {
USB_Init(); // USB Initialization USB_Init(); // USB Initialization
USB_Connect(TRUE); // USB Connect USB_Connect(TRUE); // USB Connect
volatile uint32_t usb_timeout = millis() + 2000; const uint32_t usb_timeout = millis() + 2000;
while (!USB_Configuration && millis() < usb_timeout) { while (!USB_Configuration && PENDING(millis(), usb_timeout)) {
delay(50); delay(50);
#if PIN_EXISTS(LED) #if PIN_EXISTS(LED)

2
Marlin/src/HAL/HAL_LPC1768/pinsDebug_LPC1768.h

@ -25,7 +25,7 @@
*/ */
/** /**
* translation of routines & variables used by pinsDebug.h * Translation of routines & variables used by pinsDebug.h
*/ */
#define pwm_details(pin) pin = pin // do nothing // print PWM details #define pwm_details(pin) pin = pin // do nothing // print PWM details

33
Marlin/src/HAL/HAL_LPC1768/servo_private.h

@ -21,22 +21,22 @@
*/ */
/** /**
servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved. * Copyright (c) 2009 Michael Margolis. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/** /**
@ -47,7 +47,6 @@
* *
*/ */
#ifndef SERVO_PRIVATE_H #ifndef SERVO_PRIVATE_H
#define SERVO_PRIVATE_H #define SERVO_PRIVATE_H

2
Marlin/src/HAL/HAL_STM32F1/watchdog_Stm32f1.h

@ -26,12 +26,12 @@
#ifndef WATCHDOG_STM32F1_H #ifndef WATCHDOG_STM32F1_H
#define WATCHDOG_STM32F1_H #define WATCHDOG_STM32F1_H
#include <libmaple/iwdg.h> #include <libmaple/iwdg.h>
#include "../../../src/inc/MarlinConfig.h" #include "../../../src/inc/MarlinConfig.h"
#define STM32F1_WD_RELOAD 625 #define STM32F1_WD_RELOAD 625
// Arduino STM32F1 core now has watchdog support // Arduino STM32F1 core now has watchdog support
// Initialize watchdog with a 4 second countdown time // Initialize watchdog with a 4 second countdown time

2
Marlin/src/HAL/HAL_TEENSY35_36/fastio_Teensy.h

@ -23,7 +23,7 @@
/** /**
* Fast I/O Routines for Teensy 3.5 and Teensy 3.6 * Fast I/O Routines for Teensy 3.5 and Teensy 3.6
* Use direct port manipulation to save scads of processor time. * Use direct port manipulation to save scads of processor time.
* Contributed by Triffid_Hunter. Modified by Kliment and the Marlin team. * Contributed by Triffid_Hunter and modified by Kliment, thinkyhead, Bob-the-Kuhn, et.al.
*/ */
#ifndef _FASTIO_TEENSY_H #ifndef _FASTIO_TEENSY_H

80
Marlin/src/HAL/servo.h

@ -21,49 +21,49 @@
*/ */
/** /**
servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 * servo.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved. * Copyright (c) 2009 Michael Margolis. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/** /**
*
A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method.
The servos are pulsed in the background using the value most recently written using the write() method * The servos are pulsed in the background using the value most recently written using the write() method
*
Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached.
Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four.
The sequence used to seize timers is defined in timers.h * The sequence used to seize timers is defined in timers.h
*
The methods are: * The methods are:
*
Servo - Class for manipulating servo motors connected to Arduino pins. * Servo - Class for manipulating servo motors connected to Arduino pins.
*
attach(pin ) - Attaches a servo motor to an i/o pin. * attach(pin ) - Attaches a servo motor to an i/o pin.
attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds * attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds
default min is 544, max is 2400 * default min is 544, max is 2400
*
write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) * write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds)
writeMicroseconds() - Sets the servo pulse width in microseconds * writeMicroseconds() - Sets the servo pulse width in microseconds
read() - Gets the last written servo pulse width as an angle between 0 and 180. * read() - Gets the last written servo pulse width as an angle between 0 and 180.
readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release) * readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release)
attached() - Returns true if there is a servo attached. * attached() - Returns true if there is a servo attached.
detach() - Stops an attached servos from pulsing its i/o pin. * detach() - Stops an attached servos from pulsing its i/o pin.
move(angle) - Sequence of attach(0), write(angle), * move(angle) - Sequence of attach(0), write(angle),
With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. * With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach.
*/ */
#ifndef SERVO_H #ifndef SERVO_H

32
Marlin/src/HAL/servo_private.h

@ -21,22 +21,22 @@
*/ */
/** /**
servo_private.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 * servo_private.h - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2
Copyright (c) 2009 Michael Margolis. All right reserved. * Copyright (c) 2009 Michael Margolis. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef SERVO_PRIVATE_H #ifndef SERVO_PRIVATE_H

5
Marlin/src/feature/dac/dac_mcp4728.cpp

@ -100,17 +100,18 @@ uint8_t mcp4728_setGain_all(uint8_t value) {
*/ */
uint16_t mcp4728_getValue(uint8_t channel) { return mcp4728_values[channel]; } uint16_t mcp4728_getValue(uint8_t channel) { return mcp4728_values[channel]; }
#if 0
/** /**
* Steph: Might be useful in the future * Steph: Might be useful in the future
* Return Vout * Return Vout
* */
uint16_t mcp4728_getVout(uint8_t channel) { uint16_t mcp4728_getVout(uint8_t channel) {
uint32_t vref = 2048, uint32_t vref = 2048,
vOut = (vref * mcp4728_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096; vOut = (vref * mcp4728_values[channel] * (_DAC_STEPPER_GAIN + 1)) / 4096;
if (vOut > defaultVDD) vOut = defaultVDD; if (vOut > defaultVDD) vOut = defaultVDD;
return vOut; return vOut;
} }
*/ #endif
/** /**
* Returns DAC values as a 0-100 percentage of drive strength * Returns DAC values as a 0-100 percentage of drive strength

36
Marlin/src/feature/dac/stepper_dac.cpp

@ -21,24 +21,24 @@
*/ */
/** /**
stepper_dac.cpp - To set stepper current via DAC * stepper_dac.cpp - To set stepper current via DAC
*
Part of Marlin * Part of Marlin
*
Copyright (c) 2016 MarlinFirmware * Copyright (c) 2016 MarlinFirmware
*
Marlin is free software: you can redistribute it and/or modify * Marlin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. * (at your option) any later version.
*
Marlin is distributed in the hope that it will be useful, * Marlin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with Marlin. If not, see <http://www.gnu.org/licenses/>. * along with Marlin. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"

36
Marlin/src/feature/dac/stepper_dac.h

@ -21,24 +21,24 @@
*/ */
/** /**
stepper_dac.h - To set stepper current via DAC * stepper_dac.h - To set stepper current via DAC
*
Part of Marlin * Part of Marlin
*
Copyright (c) 2016 MarlinFirmware * Copyright (c) 2016 MarlinFirmware
*
Marlin is free software: you can redistribute it and/or modify * Marlin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. * (at your option) any later version.
*
Marlin is distributed in the hope that it will be useful, * Marlin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with Marlin. If not, see <http://www.gnu.org/licenses/>. * along with Marlin. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef STEPPER_DAC_H #ifndef STEPPER_DAC_H

1
Marlin/src/gcode/feature/leds/M150.cpp

@ -44,7 +44,6 @@
* M150 P127 ; Set LED 50% brightness * M150 P127 ; Set LED 50% brightness
* M150 P ; Set LED full brightness * M150 P ; Set LED full brightness
*/ */
void GcodeSuite::M150() { void GcodeSuite::M150() {
set_led_color( set_led_color(
parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,

32
Marlin/src/libs/vector_3.cpp

@ -21,22 +21,22 @@
*/ */
/** /**
vector_3.cpp - Vector library for bed leveling * vector_3.cpp - Vector library for bed leveling
Copyright (c) 2012 Lars Brubaker. All right reserved. * Copyright (c) 2012 Lars Brubaker. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "../inc/MarlinConfig.h" #include "../inc/MarlinConfig.h"

32
Marlin/src/libs/vector_3.h

@ -21,22 +21,22 @@
*/ */
/** /**
vector_3.cpp - Vector library for bed leveling * vector_3.cpp - Vector library for bed leveling
Copyright (c) 2012 Lars Brubaker. All right reserved. * Copyright (c) 2012 Lars Brubaker. All right reserved.
*
This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
*
This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. * Lesser General Public License for more details.
*
You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef VECTOR_3_H #ifndef VECTOR_3_H

3
Marlin/src/module/planner_bezier.cpp

@ -44,8 +44,7 @@
#define MAX_STEP 0.1 #define MAX_STEP 0.1
#define SIGMA 0.1 #define SIGMA 0.1
/* Compute the linear interpolation between to real numbers. // Compute the linear interpolation between two real numbers.
*/
inline static float interp(float a, float b, float t) { return (1.0 - t) * a + t * b; } inline static float interp(float a, float b, float t) { return (1.0 - t) * a + t * b; }
/** /**

36
Marlin/src/module/stepper_indirection.h

@ -21,24 +21,24 @@
*/ */
/** /**
stepper_indirection.h - stepper motor driver indirection macros * stepper_indirection.h - stepper motor driver indirection macros
to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation * to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation
Part of Marlin * Part of Marlin
*
Copyright (c) 2015 Dominik Wenger * Copyright (c) 2015 Dominik Wenger
*
Marlin is free software: you can redistribute it and/or modify * Marlin is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. * at your option) any later version.
*
Marlin is distributed in the hope that it will be useful, * Marlin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. * GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
along with Marlin. If not, see <http://www.gnu.org/licenses/>. * along with Marlin. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef STEPPER_INDIRECTION_H #ifndef STEPPER_INDIRECTION_H

Loading…
Cancel
Save