The below line will raise a Constraint_Error if Range_Check is enabled as the enumeration is not continuous, using 'Enum_Val instead would fix this. This error could exist in the other uses of 'Val which I have not checked and it could have potentially worse consequences than this one which will likely be harmless when Range_Check is disabled.
The below line will raise a Constraint_Error if Range_Check is enabled as the enumeration is not continuous, using 'Enum_Val instead would fix this. This error could exist in the other uses of 'Val which I have not checked and it could have potentially worse consequences than this one which will likely be harmless when Range_Check is disabled.
https://github.com/AdaCore/Ada_Drivers_Library/blob/b651d01dcfd7e27836f938c1d494e1ed3212ed43/arch/ARM/STM32/drivers/stm32-adc.adb#L410