You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/05/05 15:52:09 UTC

[GitHub] [incubator-nuttx] JacobCrabill commented on a diff in pull request #6057: arch/stm32h7: Add SocketCAN FDCAN driver

JacobCrabill commented on code in PR #6057:
URL: https://github.com/apache/incubator-nuttx/pull/6057#discussion_r866064551


##########
arch/arm/src/stm32h7/stm32_fdcan_sock.c:
##########
@@ -0,0 +1,2522 @@
+/****************************************************************************
+ * arch/arm/src/stm32h7/stm32_fdcan_sock.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <nuttx/can.h>
+#include <nuttx/wdog.h>
+#include <nuttx/irq.h>
+#include <nuttx/arch.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/signal.h>
+#include <nuttx/net/netdev.h>
+#include <nuttx/net/can.h>
+#include <netpacket/can.h>
+
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+#include <sys/time.h>
+#endif
+
+#include <arch/board/board.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+#include "stm32.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* General Configuration ****************************************************/
+
+#if !defined(CONFIG_SCHED_WORKQUEUE)
+#  error Work queue support is required; HPWORK is recommended
+#endif
+
+#ifdef CONFIG_NET_CAN_RAW_TX_DEADLINE
+#  define TX_TIMEOUT_WQ
+#endif
+
+/* If processing is not done at the interrupt level, then work queue support
+ * is required.
+ *
+ * The high-priority work queue is suggested in order to minimize latency of
+ * critical Rx/Tx transactions on the CAN bus.
+ */
+
+#define CANWORK HPWORK

Review Comment:
   Good point.  Implemented.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org