PS2_MOUSE_SET_SAFE(PS2_MOUSE_SET_RESOLUTION,resolution,"ps2 mouse set resolution");
}
voidps2_mouse_set_sample_rate(ps2_mouse_sample_rate_tsample_rate){PS2_MOUSE_SET_SAFE(PS2_MOUSE_SET_SAMPLE_RATE,sample_rate,"ps2 mouse set sample rate");}
0x3D,0x40,0x40,0x40,0x3D,0x3C,0x24,0xFF,0x24,0x24,0x48,0x7E,0x49,0x43,0x66,0x2B,0x2F,0xFC,0x2F,0x2B,0xFF,0x09,0x29,0xF6,0x20,0xC0,0x88,0x7E,0x09,0x03,0x20,0x54,0x54,0x79,0x41,0x00,0x00,0x44,0x7D,0x41,0x30,0x48,0x48,0x4A,0x32,0x38,0x40,0x40,0x22,0x7A,0x00,0x7A,0x0A,0x0A,0x72,0x7D,0x0D,0x19,0x31,0x7D,0x26,0x29,0x29,0x2F,0x28,0x26,0x29,0x29,0x29,0x26,0x30,0x48,0x4D,0x40,0x20,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x2F,0x10,0xC8,0xAC,0xBA,0x2F,0x10,0x28,0x34,0xFA,0x00,0x00,0x7B,0x00,0x00,0x08,0x14,0x2A,0x14,0x22,0x22,0x14,0x2A,0x14,0x08,0x55,0x00,0x55,0x00,0x55,// #176 (25% block) missing in old code
0x3D,0x40,0x40,0x40,0x3D,0x3C,0x24,0xFF,0x24,0x24,0x48,0x7E,0x49,0x43,0x66,0x2B,0x2F,0xFC,0x2F,0x2B,0xFF,0x09,0x29,0xF6,0x20,0xC0,0x88,0x7E,0x09,0x03,0x20,0x54,0x54,0x79,0x41,0x00,0x00,0x44,0x7D,0x41,0x30,0x48,0x48,0x4A,0x32,0x38,0x40,0x40,0x22,0x7A,0x00,0x7A,0x0A,0x0A,0x72,0x7D,0x0D,0x19,0x31,0x7D,0x26,0x29,0x29,0x2F,0x28,0x26,0x29,0x29,0x29,0x26,0x30,0x48,0x4D,0x40,0x20,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x2F,0x10,0xC8,0xAC,0xBA,0x2F,0x10,0x28,0x34,0xFA,0x00,0x00,0x7B,0x00,0x00,0x08,0x14,0x2A,0x14,0x22,0x22,0x14,0x2A,0x14,0x08,0x55,0x00,0x55,0x00,0x55,// #176 (25% block) missing in old code
0x14,0x14,0x14,0xF4,0x14,0x10,0x10,0xF0,0x10,0xF0,0x00,0x00,0x1F,0x10,0x1F,0x00,0x00,0x00,0x1F,0x14,0x00,0x00,0x00,0xFC,0x14,0x00,0x00,0xF0,0x10,0xF0,0x10,0x10,0xFF,0x10,0xFF,0x14,0x14,0x14,0xFF,0x14,0x10,0x10,0x10,0x1F,0x00,0x00,0x00,0x00,0xF0,0x10,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0x0F,0x38,0x44,0x44,0x38,0x44,0xFC,0x4A,0x4A,0x4A,0x34,// sharp-s or beta
0x14,0x14,0x14,0xF4,0x14,0x10,0x10,0xF0,0x10,0xF0,0x00,0x00,0x1F,0x10,0x1F,0x00,0x00,0x00,0x1F,0x14,0x00,0x00,0x00,0xFC,0x14,0x00,0x00,0xF0,0x10,0xF0,0x10,0x10,0xFF,0x10,0xFF,0x14,0x14,0x14,0xFF,0x14,0x10,0x10,0x10,0x1F,0x00,0x00,0x00,0x00,0xF0,0x10,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0x0F,0x38,0x44,0x44,0x38,0x44,0xFC,0x4A,0x4A,0x4A,0x34,// sharp-s or beta
// Retry i2c_start_impl a bunch times in case the remote side has interrupts disabled.
// Retry i2c_start_impl a bunch times in case the remote side has interrupts disabled.
uint16_ttimeout_timer=timer_read();
uint16_ttimeout_timer=timer_read();
uint16_ttime_slice=MAX(1,(timeout==(I2C_TIMEOUT_INFINITE))?5:(timeout/(I2C_START_RETRY_COUNT)));// if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries
uint16_ttime_slice=MAX(1,(timeout==(I2C_TIMEOUT_INFINITE))?5:(timeout/(I2C_START_RETRY_COUNT)));// if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries
OUTPUT_OFF_2,// trailing off: giving the DAC two more conversion cycles until the AUDIO_DAC_OFF_VALUE reaches the output, then turn the timer off, which leaves the output at that level
OUTPUT_OFF_2,// trailing off: giving the DAC two more conversion cycles until the AUDIO_DAC_OFF_VALUE reaches the output, then turn the timer off, which leaves the output at that level
if(freq>0){// disregard 'rest' notes, with valid frequency 0.0f; which would only lower the resulting waveform volume during the additive synthesis step
if(freq>0){// disregard 'rest' notes, with valid frequency 0.0f; which would only lower the resulting waveform volume during the additive synthesis step
# define STM32_ONBOARD_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO and EEPROM page sizing
# define STM32_ONBOARD_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO and EEPROM page sizing
@ -259,8 +259,10 @@ write/read to/from the other buffer).
voidws2812_init(void){
voidws2812_init(void){
// Initialize led frame buffer
// Initialize led frame buffer
uint32_ti;
uint32_ti;
for(i=0;i<WS2812_COLOR_BIT_N;i++)ws2812_frame_buffer[i]=WS2812_DUTYCYCLE_0;// All color bits are zero duty cycle
for(i=0;i<WS2812_COLOR_BIT_N;i++)
for(i=0;i<WS2812_RESET_BIT_N;i++)ws2812_frame_buffer[i+WS2812_COLOR_BIT_N]=0;// All reset bits are zero
ws2812_frame_buffer[i]=WS2812_DUTYCYCLE_0;// All color bits are zero duty cycle
for(i=0;i<WS2812_RESET_BIT_N;i++)
ws2812_frame_buffer[i+WS2812_COLOR_BIT_N]=0;// All reset bits are zero
palSetLineMode(RGB_DI_PIN,WS2812_OUTPUT_MODE);
palSetLineMode(RGB_DI_PIN,WS2812_OUTPUT_MODE);
@ -268,22 +270,22 @@ void ws2812_init(void) {
//#pragma GCC diagnostic ignored "-Woverride-init" // Turn off override-init warning for this struct. We use the overriding ability to set a "default" channel config
//#pragma GCC diagnostic ignored "-Woverride-init" // Turn off override-init warning for this struct. We use the overriding ability to set a "default" channel config
staticconstPWMConfigws2812_pwm_config={
staticconstPWMConfigws2812_pwm_config={
.frequency=WS2812_PWM_FREQUENCY,
.frequency=WS2812_PWM_FREQUENCY,
.period=WS2812_PWM_PERIOD,// Mit dieser Periode wird UDE-Event erzeugt und ein neuer Wert (Länge WS2812_BIT_N) vom DMA ins CCR geschrieben
.period=WS2812_PWM_PERIOD,// Mit dieser Periode wird UDE-Event erzeugt und ein neuer Wert (Länge WS2812_BIT_N) vom DMA ins CCR geschrieben
.callback=NULL,
.callback=NULL,
.channels=
.channels=
{
{
[0...3]={.mode=PWM_OUTPUT_DISABLED,.callback=NULL},// Channels default to disabled
[0...3]={.mode=PWM_OUTPUT_DISABLED,.callback=NULL},// Channels default to disabled
[WS2812_PWM_CHANNEL-1]={.mode=WS2812_PWM_OUTPUT_MODE,.callback=NULL},// Turn on the channel we care about
[WS2812_PWM_CHANNEL-1]={.mode=WS2812_PWM_OUTPUT_MODE,.callback=NULL},// Turn on the channel we care about
},
},
.cr2=0,
.cr2=0,
.dier=TIM_DIER_UDE,// DMA on update event for next period
.dier=TIM_DIER_UDE,// DMA on update event for next period
};
};
//#pragma GCC diagnostic pop // Restore command-line warning options
//#pragma GCC diagnostic pop // Restore command-line warning options