Revert "Initial coding of protectPinISR(pin) method"

This reverts commit 852a916d61.
This commit is contained in:
Gregg 2022-02-10 21:09:42 -06:00
parent 1efe7bba0a
commit 4973d1aaa1
2 changed files with 0 additions and 27 deletions

View File

@ -1387,24 +1387,6 @@ void Span::checkRanges(){
homeSpan.configLog+="\n\n";
}
///////////////////////////////
void Span::protectGPIOs(boolean suspend){
auto gp=ProtectedGPIOs.begin();
while(gp!=ProtectedGPIOs.end()){
if(suspend){
Serial.printf("PIN: %d Status: %d : ",gp->first,GPIO.pin[gp->first].int_type);
gp->second=GPIO.pin[gp->first].int_type;
GPIO.pin[gp->first].int_type=0;
Serial.printf("PIN: %d Status: %d\n",gp->first,GPIO.pin[gp->first].int_type);
} else {
GPIO.pin[gp->first].int_type=gp->second;
}
gp++;
}
}
///////////////////////////////
// SpanAccessory //
///////////////////////////////

View File

@ -146,7 +146,6 @@ struct Span{
vector<SpanBuf> Notifications; // vector of SpanBuf objects that store info for Characteristics that are updated with setVal() and require a Notification Event
vector<SpanButton *> PushButtons; // vector of pointer to all PushButtons
unordered_map<uint64_t, uint32_t> TimedWrites; // map of timed-write PIDs and Alarm Times (based on TTLs)
unordered_map<uint8_t, uint8_t> ProtectedGPIOs; // map of pins to protect when running an ISR during NVS operations
unordered_map<char, SpanUserCommand *> UserCommands; // map of pointers to all UserCommands
@ -161,7 +160,6 @@ struct Span{
void commandMode(); // allows user to control and reset HomeSpan settings with the control button
void processSerialCommand(const char *c); // process command 'c' (typically from readSerial, though can be called with any 'c')
void checkRanges(); // checks values of all Characteristics to ensure they are each within range
void protectGPIOs(boolean suspend); // true - disable ISRs on protectedGPIOs; false - re-enable ISRs on protectedGPIOs
int sprintfAttributes(char *cBuf); // prints Attributes JSON database into buf, unless buf=NULL; return number of characters printed, excluding null terminator, even if buf=NULL
void prettyPrint(char *buf, int nsp=2); // print arbitrary JSON from buf to serial monitor, formatted with indentions of 'nsp' spaces
@ -194,7 +192,6 @@ struct Span{
void setWifiCallback(void (*f)()){wifiCallback=f;} // sets an optional user-defined function to call once WiFi connectivity is established
void setPairCallback(void (*f)(boolean isPaired)){pairCallback=f;} // sets an optional user-defined function to call when Pairing is established (true) or lost (false)
void setApFunction(void (*f)()){apFunction=f;} // sets an optional user-defined function to call when activating the WiFi Access Point
void protectPinISR(uint8_t pin){ProtectedGPIOs[pin]=0;} // protects ISR on pin from NVS operations
void setPairingCode(const char *s){sprintf(pairingCodeCommand,"S %9s",s);} // sets the Pairing Code - use is NOT recommended. Use 'S' from CLI instead
void deleteStoredValues(){processSerialCommand("V");} // deletes stored Characteristic values from NVS
@ -415,7 +412,6 @@ struct SpanCharacteristic{
uvSet(value,val);
if(nvsStore){
homeSpan.protectGPIOs(true);
nvsKey=(char *)malloc(16);
uint16_t t;
sscanf(type,"%x",&t);
@ -445,7 +441,6 @@ struct SpanCharacteristic{
nvsFlag=1;
}
}
homeSpan.protectGPIOs(false);
}
uvSet(newValue,value);
@ -542,10 +537,8 @@ struct SpanCharacteristic{
homeSpan.Notifications.push_back(sb); // store SpanBuf in Notifications vector
if(nvsKey){
homeSpan.protectGPIOs(true);
nvs_set_str(homeSpan.charNVS,nvsKey,value.STRING); // store data
nvs_commit(homeSpan.charNVS);
homeSpan.protectGPIOs(false);
}
} // setString()
@ -576,10 +569,8 @@ struct SpanCharacteristic{
homeSpan.Notifications.push_back(sb); // store SpanBuf in Notifications vector
if(nvsKey){
homeSpan.protectGPIOs(true);
nvs_set_blob(homeSpan.charNVS,nvsKey,&value,sizeof(UVal)); // store data
nvs_commit(homeSpan.charNVS);
homeSpan.protectGPIOs(false);
}
}