main/task_tft.c

branch
idf 5.1
changeset 129
31f9d3e4a85f
parent 128
64886971967b
equal deleted inserted replaced
128:64886971967b 129:31f9d3e4a85f
15 time_t now; ///< Current time 15 time_t now; ///< Current time
16 time_t last = 0; ///< Last time 16 time_t last = 0; ///< Last time
17 struct tm timeinfo; ///< Current time structure 17 struct tm timeinfo; ///< Current time structure
18 char s_timer[16]; ///< Timer string buffer 18 char s_timer[16]; ///< Timer string buffer
19 char s_top_msg[64]; ///< Top message string buffer 19 char s_top_msg[64]; ///< Top message string buffer
20
21 extern my_config_t config;
22 extern my_equipment_t equipment;
23 extern my_runtime_t runtime;
20 24
21 extern float stageTemp; 25 extern float stageTemp;
22 extern uint16_t stageTime; 26 extern uint16_t stageTime;
23 extern uint16_t TimeWhirlPool; 27 extern uint16_t TimeWhirlPool;
24 extern uint32_t TimeLeft; 28 extern uint32_t TimeLeft;
125 assert(ret == ESP_OK); 129 assert(ret == ESP_OK);
126 ret = spi_lobo_device_deselect(spi); 130 ret = spi_lobo_device_deselect(spi);
127 assert(ret == ESP_OK); 131 assert(ret == ESP_OK);
128 132
129 ESP_LOGD(TAG, "SPI: attached display, spi bus: %d, speed: %u, bus uses native pins: %s", 133 ESP_LOGD(TAG, "SPI: attached display, spi bus: %d, speed: %u, bus uses native pins: %s",
130 SPI_BUS, spi_lobo_get_speed(spi), spi_lobo_uses_native_pins(spi) ? "true" : "false"); 134 SPI_BUS, (unsigned)spi_lobo_get_speed(spi), spi_lobo_uses_native_pins(spi) ? "true" : "false");
131 135
132 ESP_LOGI(TAG, "TS pins : miso=%d, mosi=%d, sck=%d, cs=%d", PIN_NUM_MISO, PIN_NUM_MOSI, PIN_NUM_CLK, PIN_NUM_TCS); 136 ESP_LOGI(TAG, "TS pins : miso=%d, mosi=%d, sck=%d, cs=%d", PIN_NUM_MISO, PIN_NUM_MOSI, PIN_NUM_CLK, PIN_NUM_TCS);
133 137
134 ret=spi_lobo_bus_add_device(SPI_BUS, &buscfg, &tsdevcfg, &tsspi); 138 ret=spi_lobo_bus_add_device(SPI_BUS, &buscfg, &tsdevcfg, &tsspi);
135 assert(ret == ESP_OK); 139 assert(ret == ESP_OK);
139 ret = spi_lobo_device_select(tsspi, 1); 143 ret = spi_lobo_device_select(tsspi, 1);
140 assert(ret == ESP_OK); 144 assert(ret == ESP_OK);
141 ret = spi_lobo_device_deselect(tsspi); 145 ret = spi_lobo_device_deselect(tsspi);
142 assert(ret == ESP_OK); 146 assert(ret == ESP_OK);
143 147
144 ESP_LOGD(TAG, "SPI: attached TS device, spi bus: %d, speed: %u", SPI_BUS, spi_lobo_get_speed(tsspi)); 148 ESP_LOGD(TAG, "SPI: attached TS device, spi bus: %d, speed: %u", SPI_BUS, (unsigned)spi_lobo_get_speed(tsspi));
145 149
146 // ==== Initialize the Display ==== 150 // ==== Initialize the Display ====
147 TFT_display_init(); 151 TFT_display_init();
148 152
149 // ---- Detect maximum read speed ---- 153 // ---- Detect maximum read speed ----
150 max_rdclock = find_rd_speed(); 154 max_rdclock = find_rd_speed();
151 155
152 // ==== Set SPI clock used for display operations ==== 156 // ==== Set SPI clock used for display operations ====
153 spi_lobo_set_speed(spi, DEFAULT_SPI_CLOCK); 157 spi_lobo_set_speed(spi, DEFAULT_SPI_CLOCK);
154 ESP_LOGD(TAG, "SPI: Max rd speed: %u, changed speed to %u", max_rdclock, spi_lobo_get_speed(spi)); 158 ESP_LOGD(TAG, "SPI: Max rd speed: %u, changed speed to %u", (unsigned)max_rdclock, (unsigned)spi_lobo_get_speed(spi));
155 159
156 font_rotate = 0; 160 font_rotate = 0;
157 text_wrap = 0; 161 text_wrap = 0;
158 font_transparent = 0; 162 font_transparent = 0;
159 font_forceFixed = 0; 163 font_forceFixed = 0;

mercurial