Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Petro Karashchenko <[email protected]>
  • Loading branch information
PetervdPerk-NXP and pkarashchenko authored Mar 20, 2023
1 parent a51626b commit 23b1bf3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion canutils/libdronecan/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
ifneq ($(CONFIG_CANUTILS_LIBDRONECAN),)
CONFIGURED_APPS += $(APPDIR)/canutils/libdronecan


ifeq ($(CONFIG_NET_CAN),y)
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/canutils/libdronecan/libcanard/drivers/socketcan
CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/canutils/libdronecan/libcanard/drivers/socketcan
Expand Down
1 change: 0 additions & 1 deletion canutils/libopencyphal/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
ifneq ($(CONFIG_CANUTILS_LIBOPENCYPHAL),)
CONFIGURED_APPS += $(APPDIR)/canutils/libopencyphal


CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/canutils/libopencyphal/o1heap/o1heap
CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/canutils/libopencyphal/o1heap/o1heap

Expand Down
13 changes: 7 additions & 6 deletions examples/dronecan/canard_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static uint8_t node_mode = UAVCAN_NODE_MODE_INITIALIZATION;
static bool g_canard_daemon_started;

#if CANARD_ENABLE_CANFD
static bool canfd = false;
static bool canfd;
#endif

/****************************************************************************
Expand Down Expand Up @@ -250,7 +250,7 @@ static void onTransferReceived(CanardInstance *ins,
transfer->priority,
CanardResponse,
&buffer[0],
(uint16_t) total_size, canfd);
(uint16_t)total_size, canfd);
#else
canardRequestOrRespond(ins,
transfer->source_node_id,
Expand Down Expand Up @@ -415,9 +415,9 @@ void process1HzTasks(uint64_t timestamp_usec)
*
****************************************************************************/
#ifdef CONFIG_NET_CAN
void processTxRxOnce(SocketCANInstance * socketcan, int timeout_msec)
void processTxRxOnce(SocketCANInstance *socketcan, int timeout_msec)
#else
void processTxRxOnce(CanardNuttXInstance * nuttxcan, int timeout_msec)
void processTxRxOnce(CanardNuttXInstance *nuttxcan, int timeout_msec)
#endif
{
const CanardCANFrame *txf;
Expand Down Expand Up @@ -501,7 +501,7 @@ static int canard_daemon(int argc, char *argv[])


#ifdef CONFIG_NET_CAN
const char *const can_iface_name = "can0";
const char * const can_iface_name = "can0";

# if CANARD_ENABLE_CANFD
int16_t res = socketcanInit(&socketcan, can_iface_name, canfd);
Expand Down Expand Up @@ -604,7 +604,8 @@ int main(int argc, FAR char *argv[])
return EXIT_SUCCESS;
}

if (argc == 2 && strcmp(argv[1],"canfd") == 0) {
if (argc == 2 && strcmp(argv[1], "canfd") == 0)
{
printf("CAN FD mode enabled\n");
canfd = true;
}
Expand Down

0 comments on commit 23b1bf3

Please sign in to comment.