Skip to content

Commit b16aa9e

Browse files
committed
bugfix not using repeated start for fusb300c read register
1 parent 75efcca commit b16aa9e

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

klib/hardware/usb_controller/fusb300c.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,9 @@ namespace klib::hardware::usb_controller {
7979
* @return status
8080
*/
8181
static bool read_reg(const reg command, std::span<uint8_t> data) {
82-
// write the register we want to read
83-
if (!Bus::write(Address, {reinterpret_cast<const uint8_t*>(&command), sizeof(command)})) {
84-
return false;
85-
}
86-
87-
// start a read
88-
return Bus::read(Address, data);
82+
return Bus::write_read(
83+
Address, {reinterpret_cast<const uint8_t*>(&command), sizeof(command)}, data
84+
);
8985
}
9086

9187
/**

0 commit comments

Comments
 (0)