Skip to content

Commit

Permalink
No wrapper needed for .h
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and slowbro committed Jul 2, 2021
1 parent 53fb0e7 commit 302810e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 44 deletions.
47 changes: 28 additions & 19 deletions Marlin/src/libs/MAX31865.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Adafruit MAX31865 library:
*
* This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
*
* Designed specifically to work with the Adafruit RTD Sensor
* ----> https://www.adafruit.com/products/3328
*
* This sensor uses SPI to communicate, 4 pins are required to
* interface
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Limor Fried/Ladyada for Adafruit Industries.
*
* Modifications by JoAnn Manges (@GadgetAngel)
* Copyright (c) 2020, JoAnn Manges
* All rights reserved.
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -34,7 +18,26 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

/**
* Based on Based on Adafruit MAX31865 library:
*
* This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
* Designed specifically to work with the Adafruit RTD Sensor
* https://www.adafruit.com/products/3328
*
* This sensor uses SPI to communicate, 4 pins are required to interface.
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Limor Fried/Ladyada for Adafruit Industries.
*
* Modifications by JoAnn Manges (@GadgetAngel)
* Copyright (c) 2020, JoAnn Manges
* All rights reserved.
*/

// Useful for RTD debugging.
Expand All @@ -43,6 +46,10 @@

//TODO: switch to SPIclass/SoftSPI

#include "../inc/MarlinConfig.h"

#if HAS_MAX31865 && !LIB_USR_MAX31865

#include "MAX31865.h"

SPISettings MAX31865::spiConfig = SPISettings(
Expand Down Expand Up @@ -482,3 +489,5 @@ uint8_t MAX31865::spixfer(uint8_t x) {

return reply;
}

#endif // HAS_MAX31865 && !LIB_USR_MAX31865
47 changes: 22 additions & 25 deletions Marlin/src/libs/MAX31865.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Based on Adafruit MAX31865 library:
*
* This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
*
* Designed specifically to work with the Adafruit RTD Sensor
* ----> https://www.adafruit.com/products/3328
*
* This sensor uses SPI to communicate, 4 pins are required to
* interface
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Limor Fried/Ladyada for Adafruit Industries.
*
* Modifications by JoAnn Manges (@GadgetAngel)
* Copyright (c) 2020, JoAnn Manges
* All rights reserved.
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -34,14 +18,30 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

/**
* Based on Based on Adafruit MAX31865 library:
*
* This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
* Designed specifically to work with the Adafruit RTD Sensor
* https://www.adafruit.com/products/3328
*
* This sensor uses SPI to communicate, 4 pins are required to interface.
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Limor Fried/Ladyada for Adafruit Industries.
*
* Modifications by JoAnn Manges (@GadgetAngel)
* Copyright (c) 2020, JoAnn Manges
* All rights reserved.
*/
#pragma once

#include "../inc/MarlinConfig.h"

#if HAS_MAX31865 && !LIB_USR_MAX31865

#include "../HAL/shared/Delay.h"
#include HAL_PATH(../HAL, MarlinSPI.h)

Expand Down Expand Up @@ -114,7 +114,6 @@ class MAX31865 {
int8_t spi_clk);
#endif


void begin(float zero, float ref, max31865_numwires_t x);

uint8_t readFault();
Expand All @@ -132,5 +131,3 @@ class MAX31865 {
float temperature(uint16_t adcVal);
float temperature(float Rrtd);
};

#endif // HAS_MAX31865

0 comments on commit 302810e

Please sign in to comment.