Skip to content

Commit

Permalink
clean up rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas71640 committed Dec 9, 2024
1 parent e298ff4 commit 2cd9af3
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 473 deletions.
20 changes: 0 additions & 20 deletions lib/slave/include/kickcat/AbstractESC.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,10 @@ namespace kickcat
virtual int32_t write(uint16_t address, void const* data, uint16_t size) = 0;

std::tuple<uint8_t, SyncManager> find_sm(uint16_t controlMode);

void routine_init();
void routine_preop();
void routine_safeop();
void routine_op();

void set_state_on_error(State state, StatusCode error_code);
void clear_error();

uint16_t al_status() { return al_status_;};

bool has_expired_watchdog() { return not (watchdog_ & 0x1); }

void sm_activate(SyncManagerConfig const& sm);
void sm_deactivate(SyncManagerConfig const& sm);
void set_sm_activate(std::vector<SyncManagerConfig> const& sync_managers, bool is_activated);
private:
bool configure_pdo_sm();

void update_process_data_input();
void update_process_data_output();

bool is_valid_sm(SyncManagerConfig const& sm_ref);
bool are_valid_sm(std::vector<SyncManagerConfig> const& sm);
void set_sm_activate(std::vector<SyncManagerConfig> const& sync_managers, bool is_activated);
};

Expand Down
1 change: 1 addition & 0 deletions lib/slave/include/kickcat/FSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace kickcat
void setOutputDataValid(bool isValid);
void start();
void play();
State getState();

private:
AbstractState* findState(uint8_t id);
Expand Down
1 change: 0 additions & 1 deletion lib/slave/include/kickcat/PDO.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace kickcat

hresult configure_pdo_sm();
StatusCode is_sm_config_ok();
void set_sm_activated(bool is_activated);
void set_sm_output_activated(bool is_activated);
void set_sm_input_activated(bool is_activated);
void set_process_data_input(uint8_t* buffer);
Expand Down
4 changes: 3 additions & 1 deletion lib/slave/include/kickcat/Slave2.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace kickcat
void set_mailbox(mailbox::response::Mailbox* mbx);
void start();
void routine();
State getState();
void setOutputDataValid(bool isValid);

private:
AbstractESC* esc_;
Expand All @@ -29,7 +31,7 @@ namespace kickcat
FSM::PreOP preOp_{*esc_, *pdo_};
FSM::SafeOP safeOP_{*esc_, *pdo_};
FSM::OP OP_{*esc_, *pdo_};
FSM::StateMachine stateMachine{*esc_, {{&init_, &preOp_, &safeOP_, &OP_}}};
FSM::StateMachine stateMachine_{*esc_, {{&init_, &preOp_, &safeOP_, &OP_}}};
};
}

Expand Down
Loading

0 comments on commit 2cd9af3

Please sign in to comment.