Fix for AFROMINI failing build in Travis CI

This commit is contained in:
Bas Delfos 2016-11-10 23:54:23 +01:00
parent 9fe84c0ff2
commit 2e925de36f
2 changed files with 8 additions and 2 deletions

View File

@ -52,8 +52,10 @@ typedef enum {
#define PWM_BRUSHED_TIMER_MHZ 24 #define PWM_BRUSHED_TIMER_MHZ 24
#endif #endif
#ifdef USE_DSHOT #if defined(USE_DSHOT)
#define MAX_DSHOT_MOTORS 4 #define MAX_DSHOT_MOTORS 4
#else
#define MAX_DSHOT_MOTORS 0
#endif #endif
#define MOTOR_DMA_BUFFER_SIZE 18 /* resolution + frame reset (2us) */ #define MOTOR_DMA_BUFFER_SIZE 18 /* resolution + frame reset (2us) */

View File

@ -56,6 +56,8 @@ set debug_mode = DEBUG_ESC_TELEMETRY in cli
3: current 3: current
*/ */
#ifdef USE_DSHOT
typedef struct { typedef struct {
bool skipped; bool skipped;
int16_t temperature; int16_t temperature;
@ -269,7 +271,7 @@ void escTelemetryProcess(uint32_t currentTime)
static void selectNextMotor(void) static void selectNextMotor(void)
{ {
escTelemetryMotor++; escTelemetryMotor++;
if (escTelemetryMotor >= MAX_DSHOT_MOTORS) { // Motor count for Dshot limited to 4 if (escTelemetryMotor > MAX_DSHOT_MOTORS-1) { // Motor count for Dshot limited to 4
escTelemetryMotor = 0; escTelemetryMotor = 0;
firstCycleComplete = true; firstCycleComplete = true;
} }
@ -294,3 +296,5 @@ static uint8_t get_crc8(uint8_t *Buf, uint8_t BufLen)
for(int i=0; i<BufLen; i++) crc = update_crc8(Buf[i], crc); for(int i=0; i<BufLen; i++) crc = update_crc8(Buf[i], crc);
return (crc); return (crc);
} }
#endif