You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jlaitine (via GitHub)" <gi...@apache.org> on 2026/04/23 08:42:27 UTC

[PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

jlaitine opened a new pull request, #18785:
URL: https://github.com/apache/nuttx/pull/18785

   ## Summary
   
   DShot is a packet based serial protocol, used for controlling motor controllers (ESCs), typically for drones.
   
   I needed a dshot motor control for an i.MX93 based custom board, and decided to make a full "traditional"
   upper/lower half nuttx driver for it, for easy integration to the actual application.
   
   I am open to improvement requests for the upper-half / interface; the interface presented here, however, works well for me for flying drone integration.
   
   This PR adds:
   - a new generic drivers/timers/dshot.c upper-half driver
   - an imx93 dshot lower half driver using imx9 flexio module
   - initialization+registering of the dshot imx93-evk:nsh board as /dev/dshot0
   
   The generic upper-half driver supports registering and configuring DShot, as well as common protocol specific fuctionality to build the the 16-bit TX packets and interpret the 20-bit RX packets (in bidirectional mode). The raw packet sending and receiving is left for the lower-half.
   
   For i.MX9, eight channels of DShot per flexio block are supported in:
    
   - Normal mode in all DShot speeds, with telemetry request (uart response needs to be handled outside of this driver)
   - Bidirectional mode in all DShot speeds, with telemetry request & response
   - Configurable to use either independent TX timers for each channel, or to use a common TX timer for all channels to synchronize the output
   - For bidirectional RX, each channel always uses an own RX timer.
   
   In normal mode, the driver operates without any interrupts.
   
   In bidirectional mode, the driver reconfigures the FlexIO timers (as needed)  and shifters from TX to RX in the interrupt handler, and reads out the raw response packet.
   
   ## Impact
   
   No impact to existing boards, new feature. First board supporting DShot directly in NuttX level is the i.MX93
   
   ## Testing
   
   The driver has been tested in both lab environment by scoping the lines and communicating with ESCs, as well as running motors of a quadcopter and a 1-motor fixed wing flying devices.
   
   1. Attaching 2 scope pictures:
   
   First, the "1_ch_bidir_w_debug.png" shows a single channel "bidirectional dshot" capture from a hexacopter + 2 debug lines. "Channel 0" is the line  in digital form. "Channel 1" is a debug channel showing RX clock timing for bidirectional response reading. "Channel 2" is a gpio used to measure initialization and interrupt times taken for the 6 channels per frame. The "Channel 3" is just the line in analog form to monitor any clitches.
   
   Second, the "4_ch_non_bidir.png" shows 4-channel output for a "non-bidirectional dshot", running 4 motors at different speeds.
   
   <img width="1348" height="568" alt="4_ch_non_bidir" src="https://github.com/user-attachments/assets/f5322691-5087-4388-972a-d3204aca403c" />
   <img width="934" height="298" alt="1_ch_bidir_w_debug" src="https://github.com/user-attachments/assets/71785394-6163-40a4-b4bd-05e875c52957" />
   
   2. Tested with flying devices:
   
   There is no "pure nuttx" test bench for the driver, insted, the driver was integrated into a PX4 system via wrappers used by existing code. A few places how it was done:
   https://github.com/tiiuae/px4-firmware/blob/bc0d500b0d6c8aa7550c4679c36b6f1a8497f5cb/platforms/nuttx/src/px4/nxp/imx9/dshot/dshot.c#L91
   https://github.com/tiiuae/px4-firmware/blob/bc0d500b0d6c8aa7550c4679c36b6f1a8497f5cb/platforms/nuttx/src/px4/nxp/imx9/dshot/dshot.c#L148
   
   Note for px4 people if someone is reading this, the PX4 baseline in question is not the latest upstream one, so there are minor differencies in the wrappers.
   
   The integrated driver was tested in flying the devices, and also checking the telemetry data in px4 debug terminal (example below, the escs in question only provide RPM output).
   
   The actual ESC HW used for testing are older BLheli32 type ESCs and T-motor F55A 4-in-1 ESCs (AM32 firmware).
   
   ```
   nsh> listener esc_status
   
   TOPIC: esc_status
    esc_status
       timestamp: 6067858470 (0.000719 seconds ago)
       counter: 2074
       esc_count: 4
       esc_connectiontype: 5
       esc_online_flags: 15 (0b1111)
       esc_armed_flags: 15 (0b1111)
   
     esc[0] (esc_report):
       timestamp: 6067857069 (0.003602 seconds ago)
       esc_errorcount: 0
       esc_rpm: 128
       esc_voltage: 0.00000
       esc_current: 0.00000
       esc_temperature: 0.00000
       failures: 0
       esc_address: 0
       esc_cmdcount: 0
       esc_state: 0
       actuator_function: 101
       esc_power: 0
   
     esc[1] (esc_report):
       timestamp: 6067857069 (0.028694 seconds ago)
       esc_errorcount: 0
       esc_rpm: 128
       esc_voltage: 0.00000
       esc_current: 0.00000
       esc_temperature: 0.00000
       failures: 0
       esc_address: 0
       esc_cmdcount: 0
       esc_state: 0
       actuator_function: 102
       esc_power: 0
   
     esc[2] (esc_report):
       timestamp: 6067857069 (0.056597 seconds ago)
       esc_errorcount: 0
       esc_rpm: 128
       esc_voltage: 0.00000
       esc_current: 0.00000
       esc_temperature: 0.00000
       failures: 0
       esc_address: 0
       esc_cmdcount: 0
       esc_state: 0
       actuator_function: 103
       esc_power: 0
   
     esc[3] (esc_report):
       timestamp: 6067857069 (0.084419 seconds ago)
       esc_errorcount: 0
       esc_rpm: 128
       esc_voltage: 0.00000
       esc_current: 0.00000
       esc_temperature: 0.00000
       failures: 0
       esc_address: 0
       esc_cmdcount: 0
       esc_state: 0
       actuator_function: 104
       esc_power: 0
   ```
   
   
   
   
   
   


-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "jlaitine (via GitHub)" <gi...@apache.org>.
jlaitine commented on PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#issuecomment-4311050917

   Upper-half code comments updated to follow proper style, documentation added.


-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "jlaitine (via GitHub)" <gi...@apache.org>.
jlaitine commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3151776208


##########
drivers/timers/Kconfig:
##########
@@ -92,6 +92,24 @@ config CAPTURE
 		This selection enables building of the "upper-half" Capture driver.
 		See include/nuttx/timers/capture.h for further Capture driver information.
 
+config DSHOT

Review Comment:
   Thanks, I made a bad rebase. Done!



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #18785:
URL: https://github.com/apache/nuttx/pull/18785


-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "jlaitine (via GitHub)" <gi...@apache.org>.
jlaitine commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3151784605


##########
include/nuttx/timers/dshot.h:
##########
@@ -0,0 +1,312 @@
+/****************************************************************************
+ * include/nuttx/timers/dshot.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_TIMERS_DSHOT_H
+#define __INCLUDE_NUTTX_TIMERS_DSHOT_H
+
+/* Common definitions for DShot drivers */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+#include <nuttx/fs/ioctl.h>
+
+#include <time.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_DSHOT_NCHANNELS
+#  if CONFIG_DSHOT_NCHANNELS > 16
+#    error "max 16 channels supported"
+#  endif
+#  define _DSHOT_NCHANNELS CONFIG_DSHOT_NCHANNELS

Review Comment:
   It was just nice that I can include the dshot.h in some common board files, and still being able to compile even if every board didn't define it. It was also shorter to use



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3130847376


##########
drivers/timers/dshot.c:
##########
@@ -0,0 +1,461 @@
+/****************************************************************************
+ * drivers/timers/dshot.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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 <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/fs/fs.h>
+#include <nuttx/kmalloc.h>
+#include <nuttx/mutex.h>
+#include <nuttx/timers/dshot.h>
+
+#ifdef CONFIG_DSHOT
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define DSHOT_GCR_MASK       0x000fffffu
+#define DSHOT_ERPMSCALE_NUM  600000u
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct dshot_upperhalf_s
+{
+  uint8_t crefs;
+  mutex_t lock;
+  FAR struct dshot_lowerhalf_s *dev;
+  struct dshot_ch_telemetry_s telemetry[_DSHOT_NCHANNELS];
+  bool bidir;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static int dshot_open(FAR struct file *filep);
+static int dshot_close(FAR struct file *filep);
+static ssize_t dshot_read(FAR struct file *filep, FAR char *buffer,
+                          size_t buflen);
+static ssize_t dshot_write(FAR struct file *filep, FAR const char *buffer,
+                           size_t buflen);
+static int dshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct file_operations g_dshotops =
+{
+  dshot_open,  /* open */
+  dshot_close, /* close */
+  dshot_read,  /* read */
+  dshot_write, /* write */
+  NULL,        /* seek */
+  dshot_ioctl, /* ioctl */
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static uint16_t dshot_crc(uint16_t packet, bool bidir)
+{
+  uint16_t crc;
+
+  crc = packet >> 4;
+  crc = crc ^ (crc >> 4) ^ (crc >> 8);
+
+  if (bidir)
+    {
+      crc = ~crc;
+    }
+
+  return crc & 0xf;
+}
+
+static uint16_t dshot_build_packet(uint16_t throttle, bool telemetry,
+                                   bool bidir)
+{
+  uint16_t packet = 0;
+  packet |= throttle << 5;
+  packet |= (telemetry ? 1 << 4 : 0);
+  packet |= dshot_crc(packet, bidir);
+
+  return packet;
+}
+
+/* Parse raw pattern from the line into a 16-bit packet, and verify crc:
+ * 1. extract gcr20 value from the raw value
+ * 2. extract the 16-bit packet from the gcr20
+ * 3. check the packet crc
+ *
+ * In case of error, return negative error code.
+ * Otherwise return the 12-bit payload as a positive integer.
+ */

Review Comment:
   Please use the right Description format with its parameters and return type



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "jlaitine (via GitHub)" <gi...@apache.org>.
jlaitine commented on PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#issuecomment-4311613660

   Still fixed a few misplaced comments in the imx9 lower-half driver


-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "jlaitine (via GitHub)" <gi...@apache.org>.
jlaitine commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3151786013


##########
include/nuttx/timers/dshot.h:
##########
@@ -0,0 +1,312 @@
+/****************************************************************************
+ * include/nuttx/timers/dshot.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_TIMERS_DSHOT_H
+#define __INCLUDE_NUTTX_TIMERS_DSHOT_H
+
+/* Common definitions for DShot drivers */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+#include <nuttx/fs/ioctl.h>
+
+#include <time.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_DSHOT_NCHANNELS
+#  if CONFIG_DSHOT_NCHANNELS > 16
+#    error "max 16 channels supported"
+#  endif
+#  define _DSHOT_NCHANNELS CONFIG_DSHOT_NCHANNELS
+#else
+#  define _DSHOT_NCHANNELS 1

Review Comment:
   Done!



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "jlaitine (via GitHub)" <gi...@apache.org>.
jlaitine commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3129911272


##########
arch/arm64/src/imx9/Make.defs:
##########
@@ -56,6 +56,10 @@ ifeq ($(CONFIG_IMX9_FLEXIO_PWM),y)
   CHIP_CSRCS += imx9_flexio_pwm.c
 endif
 
+ifeq ($(CONFIG_IMX9_FLEXIO_DSHOT),y)
+  CHIP_CSRCS += imx9_flexio_dshot.c
+endif

Review Comment:
   Good catch, thanks, done !



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3144563700


##########
drivers/timers/Kconfig:
##########
@@ -92,6 +92,24 @@ config CAPTURE
 		This selection enables building of the "upper-half" Capture driver.
 		See include/nuttx/timers/capture.h for further Capture driver information.
 
+config DSHOT

Review Comment:
   move after line 132



##########
include/nuttx/timers/dshot.h:
##########
@@ -0,0 +1,312 @@
+/****************************************************************************
+ * include/nuttx/timers/dshot.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_TIMERS_DSHOT_H
+#define __INCLUDE_NUTTX_TIMERS_DSHOT_H
+
+/* Common definitions for DShot drivers */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+#include <nuttx/fs/ioctl.h>
+
+#include <time.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_DSHOT_NCHANNELS
+#  if CONFIG_DSHOT_NCHANNELS > 16
+#    error "max 16 channels supported"
+#  endif
+#  define _DSHOT_NCHANNELS CONFIG_DSHOT_NCHANNELS

Review Comment:
   why not use CONFIG_DSHOT_NCHANNELS directly



##########
include/nuttx/timers/dshot.h:
##########
@@ -0,0 +1,312 @@
+/****************************************************************************
+ * include/nuttx/timers/dshot.h
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_TIMERS_DSHOT_H
+#define __INCLUDE_NUTTX_TIMERS_DSHOT_H
+
+/* Common definitions for DShot drivers */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+#include <nuttx/fs/ioctl.h>
+
+#include <time.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_DSHOT_NCHANNELS
+#  if CONFIG_DSHOT_NCHANNELS > 16
+#    error "max 16 channels supported"
+#  endif
+#  define _DSHOT_NCHANNELS CONFIG_DSHOT_NCHANNELS
+#else
+#  define _DSHOT_NCHANNELS 1

Review Comment:
   remove the first _



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3161785635


##########
drivers/timers/dshot.c:
##########
@@ -0,0 +1,638 @@
+/****************************************************************************
+ * drivers/timers/dshot.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * 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 <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/fs/fs.h>
+#include <nuttx/kmalloc.h>
+#include <nuttx/mutex.h>
+#include <nuttx/timers/dshot.h>
+
+#ifdef CONFIG_DSHOT

Review Comment:
   don't need, delete



-- 
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


Re: [PR] Introduce dshot ESC protocol upperhalf and imx9 lowerhalf [nuttx]

Posted by "simbit18 (via GitHub)" <gi...@apache.org>.
simbit18 commented on code in PR #18785:
URL: https://github.com/apache/nuttx/pull/18785#discussion_r3129814962


##########
arch/arm64/src/imx9/Make.defs:
##########
@@ -56,6 +56,10 @@ ifeq ($(CONFIG_IMX9_FLEXIO_PWM),y)
   CHIP_CSRCS += imx9_flexio_pwm.c
 endif
 
+ifeq ($(CONFIG_IMX9_FLEXIO_DSHOT),y)
+  CHIP_CSRCS += imx9_flexio_dshot.c
+endif

Review Comment:
   Hi @jlaitine, please align CMake with the Makefile 
   
   if(CONFIG_IMX9_FLEXIO_DSHOT)
     list(APPEND SRCS imx9_flexio_dshot.c)
   endif()
   
   https://github.com/tiiuae/nuttx/blob/864e096b573588f75779425f9e0fb3bd6e54afc0/arch/arm64/src/imx9/CMakeLists.txt#L47



-- 
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