-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module to use radio channel as remote camera trigger #937
Conversation
agressiva
commented
Nov 11, 2014
new file: conf/modules/digital_cam_shoot_rc.xml new file: sw/airborne/modules/digital_cam/dc_shoot_rc.c new file: sw/airborne/modules/digital_cam/dc_shoot_rc.h
PRINT_CONFIG_MSG("Using RADIO SHOOT"); | ||
#endif | ||
|
||
void dc_shoot_rc_init(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to add an init function if it is empty...
Please adhere to coding style.. |
#include "inter_mcu.h" | ||
#include "dc.h" | ||
|
||
#ifdef DC_RADIO_SHOOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really needed, as it will fail to compile anyway if DC_RADIO_SHOOT
is not defined.
Would make more sense to print a useful error message if it is not defined.
@gautierhattenberger as this depends on one of the digital_cam modules, can we add that as a depend` |
modified: conf/modules/digital_cam_shoot_rc.xml modified: sw/airborne/modules/digital_cam/dc_shoot_rc.c modified: sw/airborne/modules/digital_cam/dc_shoot_rc.h
feliz, codestyle ok and created the message if DC_RADIO_SHOOT not defined |
ok, dependency with digital_cam created. |
Regarding the dependency, I'm not entirely sure if it works with The dependency has to be satisfied by any of the digital_cam modules, so digital_cam.xml, digital_cam_uart.xml, digital_cam_servo.xml or digital_cam_i2c.xml. |
not tested. |
well, i tried to compile using dc_shot_rc but i removed the digital_cam module. As o not know how the dependency work i cant tell anything ! |
static uint8_t rd_shoot = 0; | ||
static uint8_t rd_num = 0; | ||
|
||
if ((rd_shoot == 0) && (((float)(*fbw_state).channels[DC_RADIO_SHOOT]) > 3000)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cast to float?
Regarding the dependency, you should have seen a warning at the beginning: |
Removed cast to float and changed the way i use the pointer to more clean way. You are right about dependency. I take more attention and the message come in the very first lines |