mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-10 22:28:55 +08:00
Follow-up fixes
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
#include <uavcan/data_type.hpp>
|
||||
#include <uavcan/global_data_type_registry.hpp>
|
||||
#include <uavcan/internal/util.hpp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||
#
|
||||
|
||||
import os, re, logging, math
|
||||
import os, re, logging
|
||||
from io import StringIO
|
||||
from .signature import compute_signature
|
||||
from .common import DsdlException, pretty_filename
|
||||
@@ -60,10 +60,9 @@ class PrimitiveType(Type):
|
||||
return cast_mode + ' ' + primary_type
|
||||
|
||||
def validate_value_range(self, value):
|
||||
if math.isfinite(value):
|
||||
low, high = self.value_range
|
||||
if not low <= value <= high:
|
||||
error('Value [%s] is out of range %s', value, self.value_range)
|
||||
low, high = self.value_range
|
||||
if not low <= value <= high:
|
||||
error('Value [%s] is out of range %s', value, self.value_range)
|
||||
|
||||
def get_max_bitlen(self):
|
||||
return self.bitlen
|
||||
|
||||
Reference in New Issue
Block a user