Fixes
This commit is contained in:
parent
54ab547d5d
commit
64cdf9ccfb
@ -123,7 +123,7 @@ const SphericalOf<T> SphericalOf<T>::down =
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
SphericalOf<T> SphericalOf<T>::WithDistance(float distance) {
|
SphericalOf<T> SphericalOf<T>::WithDistance(float distance) {
|
||||||
SphericalOf<T> v = SphericalOf<T>(distance, this->direction);
|
SphericalOf<T> v = SphericalOf<T>(distance, this->direction);
|
||||||
return SphericalOf<T>();
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> SphericalOf<T> SphericalOf<T>::operator-() const {
|
template <typename T> SphericalOf<T> SphericalOf<T>::operator-() const {
|
||||||
|
@ -7,6 +7,8 @@ namespace Control {
|
|||||||
|
|
||||||
// TemperatureSensor::TemperatureSensor() : Thing(Type::TemperatureSensor) {}
|
// TemperatureSensor::TemperatureSensor() : Thing(Type::TemperatureSensor) {}
|
||||||
|
|
||||||
|
TemperatureSensor::TemperatureSensor() : Thing(Type::TemperatureSensor) {}
|
||||||
|
|
||||||
TemperatureSensor::TemperatureSensor(unsigned char networkId,
|
TemperatureSensor::TemperatureSensor(unsigned char networkId,
|
||||||
unsigned char thingId)
|
unsigned char thingId)
|
||||||
: Thing(nullptr, networkId, thingId, Type::TemperatureSensor) {}
|
: Thing(nullptr, networkId, thingId, Type::TemperatureSensor) {}
|
||||||
|
@ -7,6 +7,7 @@ namespace Control {
|
|||||||
|
|
||||||
class TemperatureSensor : public Thing {
|
class TemperatureSensor : public Thing {
|
||||||
public:
|
public:
|
||||||
|
TemperatureSensor();
|
||||||
TemperatureSensor(unsigned char networkId, unsigned char thingId);
|
TemperatureSensor(unsigned char networkId, unsigned char thingId);
|
||||||
|
|
||||||
virtual void SetTemperature(float temp);
|
virtual void SetTemperature(float temp);
|
||||||
|
@ -188,6 +188,13 @@ float float16::f16tof32(uint16_t _value) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16_t float16::f32tof16(float f) const {
|
uint16_t float16::f32tof16(float f) const {
|
||||||
|
// untested code, but will avoid strict aliasing warning
|
||||||
|
// union {
|
||||||
|
// float f;
|
||||||
|
// uint32_t t;
|
||||||
|
// } u;
|
||||||
|
// u.f = f;
|
||||||
|
// uint32_t t = u.t;
|
||||||
uint32_t t = *(uint32_t *)&f;
|
uint32_t t = *(uint32_t *)&f;
|
||||||
// man bits = 10; but we keep 11 for rounding
|
// man bits = 10; but we keep 11 for rounding
|
||||||
uint16_t man = (t & 0x007FFFFF) >> 12;
|
uint16_t man = (t & 0x007FFFFF) >> 12;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user