8000 proto: use enum endpoints in genhdr by cobratbq · Pull Request #39 · tillitis/tkey-libs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

proto: use enum endpoints in genhdr #39

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion include/tkey/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct frame_header {
size_t len;
};

uint8_t genhdr(uint8_t id, uint8_t endpoint, uint8_t status, enum cmdlen len);
uint8_t genhdr(uint8_t id, enum endpoints endpoint, uint8_t status, enum cmdlen len);
int parseframe(uint8_t b, struct frame_header *hdr);
void writebyte(uint8_t b);
void write(const uint8_t *buf, size_t nbytes);
Expand Down
2 changes: 1 addition & 1 deletion libcommon/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static volatile uint32_t* const can_tx = (volatile uint32_t *)TK1_MMIO_UART_TX_S
static volatile uint32_t* const tx = (volatile uint32_t *)TK1_MMIO_UART_TX_DATA;
// clang-format on

uint8_t genhdr(uint8_t id, uint8_t endpoint, uint8_t status, enum cmdlen len)
uint8_t genhdr(uint8_t id, enum endpoints endpoint, uint8_t status, enum cmdlen len)
{
return (id << 5) | (endpoint << 3) | (status << 2) | len;
}
Expand Down
0