Compare commits
6 commits
master
...
dedouble-d
Author | SHA1 | Date | |
---|---|---|---|
77f2ae63d5 | |||
7e1fb81228 | |||
17bbf7d442 | |||
ba9f272f1c | |||
f53c9abd6e | |||
813d756ee8 |
6 changed files with 17 additions and 8 deletions
7
Makefile
7
Makefile
|
@ -557,6 +557,11 @@ endif
|
||||||
|
|
||||||
DEBUG_FLAGS = -ggdb3
|
DEBUG_FLAGS = -ggdb3
|
||||||
|
|
||||||
|
REMAP_FLAGS = -Wl,--defsym=sqrtf=__ieee754_sqrtf -Wl,-u,__ieee754_sqrtf \
|
||||||
|
-Wl,--defsym=powf=__ieee754_powf -Wl,-u,__ieee754_powf \
|
||||||
|
-Wl,--defsym=atan2f=__ieee754_atan2f -Wl,-u,__ieee754_atan2f \
|
||||||
|
-Wl,--defsym=acosf=__ieee754_acosf -Wl,-u,__ieee754_acosf
|
||||||
|
|
||||||
CFLAGS = $(ARCH_FLAGS) \
|
CFLAGS = $(ARCH_FLAGS) \
|
||||||
$(LTO_FLAGS) \
|
$(LTO_FLAGS) \
|
||||||
$(addprefix -D,$(OPTIONS)) \
|
$(addprefix -D,$(OPTIONS)) \
|
||||||
|
@ -566,6 +571,7 @@ CFLAGS = $(ARCH_FLAGS) \
|
||||||
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
|
-Wall -Wextra -Wunsafe-loop-optimizations -Wdouble-promotion \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
|
-ffast-math \
|
||||||
$(DEVICE_FLAGS) \
|
$(DEVICE_FLAGS) \
|
||||||
-DUSE_STDPERIPH_DRIVER \
|
-DUSE_STDPERIPH_DRIVER \
|
||||||
$(TARGET_FLAGS) \
|
$(TARGET_FLAGS) \
|
||||||
|
@ -590,6 +596,7 @@ LDFLAGS = -lm \
|
||||||
$(DEBUG_FLAGS) \
|
$(DEBUG_FLAGS) \
|
||||||
-static \
|
-static \
|
||||||
-Wl,-gc-sections,-Map,$(TARGET_MAP) \
|
-Wl,-gc-sections,-Map,$(TARGET_MAP) \
|
||||||
|
$(REMAP_FLAGS) \
|
||||||
-T$(LD_SCRIPT)
|
-T$(LD_SCRIPT)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -184,10 +184,10 @@ static void autotuneLogAngleTargets(float currentAngle)
|
||||||
eventData.targetAngleAtPeak = (int) targetAngleAtPeak;
|
eventData.targetAngleAtPeak = (int) targetAngleAtPeak;
|
||||||
|
|
||||||
// currentAngle is integer decidegrees divided by 10, so just reverse that process to get an integer again:
|
// currentAngle is integer decidegrees divided by 10, so just reverse that process to get an integer again:
|
||||||
eventData.currentAngle = round(currentAngle * 10);
|
eventData.currentAngle = roundf(currentAngle * 10);
|
||||||
// the peak angles are only ever set to currentAngle, so they get the same treatment:
|
// the peak angles are only ever set to currentAngle, so they get the same treatment:
|
||||||
eventData.firstPeakAngle = round(firstPeakAngle * 10);
|
eventData.firstPeakAngle = roundf(firstPeakAngle * 10);
|
||||||
eventData.secondPeakAngle = round(secondPeakAngle * 10);
|
eventData.secondPeakAngle = roundf(secondPeakAngle * 10);
|
||||||
|
|
||||||
blackboxLogEvent(FLIGHT_LOG_EVENT_AUTOTUNE_TARGETS, (flightLogEventData_t*)&eventData);
|
blackboxLogEvent(FLIGHT_LOG_EVENT_AUTOTUNE_TARGETS, (flightLogEventData_t*)&eventData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1293,13 +1293,14 @@ static void cliMotor(char *cmdline)
|
||||||
int motor_value = 0;
|
int motor_value = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
char *pch = NULL;
|
char *pch = NULL;
|
||||||
|
char *saveptr;
|
||||||
|
|
||||||
if (isEmpty(cmdline)) {
|
if (isEmpty(cmdline)) {
|
||||||
cliPrint("Usage:\r\nmotor index [value] - show [or set] motor value\r\n");
|
cliPrint("Usage:\r\nmotor index [value] - show [or set] motor value\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pch = strtok(cmdline, " ");
|
pch = strtok_r(cmdline, " ", &saveptr);
|
||||||
while (pch != NULL) {
|
while (pch != NULL) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -1310,7 +1311,7 @@ static void cliMotor(char *cmdline)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
pch = strtok(NULL, " ");
|
pch = strtok_r(NULL, " ", &saveptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (motor_index < 0 || motor_index >= MAX_SUPPORTED_MOTORS) {
|
if (motor_index < 0 || motor_index >= MAX_SUPPORTED_MOTORS) {
|
||||||
|
|
|
@ -114,7 +114,7 @@ uint8_t sumhFrameStatus(void)
|
||||||
for (channelIndex = 0; channelIndex < SUMH_MAX_CHANNEL_COUNT; channelIndex++) {
|
for (channelIndex = 0; channelIndex < SUMH_MAX_CHANNEL_COUNT; channelIndex++) {
|
||||||
|
|
||||||
sumhChannels[channelIndex] = (((uint32_t)(sumhFrame[(channelIndex << 1) + 3]) << 8)
|
sumhChannels[channelIndex] = (((uint32_t)(sumhFrame[(channelIndex << 1) + 3]) << 8)
|
||||||
+ sumhFrame[(channelIndex << 1) + 4]) / 6.4 - 375;
|
+ sumhFrame[(channelIndex << 1) + 4]) / 6.4f - 375;
|
||||||
}
|
}
|
||||||
return SERIAL_RX_FRAME_COMPLETE;
|
return SERIAL_RX_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,7 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
|
||||||
}
|
}
|
||||||
|
|
||||||
mAhdrawnRaw += (amperage * lastUpdateAt) / 1000;
|
mAhdrawnRaw += (amperage * lastUpdateAt) / 1000;
|
||||||
|
/* TODO(mlhx): causes divdi3 to be linked in. */
|
||||||
mAhDrawn = mAhdrawnRaw / (3600 * 100);
|
mAhDrawn = mAhdrawnRaw / (3600 * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,5 +155,5 @@ uint8_t calculateBatteryCapacityRemainingPercentage(void)
|
||||||
{
|
{
|
||||||
uint16_t batteryCapacity = batteryConfig->batteryCapacity;
|
uint16_t batteryCapacity = batteryConfig->batteryCapacity;
|
||||||
|
|
||||||
return constrain((batteryCapacity - constrain(mAhDrawn, 0, 0xFFFF)) * 100.0 / batteryCapacity , 0, 100);
|
return constrain((batteryCapacity - constrain(mAhDrawn, 0, 0xFFFF)) * 100.0f / batteryCapacity , 0, 100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ static void sendSatalliteSignalQualityAsTemperature2(void)
|
||||||
if (telemetryConfig->frsky_unit == FRSKY_UNIT_METRICS) {
|
if (telemetryConfig->frsky_unit == FRSKY_UNIT_METRICS) {
|
||||||
serialize16(satellite);
|
serialize16(satellite);
|
||||||
} else {
|
} else {
|
||||||
float tmp = (satellite - 32) / 1.8;
|
float tmp = (satellite - 32) / 1.8f;
|
||||||
//Round the value
|
//Round the value
|
||||||
tmp += (tmp < 0) ? -0.5f : 0.5f;
|
tmp += (tmp < 0) ? -0.5f : 0.5f;
|
||||||
serialize16(tmp);
|
serialize16(tmp);
|
||||||
|
|
Loading…
Reference in a new issue