Skip to content

Commit 89cfad3

Browse files
fix-codacy-warnings (#2)
1 parent 284cf49 commit 89cfad3

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

README.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
11
# OpenStreetMap-esp32
22

3+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0961fc2320cd495a9411eb391d5791ca)](https://app.codacy.com/gh/CelliesProjects/OpenStreetMap-esp32/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
4+
35
## What is this
46

5-
This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and caching system for ESP32-based devices.<br>
7+
This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and tile caching system for ESP32-based devices.
68
Under the hood it uses [LovyanGFX](https://github.com/lovyan03/LovyanGFX) and [PNGdec](https://github.com/bitbank2/PNGdec) to do the heavy lifting.
79

8-
It fetches, decodes and caches OSM tiles, composes a map from these tiles and returns the map as a LGFX sprite.<br>The sprite can be pushed to the screen or used for further composing.<br>Downloaded tiles are cached in psram.
10+
A map is composed from downloaded OSM tiles and returned as a LGFX sprite.
11+
The sprite can be pushed to the screen or used for further composing.
12+
Downloaded tiles are cached in psram for reuse.
913

10-
The library should work on any ESP32 type with a bit of psram and a LovyanGFX compatible display.
14+
The library should work on any ESP32 type with psram and a LovyanGFX compatible display.
1115

12-
## Copyright and license of the map data
16+
The downloaded tile cache gets large very quickly -128kB per tile- so a ESP32 with psram is required.
1317

14-
The OpenstreetMap-esp32 library -this library- is licensed under the [MIT license](/license).<br> The downloaded tile data has a different license than this library.
18+
![map](https://github.com/user-attachments/assets/bc0534c1-b2e6-4f6e-804f-95b7db00c850)
19+
An example 320px by 240px map
1520

16-
OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/) by the OpenStreetMap Foundation (OSMF).<br>
17-
Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use).
21+
### License differences between this library and the map data
22+
23+
#### This library has a MIT license
1824

19-
## Screenshots and example code
25+
The `OpenstreetMap-esp32` library -this library- is licensed under the [MIT license](/LICENSE).
2026

21-
![map](https://github.com/user-attachments/assets/bc0534c1-b2e6-4f6e-804f-95b7db00c850)
27+
#### The downloaded tile data has a Open Data Commons Open Database License (ODbL)
28+
29+
OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/) by the OpenStreetMap Foundation (OSMF).
30+
31+
Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use).
2232

23-
Screenshot of a 320x240 map from a esp32-s3-box-lite
33+
### Example code
2434

25-
### Example code returning the default 320x240 map
35+
#### Example returning the default 320x240 map
2636

2737
```c++
2838
#include <Arduino.h>
@@ -82,11 +92,7 @@ void loop()
8292
}
8393
```
8494

85-
![map](https://github.com/user-attachments/assets/9a92bbff-e96d-444d-8b34-29801744fa80)
86-
87-
Screenshot of a 480x800 map from a esp32-8048s050
88-
89-
### Example code setting map resolution and cache size on RGB panel devices
95+
### Example setting map resolution and cache size on RGB panel devices
9096

9197
```c++
9298
#include <Arduino.h>
@@ -151,8 +157,11 @@ void loop()
151157
delay(1000);
152158
}
153159
```
160+
![map](https://github.com/user-attachments/assets/9a92bbff-e96d-444d-8b34-29801744fa80)
161+
Screenshot of a 480x800 map from a esp32-8048s050
162+
163+
### PlatformIO setup\
154164

155-
### PlatformIO setup
156165
```bash
157166
lib_deps =
158167
https://github.com/CelliesProjects/OpenStreetMap-esp32

src/MemoryBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ MemoryBuffer::MemoryBuffer(size_t size) : size_(size), buffer_(nullptr)
55
{
66
if (size_ > 0)
77
{
8-
buffer_ = (uint8_t *)malloc(size_);
8+
buffer_ = static_cast<uint8_t*>(malloc(size_));
99
if (buffer_ == nullptr)
1010
{
1111
log_e("Memory allocation failed!");

0 commit comments

Comments
 (0)