Skip to content

Instantly share code, notes, and snippets.

@znuh
Created December 1, 2012 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save znuh/4184988 to your computer and use it in GitHub Desktop.
Save znuh/4184988 to your computer and use it in GitHub Desktop.
OpenHR20E mod: upper limit for valve
--- motor.c (revision 366)
+++ motor.c (working copy)
@@ -55,6 +55,8 @@
#include "com.h"
#include "debug.h"
+#define MY_MAX_VAL 500
+
// typedefs
@@ -105,9 +107,11 @@
MOTOR_wait_for_new_calibration--;
} else {
if (MOTOR_calibration_step==1) {
- MOTOR_calibration_step++;
+ //MOTOR_calibration_step++;
+ MOTOR_calibration_step = 3;
MOTOR_PosStop= +MOTOR_MAX_IMPULSES;
- MOTOR_Control(open);
+ //MOTOR_Control(open);
+ MOTOR_Control(close);
}
}
if (MOTOR_calibration_step==-2) {
@@ -371,7 +375,8 @@
{
if (MOTOR_calibration_step == 3 ) {
MOTOR_calibration_step = 0; // calibration DONE
- MOTOR_PosMax -= MOTOR_PosAct;
+ //MOTOR_PosMax -= MOTOR_PosAct;
+ MOTOR_PosMax = MY_MAX_VAL;
} else if (MOTOR_PosAct>MOTOR_MIN_IMPULSES) {
MOTOR_calibration_step = -1; // calibration error
CTL_error |= CTL_ERR_MOTOR;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment