Commit 8da9264 1 parent d56e77a commit 8da9264 Copy full SHA for 8da9264
File tree 5 files changed +25
-21
lines changed
5 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,7 @@ void getActTile(lv_event_t *event)
143
143
isScrolled = true ;
144
144
log_d (" Free PSRAM: %d" , ESP.getFreePsram ());
145
145
log_d (" Used PSRAM: %d" , ESP.getPsramSize () - ESP.getFreePsram ());
146
- // if (activeTile == MAP || activeTile == NAV)
147
- if (activeTile == MAP)
148
- {
149
- isPosMoved = true ;
150
- redrawMap = true ;
151
- }
146
+
152
147
if (activeTile == SATTRACK)
153
148
{
154
149
createSatSprite (spriteSat);
@@ -168,8 +163,6 @@ void getActTile(lv_event_t *event)
168
163
else
169
164
{
170
165
isReady = true ;
171
- redrawMap = false ;
172
- isPosMoved = false ;
173
166
}
174
167
175
168
lv_obj_t *actTile = lv_tileview_get_tile_act (tilesScreen);
@@ -261,22 +254,35 @@ void updateMap(lv_event_t *event)
261
254
getPosition (getLat (), getLon ());
262
255
if (isPosMoved)
263
256
{
264
-
265
257
tileSize = VECTOR_TILE_SIZE;
266
258
viewPort.setCenter (point);
259
+
260
+ #ifdef SPI_SHARED
261
+ tft.endTransaction ();
262
+ tft.releaseBus ();
263
+ initSD ();
264
+ #endif
265
+
267
266
getMapBlocks (viewPort.bbox , memCache);
268
- generateVectorMap (viewPort, memCache, mapTempSprite);
267
+
268
+ #ifdef SPI_SHARED
269
+ SD.end ();
270
+ tft.initBus ();
271
+ #endif
272
+
273
+ deleteMapScrSprites ();
274
+ createMapScrSprites ();
275
+ generateVectorMap (viewPort, memCache, mapTempSprite);
276
+
269
277
isPosMoved = false ;
270
278
}
271
279
}
272
280
else
273
281
{
274
282
tileSize = RENDER_TILE_SIZE;
275
- generateRenderMap ();
283
+ generateRenderMap ();
276
284
}
277
-
278
- if (redrawMap)
279
- displayMap (tileSize);
285
+ displayMap (tileSize);
280
286
}
281
287
282
288
/* *
Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ void generateRenderMap()
94
94
createMapScrSprites ();
95
95
96
96
#ifdef SPI_SHARED
97
+ // tft.waitDisplay();
97
98
tft.endTransaction ();
98
- tft.waitDisplay ();
99
99
tft.releaseBus ();
100
100
initSD ();
101
101
#endif
@@ -136,13 +136,11 @@ void generateRenderMap()
136
136
oldMapTile.zoom = currentMapTile.zoom ;
137
137
oldMapTile.tilex = currentMapTile.tilex ;
138
138
oldMapTile.tiley = currentMapTile.tiley ;
139
- redrawMap = true ;
140
139
}
141
140
142
141
#ifdef SPI_SHARED
143
142
SD.end ();
144
143
tft.initBus ();
145
- tft.beginTransaction ();
146
144
#endif
147
145
148
146
log_v (" TILE: %s" , oldMapTile.file );
Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ class LGFX : public lgfx::LGFX_Device
46
46
#endif
47
47
cfg.spi_mode = 0 ;
48
48
cfg.freq_write = 79999999 ;
49
- cfg.freq_read = 40000000 ;
49
+ cfg.freq_read = 27000000 ;
50
50
cfg.spi_3wire = false ;
51
51
cfg.use_lock = false ;
52
- cfg.dma_channel = 2 ;
52
+ cfg.dma_channel = SPI_DMA_CH_AUTO ;
53
53
cfg.pin_sclk = TFT_SPI_SCLK;
54
54
cfg.pin_mosi = TFT_SPI_MOSI;
55
55
cfg.pin_miso = TFT_SPI_MISO;
@@ -72,7 +72,7 @@ class LGFX : public lgfx::LGFX_Device
72
72
cfg.offset_rotation = 0 ;
73
73
cfg.dummy_read_pixel = 8 ;
74
74
cfg.dummy_read_bits = 1 ;
75
- cfg.readable = false ;
75
+ cfg.readable = true ;
76
76
cfg.invert = TFT_INVERT;
77
77
cfg.rgb_order = false ;
78
78
cfg.dlen_16bit = false ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ void initSD()
25
25
digitalWrite (SD_CS,LOW);
26
26
27
27
#ifdef SPI_SHARED
28
+ SD.end ();
28
29
SDInitOk = SD.begin (SD_CS);
29
30
#endif
30
31
#ifndef SPI_SHARED
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ void setup()
94
94
#endif
95
95
initLvglTask ();
96
96
97
-
98
97
#ifndef DISABLE_CLI
99
98
initCLI ();
100
99
initCLITask ();
You can’t perform that action at this time.
0 commit comments