-
Notifications
You must be signed in to change notification settings - Fork 100
Conversation
@bharrisau I've updated the rustdoc upload, feel free to have a look. The |
use super::super::node; | ||
|
||
/// A visitor to build accessor functions for each register struct | ||
pub struct BuildAccessors<'a, 'b, 'c> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to unify lifetimes here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vladimir Pouzanov [email protected] writes:
+/// A visitor to build accessor functions for each register struct
+pub struct BuildAccessors<'a, 'b, 'c> {Any reason not to unify lifetimes here?
I played around with these for quite a while to make the borrow checker
happy. That being said, things have changed substantially since then, so
perhaps they can now be unified. I'll have a look later.
I've added a few notes on the code. I will have some more on the style later on when this settles a bit, but overall it's very nice, great job! |
@farcaller, @bharrisau what do we think about peripheral instantiation? I'm tempted to punt on bit-banding support for now as I don't have a lot of time recently and I'd like to get this merged eventually. |
I'll throw bit-banding in later. The easiest is to use weak linkage of the bitband memory address (and I'll be able to do a memory map macro when I get a chance that will generate that). What do you mean by peripheral instantiation? As in, generating the |
@bharrisau That sounds reasonable enough. Unfortunately it seems like something has broken with the recent rustc/zinc changes. After rebasing I'm seeing the following unhelpful build failure,
|
If I had to guess - there is an '=' used incorrectly in a macro. |
Maybe somewhere you are calling |
No, this is rust-lang/rust#15972. Build with |
(I've seen the same problem in #116) |
@farcaller it seems like the fix has made it upstream. I'm building a new rustc as we speak. Well done tracking this one down, by the way. |
This morning I brushed off these patches, rebased them, and did a bit more porting of K20. I found a few bugs and cleaned up the documentation a bit further in the process. At this point I feel pretty good about merging so folks can finally start using this in anger. What do people think? |
// limitations under the License. | ||
|
||
use syntax::ast; | ||
use syntax::ast::{P}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove {
/}
here and on next line.
Thanks for all the work, looks nice. I've left a few comments in for you. Also, can you split the macro part and the new ioreg implementations to separate PRs? |
I almost forgot: My tree currently has Would there be any objection to my adding |
I'm fine with that. It might be useful to add a reference to where in the datasheet you can find the register description, but those fluctuate quite as well. Maybe chapter number / name would be fine? |
@farcaller as far as I can tell things look good for merge. |
@bgamari great stuff! I don't seem to see any unit tests here, so I suppose you are intending to add them in a separate pull request... |
@errordeveloper there is still a bit of work to be done on the documentation and testing side of things but I'd like to get this merged to get people using it and lessen the maintenance burden. |
Need to define library path; not sure how this worked before.
let clear_mask: $unpacked_ty = $clear as $unpacked_ty; | ||
if self.mask != 0 { | ||
let v: $unpacked_ty = self.reg.value.get() & ! clear_mask & ! self.mask; | ||
self.reg.value.set(self.value | v); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As some future work, will just double check how the generated ASM for this looks.
Wow, awesome work. I haven't had a chance to have a thorough look (and I probably wont until my contract finishes at the end of this month). Can someone land a PR that renames all the current |
Ok, let's land this. |
ioreg syntax extension Reviewed-by: farcaller
ioreg syntax extension Reviewed-by: farcaller
ioreg syntax extension Reviewed-by: farcaller
ioreg syntax extension Reviewed-by: farcaller
Added new ioreg syntax extension
I'll need to write something more coherent here but here is the continuation of the ioreg work originally discussed in #90. I've restructured and cleaned up the builder code substantially and getter and setter objects have been implemented. Note that this currently requires some compiler bits that have yet to be merged to compile. You can find rustdoc output for the code generated by a simple example here. More on this later when it's not as late.
I would apply the proper label to indicate this is work in progress but it seems I don't have permission to do so.
Remaining work