mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
dsm: add deinit function
This implements closing of the serial port which previously was not taken care of.
This commit is contained in:
@@ -305,6 +305,13 @@ dsm_init(const char *device)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
dsm_deinit()
|
||||||
|
{
|
||||||
|
close(dsm_fd);
|
||||||
|
dsm_fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef GPIO_SPEKTRUM_PWR_EN
|
#ifdef GPIO_SPEKTRUM_PWR_EN
|
||||||
/**
|
/**
|
||||||
* Handle DSM satellite receiver bind mode handler
|
* Handle DSM satellite receiver bind mode handler
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ __BEGIN_DECLS
|
|||||||
#define DSM_BUFFER_SIZE (DSM_FRAME_SIZE + DSM_FRAME_SIZE / 2)
|
#define DSM_BUFFER_SIZE (DSM_FRAME_SIZE + DSM_FRAME_SIZE / 2)
|
||||||
|
|
||||||
__EXPORT int dsm_init(const char *device);
|
__EXPORT int dsm_init(const char *device);
|
||||||
|
__EXPORT void dsm_deinit();
|
||||||
__EXPORT void dsm_proto_init(void);
|
__EXPORT void dsm_proto_init(void);
|
||||||
__EXPORT int dsm_config(int dsm_fd);
|
__EXPORT int dsm_config(int dsm_fd);
|
||||||
__EXPORT bool dsm_input(int dsm_fd, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, uint8_t *n_bytes,
|
__EXPORT bool dsm_input(int dsm_fd, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, uint8_t *n_bytes,
|
||||||
|
|||||||
Reference in New Issue
Block a user