Fix SPI Display transmission bug

This commit is contained in:
Jan-Henrik 2020-04-18 00:58:45 +02:00
parent 210f5e1c77
commit 1ec0c55a23
3 changed files with 5 additions and 5 deletions

View file

@ -21,8 +21,7 @@ uint8_t u8x8_byte_4wire_stm32_spi(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int,
uint8_t* data = (uint8_t*)arg_ptr; uint8_t* data = (uint8_t*)arg_ptr;
switch (msg) { switch (msg) {
case U8X8_MSG_BYTE_SEND: case U8X8_MSG_BYTE_SEND:
HAL_SPI_Transmit(&hspi2, data, arg_int, HAL_MAX_DELAY);
HAL_SPI_Transmit(&hspi2, data, arg_int, 0);
break; break;
case U8X8_MSG_BYTE_INIT: case U8X8_MSG_BYTE_INIT:
break; break;

View file

@ -33,6 +33,7 @@ U8G2 = enabled
PRINTF_FLOATS = enabled PRINTF_FLOATS = enabled
APPLICATION_LARGE = TRUE APPLICATION_LARGE = TRUE
BOOTLOADER = midi2cv_bootloader BOOTLOADER = midi2cv_bootloader
#OPTIMIZE = TRUE
# Preferred upload command # Preferred upload command
UPLOAD_COMMAND = upload_combo_jtag UPLOAD_COMMAND = upload_combo_jtag

View file

@ -118,8 +118,8 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim)
static uint16_t count = 0; static uint16_t count = 0;
count++; count++;
if (count % (8000L / 24) == 0) { if (count % (8000L / 20) == 0) {
// refresh display with 24fps // refresh display with 20fps
ui.Flush(); ui.Flush();
count = 0; count = 0;
} }
@ -164,9 +164,9 @@ void Init(void)
int main(void) int main(void)
{ {
HAL_DeInit();
SystemInit(); SystemInit();
SCB->VTOR = 0x8000; SCB->VTOR = 0x8000;
HAL_DeInit();
HAL_Init(); HAL_Init();
__HAL_RCC_SYSCFG_CLK_ENABLE(); __HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE();