Skip to content
This repository was archived by the owner on Jul 6, 2019. It is now read-only.

Commit 9b9f8fe

Browse files
committed
ioreg: set-to-clear registers should still have getters
1 parent 54c8484 commit 9b9f8fe

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ioreg/builder/accessors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ fn build_field_accessors<'a>(cx: &'a ExtCtxt, path: &Vec<String>,
6767
build_field_get_fn(cx, path, reg, field)),
6868
node::ReadOnly => vec!(build_field_get_fn(cx, path, reg, field)),
6969
node::WriteOnly => vec!(build_field_set_fn(cx, path, reg, field)),
70-
node::SetToClear => vec!(build_field_clear_fn(cx, path, reg, field)),
70+
node::SetToClear => vec!(build_field_clear_fn(cx, path, reg, field),
71+
build_field_get_fn(cx, path, reg, field)),
7172
};
7273

7374
let access_tag = match field.access {

ioreg/ioreg.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,12 @@ format!("txe={}, rxe={}, br={}", cr.txe(), cr.rxe(), cr.br())
266266
267267
In the case of read-only (resp. write-only) fields the set (resp. get)
268268
method is omitted. In the case of `set_to_clear` fields a `clear`
269-
method is instead produced. For instance, in the case of the `sr`
270-
register's `fe` flag,
269+
method is instead produced in place of `set`. For instance, in the
270+
case of the `sr` register's `fe` flag,
271271
272272
```
273-
pub fn clear_fe(&self) -> UART_sr_Update { ... }
273+
pub fn fe(self: &UART_sr_Getter) -> bool { ... }
274+
pub fn clear_fe(self: &UART_sr_Update) -> UART_sr_Update { ... }
274275
```
275276
276277
### Informal grammar

0 commit comments

Comments
 (0)