void mcal::led::led_rgb_board::apply_color() { const uint_fast8_t my_r = uint_fast8_t(uint_fast16_t(uint_fast16_t(255U - get_hue_r()) * 100U) / 255U); const uint_fast8_t my_g = uint_fast8_t(uint_fast16_t(uint_fast16_t(255U - get_hue_g()) * 100U) / 255U); const uint_fast8_t my_b = uint_fast8_t(uint_fast16_t(uint_fast16_t(255U - get_hue_b()) * 100U) / 255U); mcal::pwm::mcal_pwm0().set_duty(my_r); mcal::pwm::mcal_pwm1().set_duty(my_g); mcal::pwm::mcal_pwm2().set_duty(my_b); }
static void TestPrintUnsignedFast8() { PoisonOutput(); sprintf(output, "%" PRIoFAST8, uint_fast8_t(042)); MOZ_RELEASE_ASSERT(!strcmp(output, "42")); PoisonOutput(); sprintf(output, "%" PRIuFAST8, uint_fast8_t(17)); MOZ_RELEASE_ASSERT(!strcmp(output, "17")); PoisonOutput(); sprintf(output, "%" PRIxFAST8, uint_fast8_t(0x2a)); MOZ_RELEASE_ASSERT(!strcmp(output, "2a")); PoisonOutput(); sprintf(output, "%" PRIXFAST8, uint_fast8_t(0xCD)); MOZ_RELEASE_ASSERT(!strcmp(output, "CD")); }
void setIndex(int index) { frame_index_ = uint_fast8_t(index); }