Skip to content
Snippets Groups Projects
Commit 0c6280ba authored by Beat Küng's avatar Beat Küng
Browse files

tune_control: fix clang-tidy errors

parent 86acd237
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define MAX_NOTE_ITERATION 50 #define MAX_NOTE_ITERATION 50
static void usage(void); static void usage();
static orb_advert_t tune_control_pub = nullptr; static orb_advert_t tune_control_pub = nullptr;
...@@ -91,10 +91,10 @@ tune_control_main(int argc, char *argv[]) ...@@ -91,10 +91,10 @@ tune_control_main(int argc, char *argv[])
{ {
Tunes tunes; Tunes tunes;
bool string_input = false; bool string_input = false;
const char *tune_string = NULL; const char *tune_string = nullptr;
int myoptind = 1; int myoptind = 1;
int ch; int ch;
const char *myoptarg = NULL; const char *myoptarg = nullptr;
unsigned int value; unsigned int value;
tune_control_s tune_control = {}; tune_control_s tune_control = {};
tune_control.tune_id = 0; tune_control.tune_id = 0;
...@@ -103,7 +103,7 @@ tune_control_main(int argc, char *argv[]) ...@@ -103,7 +103,7 @@ tune_control_main(int argc, char *argv[])
while ((ch = px4_getopt(argc, argv, "f:d:t:m:s:", &myoptind, &myoptarg)) != EOF) { while ((ch = px4_getopt(argc, argv, "f:d:t:m:s:", &myoptind, &myoptarg)) != EOF) {
switch (ch) { switch (ch) {
case 'f': case 'f':
value = (uint16_t)(strtol(myoptarg, NULL, 0)); value = (uint16_t)(strtol(myoptarg, nullptr, 0));
if (value > 0 && value < 22000) { if (value > 0 && value < 22000) {
tune_control.frequency = value; tune_control.frequency = value;
...@@ -116,11 +116,11 @@ tune_control_main(int argc, char *argv[]) ...@@ -116,11 +116,11 @@ tune_control_main(int argc, char *argv[])
break; break;
case 'd': case 'd':
tune_control.duration = (uint32_t)(strtol(myoptarg, NULL, 0)); tune_control.duration = (uint32_t)(strtol(myoptarg, nullptr, 0));
break; break;
case 't': case 't':
value = (uint8_t)(strtol(myoptarg, NULL, 0)); value = (uint8_t)(strtol(myoptarg, nullptr, 0));
if (value > 0 && value < tunes.get_default_tunes_size()) { if (value > 0 && value < tunes.get_default_tunes_size()) {
tune_control.tune_id = value; tune_control.tune_id = value;
...@@ -145,7 +145,7 @@ tune_control_main(int argc, char *argv[]) ...@@ -145,7 +145,7 @@ tune_control_main(int argc, char *argv[])
break; break;
case 's': case 's':
value = (uint16_t)(strtol(myoptarg, NULL, 0)); value = (uint16_t)(strtol(myoptarg, nullptr, 0));
if (value > 0 && value < 100) { if (value > 0 && value < 100) {
tune_control.strength = value; tune_control.strength = value;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment