Skip to content

Fix frequency function of CAN driver. #3348

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

Merged
merged 1 commit into from
Dec 15, 2016
Merged
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
7 changes: 7 additions & 0 deletions targets/TARGET_RENESAS/TARGET_RZ_A1H/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ void can_free(can_t *obj) {
}

int can_frequency(can_t *obj, int f) {
__IO uint32_t *dmy_cfcc;
int retval = 0;

if (f <= 1000000) {
Expand All @@ -590,6 +591,12 @@ int can_frequency(can_t *obj, int f) {
can_set_frequency(obj, f);
/* set Channel Communication mode */
can_set_channel_mode(obj->ch, CH_COMM);
/* restore CFE bit since it is cleared */
/* Use send/receive FIFO buffer */
dmy_cfcc = CFCC_TBL[obj->ch][CAN_SEND];
*dmy_cfcc |= 0x01;
dmy_cfcc = CFCC_TBL[obj->ch][CAN_RECV];
*dmy_cfcc |= 0x01;
retval = 1;
}

Expand Down
7 changes: 7 additions & 0 deletions targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ void can_free(can_t *obj) {
}

int can_frequency(can_t *obj, int f) {
__IO uint32_t *dmy_cfcc;
int retval = 0;

if (f <= 1000000) {
Expand All @@ -607,6 +608,12 @@ int can_frequency(can_t *obj, int f) {
can_set_frequency(obj, f);
/* set Channel Communication mode */
can_set_channel_mode(obj->ch, CH_COMM);
/* restore CFE bit since it is cleared */
/* Use send/receive FIFO buffer */
dmy_cfcc = CFCC_TBL[obj->ch][CAN_SEND];
*dmy_cfcc |= 0x01;
dmy_cfcc = CFCC_TBL[obj->ch][CAN_RECV];
*dmy_cfcc |= 0x01;
retval = 1;
}

Expand Down