分类 默认分类 下的文章

change encoder to normal 1/2 Slower

new v4.3b pcb encoder is so fast ,change one time jump 2 icon,so change code to change encoder 1 icon
/home/jumbo/portapack-mayhem/firmware/application/hw/encoder.cpp

include "portapack_persistent_memory.hpp"

using namespace portapack;
static const int8_t transition_map_slow[] = {

 0,    // 0000: noop
 0,    // 0001: start
 0,    // 0010: start
 0,    // 0011: rate
 1,    // 0100: end
 0,    // 0101: noop
 0,    // 0110: rate
-1,    // 0111: end

};

if (persistent_memory::config_login()) {
return transition_map_slow[state & 0xf];

} else{

return transition_map[state & 0xf];

}


ui_setting.cpp
&checkbox_login,

checkbox_login.set_value(persistent_memory::config_login());

persistent_memory::set_config_login(checkbox_login.value());

ui_setting.hpp

Checkbox checkbox_login {
    { 3 * 8, 12 * 16 },
    20,
    "Encoders Pulses Slower"
};

build H2+ v1.3.1 firmware to support both ak4951 and wm8731

portapack-mayhem/firmware/application/portapack.cpp

static const portapack::cpld::Config& portapack_cpld_config() {

return (portapack_model() == PortaPackModel::R2_20170522)
    ? portapack::cpld::rev_20170522::config
    : portapack::cpld::**rev_20170522**::config
    ;

}

Backlight* backlight() {

return (portapack_model() == PortaPackModel::R2_20170522)
    ? static_cast<portapack::Backlight*>(&backlight_cat4004)
    : static_cast<portapack::Backlight*>(&backlight_**cat4004**);

}

inside ** is change
one fw so easy to support wm8731 and ak4951 auto detect