[teagba] Fix type conversions
This commit is contained in:
6
deps/teagba/include/teagba/registers.hpp
vendored
6
deps/teagba/include/teagba/registers.hpp
vendored
@ -9,7 +9,7 @@
|
||||
namespace teagba {
|
||||
|
||||
inline auto bgSetSbb(volatile BgCtl *bgCtl, unsigned sbb) noexcept {
|
||||
*bgCtl = (*bgCtl & ~0b11111'0000'0000u) | (sbb << 8);
|
||||
*bgCtl = static_cast<BgCtl>(*bgCtl & ~0b11111'0000'0000u) | static_cast<BgCtl>(sbb << 8);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
@ -24,7 +24,7 @@ inline auto bgPri(const volatile BgCtl *bgCtl) noexcept {
|
||||
|
||||
inline auto bgSetPri(volatile BgCtl *bgCtl, unsigned pri) noexcept {
|
||||
pri = pri & 0b1;
|
||||
*bgCtl = (*bgCtl & ~0b1u) | (pri << 0);
|
||||
*bgCtl = static_cast<BgCtl>(*bgCtl & ~0b1u) | static_cast<BgCtl>(pri << 0);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
@ -58,7 +58,7 @@ inline auto bgCbb(const volatile BgCtl *bgCtl) noexcept {
|
||||
|
||||
inline auto bgSetCbb(volatile BgCtl *bgCtl, unsigned cbb) noexcept {
|
||||
cbb = cbb & 0b11;
|
||||
*bgCtl = (*bgCtl & ~0b1100u) | (cbb << 2);
|
||||
*bgCtl = static_cast<BgCtl>(*bgCtl & ~0b1100u) | static_cast<BgCtl>(cbb << 2);
|
||||
}
|
||||
|
||||
constexpr void iterateBgCtl(auto cb) noexcept {
|
||||
|
Reference in New Issue
Block a user