Skip to content

Commit

Permalink
update env & add 2.2K pullup for PT1000
Browse files Browse the repository at this point in the history
  • Loading branch information
Msq001 committed Jul 26, 2022
1 parent a426ea8 commit ff88e0b
Show file tree
Hide file tree
Showing 18 changed files with 287 additions and 236 deletions.
1 change: 1 addition & 0 deletions Firmware/Marlin-bugfix-2.0.9.3.x/Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@
* 110 : Pt100 with 1kΩ pullup (atypical)
* 147 : Pt100 with 4.7kΩ pullup
* 1010 : Pt1000 with 1kΩ pullup (atypical)
* 1022 : Pt1000 with 2.2kΩ pullup (for BTT SKR 3 EZ)
* 1047 : Pt1000 with 4.7kΩ pullup (E3D)
* 20 : Pt100 with circuit in the Ultimainboard V2.x with mainboard ADC reference voltage = INA826 amplifier-board supply voltage.
* NOTE: (1) Must use an ADC input with no pullup. (2) Some INA826 amplifiers are unreliable at 3.3V so consider using sensor 147, 110, or 21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
#define THERMISTOR_NAME "ATC104GT-2 1K"
#elif THERMISTOR_ID == 1047
#define THERMISTOR_NAME "PT1000 4K7"
#elif THERMISTOR_ID == 1022
#define THERMISTOR_NAME "PT1000 2K2"
#elif THERMISTOR_ID == 1010
#define THERMISTOR_NAME "PT1000 1K"
#elif THERMISTOR_ID == 147
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#define REVERSE_TEMP_SENSOR_RANGE_1022 1

// Pt1000 with 1k0 pullup
constexpr temp_entry_t temptable_1022[] PROGMEM = {
PtLine( 0, 1000, 2200),
PtLine( 25, 1000, 2200),
PtLine( 50, 1000, 2200),
PtLine( 75, 1000, 2200),
PtLine(100, 1000, 2200),
PtLine(125, 1000, 2200),
PtLine(150, 1000, 2200),
PtLine(175, 1000, 2200),
PtLine(200, 1000, 2200),
PtLine(225, 1000, 2200),
PtLine(250, 1000, 2200),
PtLine(275, 1000, 2200),
PtLine(300, 1000, 2200),
PtLine(350, 1000, 2200),
PtLine(400, 1000, 2200),
PtLine(450, 1000, 2200),
PtLine(500, 1000, 2200)
};
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ typedef struct { int16_t value; celsius_t celsius; } temp_entry_t;
#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup
#include "thermistor_1010.h"
#endif
#if ANY_THERMISTOR_IS(1022) // Pt1000 with 2k2 pullup
#include "thermistor_1022.h"
#endif
#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup
#include "thermistor_1047.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def add_to_feat_cnf(feature, flines):
for line in atoms:
parts = line.split('=')
name = parts.pop(0)
if name in ['build_flags', 'extra_scripts', 'src_filter', 'lib_ignore']:
if name in ['build_flags', 'extra_scripts', 'build_src_filter', 'lib_ignore']:
feat[name] = '='.join(parts)
blab("[%s] %s=%s" % (feature, name, feat[name]), 3)
else:
Expand Down Expand Up @@ -173,19 +173,19 @@ def apply_features_config():
blab("Running extra_scripts for %s... " % feature, 2)
env.SConscript(feat['extra_scripts'], exports="env")

if 'src_filter' in feat:
blab("========== Adding src_filter for %s... " % feature, 2)
src_filter = ' '.join(env.GetProjectOption('src_filter'))
if 'build_src_filter' in feat:
blab("========== Adding build_src_filter for %s... " % feature, 2)
build_src_filter = ' '.join(env.GetProjectOption('build_src_filter'))
# first we need to remove the references to the same folder
my_srcs = re.findall(r'[+-](<.*?>)', feat['src_filter'])
cur_srcs = re.findall(r'[+-](<.*?>)', src_filter)
my_srcs = re.findall(r'[+-](<.*?>)', feat['build_src_filter'])
cur_srcs = re.findall(r'[+-](<.*?>)', build_src_filter)
for d in my_srcs:
if d in cur_srcs:
src_filter = re.sub(r'[+-]' + d, '', src_filter)
build_src_filter = re.sub(r'[+-]' + d, '', build_src_filter)

src_filter = feat['src_filter'] + ' ' + src_filter
set_env_field('src_filter', [src_filter])
env.Replace(SRC_FILTER=src_filter)
build_src_filter = feat['build_src_filter'] + ' ' + build_src_filter
set_env_field('build_src_filter', [build_src_filter])
env.Replace(SRC_FILTER=build_src_filter)

if 'lib_ignore' in feat:
blab("========== Adding lib_ignore for %s... " % feature, 2)
Expand Down
2 changes: 1 addition & 1 deletion Firmware/Marlin-bugfix-2.0.9.3.x/ini/avr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
platform = atmelavr@~3.4
build_flags = ${common.build_flags} -Wl,--relax
board_build.f_cpu = 16000000L
src_filter = ${common.default_src_filter} +<src/HAL/AVR>
build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>

#
# ATmega2560
Expand Down
2 changes: 1 addition & 1 deletion Firmware/Marlin-bugfix-2.0.9.3.x/ini/due.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[env:DUE]
platform = atmelsam
board = due
src_filter = ${common.default_src_filter} +<src/HAL/DUE> +<src/HAL/shared/backtrace>
build_src_filter = ${common.default_src_filter} +<src/HAL/DUE> +<src/HAL/shared/backtrace>

[env:DUE_USB]
extends = env:DUE
Expand Down
2 changes: 1 addition & 1 deletion Firmware/Marlin-bugfix-2.0.9.3.x/ini/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
platform = [email protected]
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0
src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
build_src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
lib_ignore = NativeEthernet
upload_speed = 500000
monitor_speed = 250000
Expand Down
Loading

0 comments on commit ff88e0b

Please sign in to comment.