Skip to content

Commit

Permalink
Merge pull request #3402 from hudson-ayers/comment-update
Browse files Browse the repository at this point in the history
Update command 0 comments on stabilized userspace drivers
  • Loading branch information
bradjc committed Apr 18, 2023
2 parents 56f7135 + 3331ade commit 4dd770c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions capsules/core/src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,9 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> SyscallDriver for AdcDedicated<'
}
match command_num {
// check if present
// TODO(Tock 3.0): TRD104 specifies that Command 0 should return Success, not SuccessU32,
// but this driver is unchanged since it has been stabilized. It will be brought into
// compliance as part of the next major release of Tock.
0 => CommandReturn::success_u32(self.channels.len() as u32),

// Single sample on channel
Expand Down
3 changes: 3 additions & 0 deletions capsules/core/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ impl<'a, P: gpio::InterruptPin<'a>> SyscallDriver for Button<'a, P> {
let pins = self.pins;
match command_num {
// return button count
// TODO(Tock 3.0): TRD104 specifies that Command 0 should return Success, not SuccessU32,
// but this driver is unchanged since it has been stabilized. It will be brought into
// compliance as part of the next major release of Tock.
0 => CommandReturn::success_u32(pins.len() as u32),

// enable interrupts for a button
Expand Down
3 changes: 3 additions & 0 deletions capsules/core/src/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ impl<L: led::Led, const NUM_LEDS: usize> SyscallDriver for LedDriver<'_, L, NUM_
fn command(&self, command_num: usize, data: usize, _: usize, _: ProcessId) -> CommandReturn {
match command_num {
// get number of LEDs
// TODO(Tock 3.0): TRD104 specifies that Command 0 should return Success, not SuccessU32,
// but this driver is unchanged since it has been stabilized. It will be brought into
// compliance as part of the next major release of Tock.
0 => CommandReturn::success_u32(NUM_LEDS as u32),

// on
Expand Down

0 comments on commit 4dd770c

Please sign in to comment.