git.droids-corp.org
/
aversive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timer: fix function definitions for uC having several output compare
[aversive.git]
/
projects
/
microb2010
/
mainboard
/
actuator.c
diff --git
a/projects/microb2010/mainboard/actuator.c
b/projects/microb2010/mainboard/actuator.c
index
1d134bb
..
9ed1d63
100644
(file)
--- a/
projects/microb2010/mainboard/actuator.c
+++ b/
projects/microb2010/mainboard/actuator.c
@@
-48,6
+48,7
@@
#include <rdline.h>
#include "main.h"
#include <rdline.h>
#include "main.h"
+#include "robotsim.h"
void pwm_set_and_save(void *pwm, int32_t val)
{
void pwm_set_and_save(void *pwm, int32_t val)
{
@@
-57,24
+58,32
@@
void pwm_set_and_save(void *pwm, int32_t val)
val = 4095;
if (val < -4095)
val = -4095;
val = 4095;
if (val < -4095)
val = -4095;
-
+
if (pwm == LEFT_PWM)
mainboard.pwm_l = val;
else if (pwm == RIGHT_PWM)
mainboard.pwm_r = val;
if (pwm == LEFT_PWM)
mainboard.pwm_l = val;
else if (pwm == RIGHT_PWM)
mainboard.pwm_r = val;
+#ifdef HOST_VERSION
+ robotsim_pwm(pwm, val);
+#else
pwm_ng_set(pwm, val);
pwm_ng_set(pwm, val);
+#endif
}
void support_balls_deploy(void)
{
}
void support_balls_deploy(void)
{
- pwm_ng_set(SUPPORT_BALLS_R_SERVO, 510);
- pwm_ng_set(SUPPORT_BALLS_L_SERVO, 205);
+#ifndef HOST_VERSION
+ pwm_ng_set(SUPPORT_BALLS_R_SERVO, 550);
+ pwm_ng_set(SUPPORT_BALLS_L_SERVO, 165);
+#endif
}
void support_balls_pack(void)
{
}
void support_balls_pack(void)
{
- pwm_ng_set(SUPPORT_BALLS_R_SERVO, 250);
- pwm_ng_set(SUPPORT_BALLS_L_SERVO, 480);
+#ifndef HOST_VERSION
+ pwm_ng_set(SUPPORT_BALLS_R_SERVO, 290);
+ pwm_ng_set(SUPPORT_BALLS_L_SERVO, 430);
+#endif
}
void actuator_init(void)
}
void actuator_init(void)