You can select all lines in the code cell with Ctrl+A (Windows/Linux) or Cmd+A (Mac) Then press Ctrl+/ (Windows/Linux) or Cmd+/ (Mac) to uncomment; Press / again to comment. When debugging or experimenting with code, it can be useful to comment blocks of code either temporarily or long term. To comment out an entire block of code: Select the code and select Toggle Line Comment(s) from the context menu; OR. Use the cmd + / keybinding on the selected code. These methods can be used to comment and uncomment sections of code. Type /. to start a block comment, then hit the Enter key, and the extension will close the block. While inside the comment block, the extension will insert an asterisk at the start of every new line, and align the comment, respecting indentation. QDoc-style (Qt) comment blocks. In C/C files to start a QDoc comment block. I was recently experimenting with VSCode and Platform before I discovered this v2 IDE. It was there that I found the block comment key-combination. My unruly complex project works fine under both versions of the Arduino IDE but I was having problems getting the code to compile under VSCode so I think I’ll stay here. When you press a shortcut for block comment, your caret is set in the position where you can start typing: /. caret./ Just hit Enter, and you'll get a new line inside the comment where you can start typing Clemens W. Dmitry Matveev. a year ago Thanks for your reply.
- General
- Tutorials
- Interfaces & Protocols
- API Reference
- ODrive
- Can
- •Config
- •Error
- •Protocol
- •Endpoint
- Axis
- •LockinConfig
- Config
- •CalibrationLockin
- •Error
- •LockinState
- •AxisState
- •ThermistorCurrentLimiter
- OnboardThermistorCurrentLimiter
- •Config
- OffboardThermistorCurrentLimiter
- •Config
- Motor
- •CurrentControl
- •GateDriver
- •TimingLog
- Virtualbox mojave on mac. •Config
- •Error
- •ArmedState
- •MotorType
- Controller
- Config
- •Anticogging
- •Error
- •ControlMode
- •InputMode
- Encoder
- •Config
- •Error
- •Mode
- SensorlessEstimator
- •Config
- •Error
- TrapezoidalTrajectory
- •Config
- Endstop
- •Config
- SystemStats
- •Usb
- •I2C
- •Config
- For ODrive Developers
- Component Guides
Help improve these docs: submit edits using the link in the top right.
Ibm slack deal. If you need help, please search or ask the ODrive Community.
VSCode is the recommended IDE for working with the ODrive codebase. It is a light-weight text editor with Git integration and GDB debugging functionality.
Before doing the VSCode setup, make sure you’ve installed all of your prerequisites
Vscode Comment Html
Setup Procedure
- Clone the ODrive repository
- Open VSCode
- Install extensions. This can be done directly from VSCode (Ctrl+Shift+X)
- Required extensions:
- C/C++
ext install ms-vscode.cpptools
- Cortex-Debug
ext install marus25.cortex-debug
- Cortex-Debug: Device Support Pack - STM32F4
ext install marus25.cortex-debug-dp-stm32f4
- C/C++
- Recommended Extensions:
- Include Autocomplete
- Path Autocomplete
- Auto Comment Blocks
- Required extensions:
- Create an environment variable named
ARM_GCC_ROOT
whose value is the location of theGNU Arm Embedded Toolchain
(.e.gC:Program Files (x86)GNU Tools Arm Embedded7 2018-q2-update
) that you installed in the prerequisites section of the developer’s guide. This is not strictly needed for Linux or Mac, and you can alternatively use theCortex-debug: Arm Toolchain Path
setting in VSCode extension settings. - Relaunch VSCode
- Open the VSCode Workspace file, which is located in the root of the ODrive repository. It is called
ODrive_Workspace.code-workspace
. The first time you open it, VSCode will install some dependencies. If it fails, you may need to change your proxy settings.
You should now be ready to compile and test the ODrive project.
Building the Firmware
- Terminal -> Run Build Task (Ctrl+Shift+B)
A terminal window will open with your native shell. VSCode is configured to run the command
make -j4
in this terminal.Flashing the Firmware
- Terminal -> Run Task -> flash
A terminal window will open with your native shell. VSCode is configured to run the command
make flash
in this terminal.If the flashing worked, you can connect to the board using the odrivetool.
Debugging
An extension called Cortex-Debug has recently been released which is designed specifically for debugging ARM Cortex projects. You can read more on Cortex-Debug here: https://github.com/Marus/cortex-debug
Note: If developing on Windows, you should have
arm-none-eabi-gdb
and openOCD
on your PATH.- Make sure you have the Firmware folder as your active folder
- Set
CONFIG_DEBUG=true
in the tup.config file - Flash the board with the newest code (starting debug session doesn’t do this)
- In the Run tab (Ctrl+Shift+D), select “Debug ODrive (Firmware)”
- Press Start Debugging (or press F5)
- The processor will reset and halt.
- Set your breakpoints. Note: you can only set breakpoints when the processor is halted, if you set them during run mode, they won’t get applied.
- Continue (F5)
- Stepping over/in/out, restarting, and changing breakpoints can be done by first pressing the “pause” (F6) button at the top the screen.
- When done debugging, simply stop (Shift+F5) the debugger. It will kill your openOCD process too.
Vscode Comment Block Mac Version
Cleaning the Build
Vscode Comment Shortcut
This sometimes needs to be done if you change branches.
Download Vscode Mac
- Open a terminal (View -> Integrated Terminal) and enter
make clean