Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make bits argument variadic #18

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/MMIO/MMIOMacros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ public macro Register(bitWidth: Int) =
// external macro declarations. However, this parameter will never be used by
// expansion for reserved bitfields, so it is omitted to avoid programmer use.
@attached(accessor)
public macro Reserved(bits: Range<Int>) =
public macro Reserved(bits: Range<Int>...) =
#externalMacro(module: "MMIOMacros", type: "ReservedMacro")

@attached(accessor)
public macro ReadWrite(bits: Range<Int>, as: Any? = nil) =
public macro ReadWrite(bits: Range<Int>..., as: Any? = nil) =
#externalMacro(module: "MMIOMacros", type: "ReadWriteMacro")

@attached(accessor)
public macro ReadOnly(bits: Range<Int>, as: Any? = nil) =
public macro ReadOnly(bits: Range<Int>..., as: Any? = nil) =
#externalMacro(module: "MMIOMacros", type: "ReadOnlyMacro")

@attached(accessor)
public macro WriteOnly(bits: Range<Int>, as: Any? = nil) =
public macro WriteOnly(bits: Range<Int>..., as: Any? = nil) =
#externalMacro(module: "MMIOMacros", type: "WriteOnlyMacro")