Skip to content

Commit

Permalink
Merge pull request #83 from MK16kawai/dev
Browse files Browse the repository at this point in the history
update camera&modbus
  • Loading branch information
Neutree authored Jan 8, 2025
2 parents fbd1d45 + 0c56ead commit 0bb488f
Show file tree
Hide file tree
Showing 9 changed files with 2,376 additions and 40 deletions.
7 changes: 7 additions & 0 deletions components/comm/src/maix_modbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ ::maix::err::Err Slave::set_timeout(uint32_t sec, uint32_t usec)
return ::maix::err::Err::ERR_RUNTIME;
// __error_and_throw__(msg);
}
if (::modbus_set_response_timeout(this->ctx_.get(), this->curr_timeout_sec_, this->curr_timeout_usec_) < 0) {
std::string msg(this->TAG()+" set timeout failed");
log::warn(msg.c_str());
return ::maix::err::Err::ERR_RUNTIME;
}
return ::maix::err::Err::ERR_NONE;
}

Expand Down Expand Up @@ -299,6 +304,8 @@ ::maix::err::Err Slave::__receive__()
}
return ::maix::err::Err::ERR_NONE;
}
/* flush */
::modbus_flush(this->ctx_.get());
if (this->debug_) {
log::warn("%s receive failed", this->TAG().c_str());
}
Expand Down
6 changes: 3 additions & 3 deletions projects/app_camera/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ append_srcs_dir(ADD_SRCS "assets")
###############################################

###### Add required/dependent components ######
list(APPEND ADD_REQUIREMENTS basic lvgl FFmpeg)
list(APPEND ADD_REQUIREMENTS basic lvgl FFmpeg peripheral ext_dev)
###############################################

###### Add link search path for requirements/libs ######
Expand All @@ -36,8 +36,8 @@ list(APPEND ADD_REQUIREMENTS basic lvgl FFmpeg)
###############################################

#### Add compile option for this component ####
#### Just for this component, won't affect other
#### modules, including component that depend
#### Just for this component, won't affect other
#### modules, including component that depend
#### on this component
# list(APPEND ADD_DEFINITIONS_PRIVATE -DAAAAA=1)

Expand Down
Loading

0 comments on commit 0bb488f

Please sign in to comment.