Skip to content

Commit

Permalink
Update examples to run with version 0.9
Browse files Browse the repository at this point in the history
Relates to [MACCAN-26]
  • Loading branch information
mac-can committed Jan 8, 2022
1 parent 3059f7f commit eca35cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Examples/c++/src/pcbusb_recv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main(int argc, char *argv[])
return errno;
}
status = CAN_Initialize(PCAN_CHANNEL, PCAN_BAUDRATE, 0, 0, 0);
printf("Initialize CAN: 0x%lx\n", status);
printf("Initialize CAN: 0x%x\n", status);
if(status != PCAN_ERROR_OK) goto leave;

status = CAN_GetValue(PCAN_CHANNEL, PCAN_RECEIVE_EVENT, &fd, sizeof(int));
Expand All @@ -51,7 +51,7 @@ int main(int argc, char *argv[])
while(select(fd+1, &fds, NULL, NULL, NULL) > 0) {
status = CAN_Read(PCAN_CHANNEL, &message, NULL);
if (status != PCAN_ERROR_OK) {
printf("Error 0x%lx\n", status);
printf("Error 0x%x\n", status);
break;
}
printf(" - R ID:%4x LEN:%1x DATA:%02x %02x %02x %02x %02x %02x %02x %02x\n",
Expand Down
2 changes: 1 addition & 1 deletion Examples/c++/src/pcbusb_send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char *argv[])
unsigned long n = 0;

status = CAN_Initialize(PCAN_CHANNEL, PCAN_BAUDRATE, 0, 0, 0);
printf("Initialize CAN: 0x%lx\n", status);
printf("Initialize CAN: 0x%x\n", status);
if(status != PCAN_ERROR_OK) goto leave;

message.ID = 0x100;
Expand Down

0 comments on commit eca35cc

Please sign in to comment.