fixed undefined behaviour when left shifting a negative number

This commit is contained in:
Tom Mittendorf 2022-09-16 16:02:05 +02:00 committed by DRracer
parent a08984d94e
commit 24b638b5d4
1 changed files with 1 additions and 1 deletions

View File

@ -584,7 +584,7 @@ void dcode_9()
if (code_seen('V')) // value to be written as simulated
{
adc_sim_mask |= (1 << index);
adc_values[index] = (((int)code_value()) << 4);
adc_values[index] = ((uint16_t)code_value_short() << 4);
printf_P(PSTR("ADC%d=%4d\n"), index, adc_values[index] >> 4);
}
}