debugging pin guard

pull/37/head
TimEvWw 2016-05-06 20:15:38 -01:00
parent 7533903fea
commit b7f78619db
4 changed files with 30 additions and 4 deletions

View File

@ -78,6 +78,12 @@ int ParameterList::writeValue(int id, int value) {
int ParameterList::readAllValues() {
Serial.print("R99");
Serial.print(" ");
Serial.print("reading all values");
Serial.print("\n");
// Make a dump of all values
// Check if it's a valid value to keep the junk out of the list
for (int i; i < PARAM_NR_OF_PARAMS; i++)
@ -265,6 +271,21 @@ bool ParameterList::validParam(int id) {
case ENCODER_MISSED_STEPS_DECAY_X:
case ENCODER_MISSED_STEPS_DECAY_Y:
case ENCODER_MISSED_STEPS_DECAY_Z:
case PIN_GUARD_1_PIN_NR:
case PIN_GUARD_1_TIME_OUT:
case PIN_GUARD_1_ACTIVE_STATE:
case PIN_GUARD_2_PIN_NR:
case PIN_GUARD_2_TIME_OUT:
case PIN_GUARD_2_ACTIVE_STATE:
case PIN_GUARD_3_PIN_NR:
case PIN_GUARD_3_TIME_OUT:
case PIN_GUARD_3_ACTIVE_STATE:
case PIN_GUARD_4_PIN_NR:
case PIN_GUARD_4_TIME_OUT:
case PIN_GUARD_4_ACTIVE_STATE:
case PIN_GUARD_5_PIN_NR:
case PIN_GUARD_5_TIME_OUT:
case PIN_GUARD_5_ACTIVE_STATE:
return true;
default:
return false;

View File

@ -6,7 +6,7 @@
//#define NULL 0
const int PARAM_NR_OF_PARAMS= 0;
const int PARAM_NR_OF_PARAMS = 300;
enum ParamListEnum

View File

@ -18,6 +18,7 @@ PinGuard::PinGuard() {
pinGuardPin[2] = PinGuardPin();
pinGuardPin[3] = PinGuardPin();
pinGuardPin[4] = PinGuardPin();
loadConfig();
}

View File

@ -33,11 +33,12 @@ void interrupt(void) {
interruptBusy = true;
StepperControl::getInstance()->handleMovementInterrupt();
//
blinkLed();
// Check the actions triggered once per second
if (interruptSecondTimer >= 1000000 / MOVEMENT_INTERRUPT_SPEED) {
interruptSecondTimer = 0;
PinGuard::getInstance()->checkPins();
//blinkLed();
}
interruptBusy = false;
@ -81,8 +82,11 @@ void setup() {
Serial.begin(115200);
// Start the motor handling
ServoControl::getInstance()->attach();
//StepperControl::getInstance()->initInterrupt();
// Dump all values to the serial interface
ParameterList::getInstance()->readAllValues();
// Get the settings for the pin guard
PinGuard::getInstance()->loadConfig();