Register / Login | Desktop view |
extern IoAbstractionRef multiIO;
extern MultiIoAbstractionRef multiIo;
menuMgr.initForUpDownOk(&renderer, &menuToasterPower, 2, 10, 4);
menuMgr.initForUpDownOk(&renderer, &menuToasterPower, 10, 2, 4);
Question1:
Question 2:
Question 3:
Bug report:
Answer 1: Does this not work in practice?
conflicting declaration 'MultiIoAbstraction* multiIo'
#include "Valve_Controller_Master_menu.h"
#include
#include
#include
#include
#define expanders 100 // start our expanders on pin 100
MultiIoAbstractionRef multiIo = multiIoExpander(expanders); //<--Conflicting with this line
/**************** PIN MAP ***********************
All pin numbers defined here with friendly names
(on Teensy or expanders) used to address them.
Pins used for Serial and Wire functions do not
need to be defined here. ***********************/
//A Bunch of PIN# declarations omitted here
/************** END PIN MAP ******************/
uint8_t EncoderValue = 0;
// When any switches are pressed, this function will be called.
void onSwitchPressed(uint8_t key, bool held) {
/* Uncomment below for debugging*/
//Serial.print("Switch ");
//Serial.print(key);
//Serial.println(held ? " Held down" : " Pressed");
}
//When the encoder is turned, this function will be called.
void onEncoderChange(int newValue) {
EncoderValue+=newValue;
/* Uncomment below for debugging*/
//Serial.println(EncoderValue);
}
void setup() {
setupMenu(); // Start the Menu Business
Wire.begin();
/* Uncomment below for debugging*/
//Serial.begin(115200);
// I/O set up...
multiIoAddExpander(multiIo, ioFrom23017(0x20, ACTIVE_LOW_OPEN, exp1_int), 16); // Add the primary expander for Front Panel Buttons/Encoder, Interrupt on Pin 5
multiIoAddExpander(multiIo, ioFrom8574(0x21, exp2_int), 8); // Add secondary expander for Dual Axis Controller buttons and 2x LEDs, Interrupt on Pin 6
switches.initialiseInterrupt(multiIo, true); // Make these Pins work as interrupts (pullup enabled)
for (int i=0; i<24; i++) { // Setup all the pins
if (i==2 || i==4 || i==8 || i==10) { // Do nothing. These pins set up in TcMenu or Pin 108 is set up below with Pin 109.
} else if (i==9) {
setupRotaryEncoderWithInterrupt(encoder_a, encoder_b, onEncoderChange, HWACCEL_REGULAR, QUARTER_CYCLE); // Setup Pins 108-109 as encoder input
} else if (i==16 || i==17) { //These two are LED outputs for Axis Selection
ioDevicePinMode(multiIo, expanders + i, OUTPUT);
} else { // Everything else becomes a button input
switches.addSwitch(expanders + i, onSwitchPressed);
ioDevicePinMode(multiIo, expanders + i, INPUT_PULLUP);
}
}
// I/O set up done.
}
void loop() {
taskManager.runLoop();
}
Answer 2 You can take complere control...:
Answer 3: Are you asking to be able to turn off this behaviour?
Bug report:
MultiIoAbstractionRef multiIo = multiIoExpander(expanders); //<--Conflicting with this line
IoAbstractionRef multiIoRef = multiIo;
/**
* Completely turn off the reset interval so there will never be a reset.
*/
void turnOffResetLogic() {
resetValInTicks = MAX_TICKS;
}