mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 03:57:45 +08:00
[vms_ecu_demo] Added debugging message
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<init fun="vms_ecu_demo_init()"/>
|
<init fun="vms_ecu_demo_init()"/>
|
||||||
<periodic fun="vms_ecu_demo_periodic()" freq="10."/>
|
<periodic fun="vms_ecu_demo_periodic()" freq="10."/>
|
||||||
|
<periodic fun="vms_ecu_demo_downlink()" freq="4." autorun="TRUE"/>
|
||||||
<makefile>
|
<makefile>
|
||||||
<file name="vms_ecu_demo.c"/>
|
<file name="vms_ecu_demo.c"/>
|
||||||
<define name="USE_DAC1" value="1" />
|
<define name="USE_DAC1" value="1" />
|
||||||
|
|||||||
@@ -27,6 +27,11 @@
|
|||||||
* for more details
|
* for more details
|
||||||
*/
|
*/
|
||||||
#include "modules/fsae_electric/vms_ecu_demo.h"
|
#include "modules/fsae_electric/vms_ecu_demo.h"
|
||||||
|
|
||||||
|
// Messages
|
||||||
|
#include "pprzlink/messages.h"
|
||||||
|
#include "subsystems/datalink/downlink.h"
|
||||||
|
|
||||||
#include "mcu_periph/gpio.h"
|
#include "mcu_periph/gpio.h"
|
||||||
#include "ch.h" // for DAC
|
#include "ch.h" // for DAC
|
||||||
#include "hal.h" // for DAC
|
#include "hal.h" // for DAC
|
||||||
@@ -182,20 +187,6 @@ static THD_FUNCTION(can_tx, p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if PERIODIC_TELEMETRY
|
|
||||||
#include "subsystems/datalink/telemetry.h"
|
|
||||||
static void send_ecu(struct transport_tx *trans, struct link_device *dev)
|
|
||||||
{
|
|
||||||
pprz_msg_send_ECU(trans, dev, AC_ID,
|
|
||||||
&stg_in,
|
|
||||||
&stb_in,
|
|
||||||
&ain_1,
|
|
||||||
&ain_2,
|
|
||||||
&ain_3,
|
|
||||||
&ain_4);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void vms_ecu_demo_init(void)
|
void vms_ecu_demo_init(void)
|
||||||
{
|
{
|
||||||
// Digital
|
// Digital
|
||||||
@@ -238,10 +229,6 @@ void vms_ecu_demo_init(void)
|
|||||||
chThdCreateStatic(can_tx_wa, sizeof(can_tx_wa), NORMALPRIO + 7,
|
chThdCreateStatic(can_tx_wa, sizeof(can_tx_wa), NORMALPRIO + 7,
|
||||||
can_tx, NULL);
|
can_tx, NULL);
|
||||||
|
|
||||||
#if PERIODIC_TELEMETRY
|
|
||||||
register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_ECU, send_ecu);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//DAC
|
//DAC
|
||||||
/*
|
/*
|
||||||
* Starting DAC1 driver, setting up the output pin as analog as suggested
|
* Starting DAC1 driver, setting up the output pin as analog as suggested
|
||||||
@@ -311,6 +298,17 @@ void vms_ecu_demo_periodic(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void vms_ecu_demo_downlink(void) {
|
||||||
|
DOWNLINK_SEND_ECU(DefaultChannel, DefaultDevice,
|
||||||
|
&stg_in,
|
||||||
|
&stb_in,
|
||||||
|
&ain_1,
|
||||||
|
&ain_2,
|
||||||
|
&ain_3,
|
||||||
|
&ain_4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void vms_ecu_demo_UpdateDac1(uint16_t val) {
|
void vms_ecu_demo_UpdateDac1(uint16_t val) {
|
||||||
dac_1 = val;
|
dac_1 = val;
|
||||||
dac_ref1 = dac_1;
|
dac_ref1 = dac_1;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ extern bool rtds;
|
|||||||
|
|
||||||
void vms_ecu_demo_init(void);
|
void vms_ecu_demo_init(void);
|
||||||
void vms_ecu_demo_periodic(void);
|
void vms_ecu_demo_periodic(void);
|
||||||
|
void vms_ecu_demo_downlink(void);
|
||||||
/** Reset sweep number */
|
/** Reset sweep number */
|
||||||
extern void vms_ecu_demo_UpdateDac1(uint16_t val);
|
extern void vms_ecu_demo_UpdateDac1(uint16_t val);
|
||||||
extern void vms_ecu_demo_UpdateDac2(uint16_t val);
|
extern void vms_ecu_demo_UpdateDac2(uint16_t val);
|
||||||
|
|||||||
Reference in New Issue
Block a user