Skip to content

Commit

Permalink
Change int to uint32_t for error code
Browse files Browse the repository at this point in the history
  • Loading branch information
EosBandi committed Jun 24, 2024
1 parent 2083ea4 commit c49ade5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_Generator/AP_Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Generator/AP_Generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Generator/AP_Generator_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Generator/AP_Generator_IE_FuelCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Generator/AP_Generator_RichenPower.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_Scripting/docs/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion libraries/AP_Scripting/generator/description/bindings.desc
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c49ade5

Please sign in to comment.