diff --git a/libraries/AP_Generator/AP_Generator.cpp b/libraries/AP_Generator/AP_Generator.cpp index a6ff3f08f07dd..cf28d1fd661b0 100644 --- a/libraries/AP_Generator/AP_Generator.cpp +++ b/libraries/AP_Generator/AP_Generator.cpp @@ -173,7 +173,7 @@ bool AP_Generator::run() return _driver_ptr->run(); } -int AP_Generator::get_errorcode() +uint32_t AP_Generator::get_errorcode() { // Return 0 if no driver if (_driver_ptr == nullptr) { diff --git a/libraries/AP_Generator/AP_Generator.h b/libraries/AP_Generator/AP_Generator.h index d160077892cb7..c6cde1e78dbca 100644 --- a/libraries/AP_Generator/AP_Generator.h +++ b/libraries/AP_Generator/AP_Generator.h @@ -58,7 +58,7 @@ class AP_Generator bool run(void); // error code returns 0 if no error or the error code return function is not implemented - int get_errorcode(void); + uint32_t get_errorcode(void); void send_generator_status(const class GCS_MAVLINK &channel); diff --git a/libraries/AP_Generator/AP_Generator_Backend.h b/libraries/AP_Generator/AP_Generator_Backend.h index cb987a5371123..e44349a9de207 100644 --- a/libraries/AP_Generator/AP_Generator_Backend.h +++ b/libraries/AP_Generator/AP_Generator_Backend.h @@ -33,7 +33,7 @@ class AP_Generator_Backend virtual bool run(void) { return false; } // Error code returns 0 if no error or the error code return function is not implemented - virtual int get_errorcode(void) {return 0;} + virtual uint32_t get_errorcode(void) {return 0;} // Use generator mavlink message virtual void send_generator_status(const GCS_MAVLINK &channel) {} diff --git a/libraries/AP_Generator/AP_Generator_IE_FuelCell.h b/libraries/AP_Generator/AP_Generator_IE_FuelCell.h index a5e65350bf187..fc6221462d099 100644 --- a/libraries/AP_Generator/AP_Generator_IE_FuelCell.h +++ b/libraries/AP_Generator/AP_Generator_IE_FuelCell.h @@ -27,7 +27,7 @@ class AP_Generator_IE_FuelCell : public AP_Generator_Backend void update(void) override; // Allow generator error code to pass up to frontend and export to LUA - int get_errorcode(void) override {return _err_code;} + uint32_t get_errorcode(void) override {return _err_code;} protected: diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.h b/libraries/AP_Generator/AP_Generator_RichenPower.h index 2bed30975cee1..4a81c6c51968f 100644 --- a/libraries/AP_Generator/AP_Generator_RichenPower.h +++ b/libraries/AP_Generator/AP_Generator_RichenPower.h @@ -54,7 +54,7 @@ class AP_Generator_RichenPower : public AP_Generator_Backend bool healthy() const override; // Allow generator error code to pass up to fronten and export to LUA - int get_errorcode(void) override {return last_reading.errors;} + uint32_t get_errorcode(void) override {return last_reading.errors;} private: diff --git a/libraries/AP_Scripting/docs/docs.lua b/libraries/AP_Scripting/docs/docs.lua index aa88fd91b4716..fa9b12b892a1f 100644 --- a/libraries/AP_Scripting/docs/docs.lua +++ b/libraries/AP_Scripting/docs/docs.lua @@ -3577,5 +3577,5 @@ function visual_odom:quality() end generator = {} -- returns the generator error code ---- @return integer +--- @return uint32_t_ud function generator:get_errorcode() end \ No newline at end of file diff --git a/libraries/AP_Scripting/generator/description/bindings.desc b/libraries/AP_Scripting/generator/description/bindings.desc index 337253d314047..a73c0484abd2a 100644 --- a/libraries/AP_Scripting/generator/description/bindings.desc +++ b/libraries/AP_Scripting/generator/description/bindings.desc @@ -959,4 +959,4 @@ singleton AP_VisualOdom method quality int8_t include AP_Generator/AP_Generator.h singleton AP_Generator depends HAL_GENERATOR_ENABLED singleton AP_Generator rename generator -singleton AP_Generator method get_errorcode int8_t +singleton AP_Generator method get_errorcode uint32_t