Re-arranged files

This commit is contained in:
2022-08-31 20:01:39 +02:00
parent 7243b50fbc
commit b070dc655a
9 changed files with 69 additions and 61 deletions

View File

@@ -23,8 +23,10 @@
}
template<typename T>
static constexpr void io_class__volatile_assign(volatile T& dst, const T& src) {
dst.raw_value = src.raw_value;
static constexpr __always_inline void io_class__volatile_assign(T& dst, const T& src) {
typedef decltype(dst.raw_value) DST_VALUE;
const_cast<volatile DST_VALUE&>(dst.raw_value) = src.raw_value;
}
#endif //!__JABYENGINE_IO_CLASS_HELPER_HPP__

View File

@@ -1,7 +1,7 @@
#ifndef __JABYENGINE_SPU_PORTS_HPP__
#define __JABYENGINE_SPU_PORTS_HPP__
#include "../Auxiliary/io_class_helper.hpp"
#include "../../limits.h"
#ifndef __JABYENGINE_SPU_IO_HPP__
#define __JABYENGINE_SPU_IO_HPP__
#include "../../Auxiliary/io_class_helper.hpp"
#include <limits.h>
namespace SPU {
enum Mode {
@@ -46,17 +46,13 @@ namespace SPU {
return *this;
}
//A value between 0 and 1000
constexpr auto& set_volume_step(VolumeStep volume_step) {
volume_step *= SingleVolumeStep;
this->raw_value = bit::value::set_normalized(this->raw_value, volume_step, __start_end_bit2_start_length(0, 14));
constexpr auto& set_volume(int16_t volume) {
this->raw_value = bit::value::set_normalized(this->raw_value, static_cast<int16_t>((volume >> 1)), __start_end_bit2_start_length(0, 14));
return *this;
}
//A value between 0 and 1000
constexpr VolumeStep get_volume_step() const {
return (bit::value::get_normalized(this->raw_value, __start_end_bit2_start_length(0, 14))/SingleVolumeStep);
constexpr int16_t get_volume_step() const {
return bit::value::get_normalized(this->raw_value, __start_end_bit2_start_length(0, 14));
}
io_class__2option_map(volume_mode, sweep_mode, 15);
@@ -109,4 +105,4 @@ namespace SPU {
};
}
#endif //!__JABYENGINE_SPU_PORTS_HPP__
#endif //!__JABYENGINE_SPU_IO_HPP__