Advertisement
imrj

msrc - config.h

Sep 22nd, 2021
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.66 KB | None | 0 0
  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3.  
  4. #include "constants.h"
  5.  
  6. /* Receiver protocol */
  7. #define RX_PROTOCOL RX_SMARTPORT // RX_SMARTPORT, RX_XBUS, RX_SRXL, RX_FRSKY, RX_IBUS, RX_SBUS, RX_MULTIPLEX
  8.  
  9. /* Sensors */
  10. #define CONFIG_ESC_PROTOCOL PROTOCOL_HW_V5_HV // PROTOCOL_NONE, PROTOCOL_HW_V3, PROTOCOL_HW_V4_LV, PROTOCOL_HW_V4_HV, PROTOCOL_HW_V5_LV, PROTOCOL_HW_V5_HV, PROTOCOL_PWM, PROTOCOL_CASTLE, PROTOCOL_KONTRONIK
  11. #define CONFIG_GPS false
  12. #define GPS_BAUD_RATE 9600
  13. #define CONFIG_VOLTAGE1 true
  14. #define CONFIG_VOLTAGE2 false
  15. #define CONFIG_NTC1 true
  16. #define CONFIG_NTC2 false
  17. #define CONFIG_CURRENT true
  18. #define CONFIG_AIRSPEED false
  19. #define CONFIG_I2C1_TYPE I2C_NONE // I2C_NONE, I2C_BMP280
  20. #define CONFIG_I2C1_ADDRESS 0
  21. /* Refresh rate in 0.1s (1 = 100ms) */
  22. #define CONFIG_REFRESH_RPM 1
  23. #define CONFIG_REFRESH_VOLT 1
  24. #define CONFIG_REFRESH_CURR 1
  25. #define CONFIG_REFRESH_TEMP 1
  26. #define CONFIG_REFRESH_DEF 1
  27. /* Averaging elements */
  28. #define CONFIG_AVERAGING_ELEMENTS_RPM 3
  29. #define CONFIG_AVERAGING_ELEMENTS_VOLT 3
  30. #define CONFIG_AVERAGING_ELEMENTS_CURR 3
  31. #define CONFIG_AVERAGING_ELEMENTS_TEMP 3
  32. #define CONFIG_AVERAGING_ELEMENTS_DEF 3
  33.  
  34. /* Pwm out */
  35. #define CONFIG_PWMOUT false
  36. #define PWMOUT_DUTY 0.5 // 0.5 = 50%
  37.  
  38. /* Only smartport and opentx */
  39. #define SENSOR_ID 10 // Sensor Id
  40. #define DATA_ID 0x5000 // DataId (sensor type)
  41. //#define ESC_SIGNATURE // HW V4 signature (only smartport). This outputs esc signature and raw current to sensors 5100, 5101 and 5102
  42. //#define CONFIG_LUA // Comment if not using lua script for configuration (only smartport)
  43.  
  44. /* Use library I2C_T3 for Teensy LC/3.X */
  45. #define I2C_T3_TEENSY
  46.  
  47. /* Add init delay for FlyFun ESC. Uncomment if the ESC doesn't arm */
  48. //#define ESC_INIT_DELAY 10000
  49.  
  50. /* Force eeprom write */
  51. //#define FORCE_EEPROM_WRITE // Uncomment to force write eeprom as defined in config.h. Useful when using lua and eeprom is messed up. Reflash againg with line commented or config will be reset at power up
  52.  
  53. /* Debug
  54.    Disconnect Vcc from the RC model to the Arduino
  55.    Do not connect at the same time Vcc from the model and usb (TTL)
  56.    Telemetry may not work properly in debug mode
  57.    Connect arduino Rx to TTL Tx for flashing, then if applicabe connect arduino Rx to esc or gps
  58. */
  59.  
  60. #define DEBUG_SERIAL Serial
  61.  
  62. #define DEBUG
  63. //#define DEBUG_P
  64. #define DEBUG_ESC
  65. #define DEBUG_ESC_RX
  66. //#define DEBUG_EEPROM_WRITE
  67. //#define DEBUG_EEPROM_READ
  68. //#define DEBUG_GPS
  69.  
  70. //#define DEBUG_ESC_HW_V3
  71. #define DEBUG_ESC_HW_V4
  72. //#define DEBUG_ESC_PWM
  73. //#define DEBUG_ESC_CASTLE
  74. //#define DEBUG_ESC_KONTRONIK
  75.  
  76. //#define SIM_RX
  77. //#define SIM_SENSORS
  78. //#define SIM_LUA_SEND
  79. //#define SIM_LUA_RECEIVE
  80.  
  81. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement