1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-30 02:43:45 +02:00

Save memory

by eliminating last call to arduino version of digitalRead
This commit is contained in:
Asbelos
2020-07-15 22:51:50 +01:00
parent 8d4d9bd28e
commit 57cc5ad705
4 changed files with 15 additions and 8 deletions

View File

@@ -69,6 +69,7 @@ decide to ignore the <q ID> return and only react to <Q ID> triggers.
#include "Sensors.h"
#include "EEStore.h"
#include "StringFormatter.h"
#include "Hardware.h"
///////////////////////////////////////////////////////////////////////////////
@@ -113,7 +114,7 @@ Sensor *Sensor::create(int snum, int pin, int pullUp){
tt->active=false;
tt->signal=1;
pinMode(pin,INPUT); // set mode to input
digitalWrite(pin,pullUp); // don't use Arduino's internal pull-up resistors for external infrared sensors --- each sensor must have its own 1K external pull-up resistor
Hardware::pinWrite(pin,pullUp); // don't use Arduino's internal pull-up resistors for external infrared sensors --- each sensor must have its own 1K external pull-up resistor
return tt;