mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 08:11:36 +08:00
Script name pointer array can be const. Fix a couple of lint errors while I'm here.
This commit is contained in:
@@ -135,7 +135,7 @@ public:
|
|||||||
virtual int setMode(int mode);
|
virtual int setMode(int mode);
|
||||||
virtual int ioctl(struct file *filp, int cmd, unsigned long arg);
|
virtual int ioctl(struct file *filp, int cmd, unsigned long arg);
|
||||||
|
|
||||||
static const char *script_names[];
|
static const char *const script_names[];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum ScriptID {
|
enum ScriptID {
|
||||||
@@ -219,7 +219,7 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* list of script names, must match script ID numbers */
|
/* list of script names, must match script ID numbers */
|
||||||
const char *BlinkM::script_names[] = {
|
const char *const BlinkM::script_names[] = {
|
||||||
"USER",
|
"USER",
|
||||||
"RGB",
|
"RGB",
|
||||||
"WHITE_FLASH",
|
"WHITE_FLASH",
|
||||||
@@ -499,7 +499,7 @@ BlinkM::led()
|
|||||||
for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) {
|
for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) {
|
||||||
if(vehicle_status_raw.voltage_battery < num_of_cells * MAX_CELL_VOLTAGE) break;
|
if(vehicle_status_raw.voltage_battery < num_of_cells * MAX_CELL_VOLTAGE) break;
|
||||||
}
|
}
|
||||||
printf("<blinkm> cells found:%u\n", num_of_cells);
|
printf("<blinkm> cells found:%d\n", num_of_cells);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) {
|
if(vehicle_status_raw.battery_warning == VEHICLE_BATTERY_WARNING_WARNING) {
|
||||||
@@ -827,7 +827,7 @@ BlinkM::get_firmware_version(uint8_t version[2])
|
|||||||
{
|
{
|
||||||
const uint8_t msg = 'Z';
|
const uint8_t msg = 'Z';
|
||||||
|
|
||||||
return transfer(&msg, sizeof(msg), version, sizeof(version));
|
return transfer(&msg, sizeof(msg), version, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void blinkm_usage() {
|
void blinkm_usage() {
|
||||||
|
|||||||
Reference in New Issue
Block a user