+ printf_P(PSTR("ok\r\n"));
+}
+
+static uint8_t shovel_is_at_pos(int32_t pos)
+{
+ int32_t diff;
+ diff = pos - encoders_spi_get_value(SHOVEL_ENCODER);
+ if (diff < 0)
+ diff = -diff;
+ if (diff < 500)
+ return 1;
+ return 0;
+}
+
+void shovel_down(void)
+{
+ quadramp_set_1st_order_vars(&cobboard.shovel.qr, 2500, 2500);
+ quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 50, 80);
+ cs_set_consign(&cobboard.shovel.cs, SHOVEL_DOWN);
+}
+
+void shovel_mid(void)
+{
+ quadramp_set_1st_order_vars(&cobboard.shovel.qr, 2500, 2500);
+ quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 80, 80);
+ cs_set_consign(&cobboard.shovel.cs, SHOVEL_MID);
+}
+
+void shovel_up(void)
+{
+ if (state_get_cob_count() <= 1)
+ quadramp_set_1st_order_vars(&cobboard.shovel.qr, 1000, 2500);
+ else
+ quadramp_set_1st_order_vars(&cobboard.shovel.qr, 2000, 2500);
+ quadramp_set_2nd_order_vars(&cobboard.shovel.qr, 80, 15);
+ cs_set_consign(&cobboard.shovel.cs, SHOVEL_UP);
+}
+
+uint8_t shovel_is_up(void)
+{
+ return shovel_is_at_pos(SHOVEL_UP);
+}
+
+uint8_t shovel_is_down(void)
+{
+ return shovel_is_at_pos(SHOVEL_DOWN);