-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from m5stack/develop
0.0.6
- Loading branch information
Showing
117 changed files
with
9,379 additions
and
5,993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#if defined ( CONFIG_ARCH_BOARD_SPRESENSE ) | ||
#include <Arduino.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#ifdef atof | ||
#undef atof | ||
#endif | ||
#ifdef atoi | ||
#undef atoi | ||
#endif | ||
#ifdef atol | ||
#undef atol | ||
#endif | ||
__attribute__((weak)) float atof(const char* nptr) { return strtod((nptr), NULL); } | ||
__attribute__((weak)) int atoi(const char* nptr) { return (int)strtol((nptr), NULL, 10); } | ||
__attribute__((weak)) long atol(const char* nptr) { return strtol((nptr), NULL, 10); } | ||
__attribute__((weak)) int mblen(const char*, size_t) { return 0; } | ||
__attribute__((weak)) size_t mbstowcs(wchar_t*, const char*, size_t) { return 0; } | ||
__attribute__((weak)) int mbtowc(wchar_t*, const char*, size_t) { return 0; } | ||
__attribute__((weak)) size_t wcstombs(char*, const wchar_t*, size_t) { return 0; } | ||
__attribute__((weak)) int wctomb(char*, wchar_t) { return 0; } | ||
|
||
#ifdef max | ||
#undef max | ||
#endif | ||
|
||
#ifdef min | ||
#undef min | ||
#endif | ||
|
||
#endif | ||
#include <algorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#if defined ( CONFIG_ARCH_BOARD_SPRESENSE ) | ||
#ifdef max | ||
#undef max | ||
#endif | ||
|
||
#ifdef min | ||
#undef min | ||
#endif | ||
|
||
#endif | ||
#include <limits> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#if defined ( CONFIG_ARCH_BOARD_SPRESENSE ) | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <wchar.h> | ||
__attribute__((weak)) int vfwscanf(void*, const wchar_t *, ...) { return 0; } | ||
__attribute__((weak)) int vswscanf(const wchar_t*, const wchar_t *, ...) { return 0; } | ||
__attribute__((weak)) int vwscanf(const wchar_t*, ...) { return 0; } | ||
|
||
#define _GLIBCXX_CSTDINT 1 | ||
#endif | ||
#include <memory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*----------------------------------------------------------------------------/ | ||
Lovyan GFX - Graphics library for embedded devices. | ||
Original Source: | ||
https://github.com/lovyan03/LovyanGFX/ | ||
Licence: | ||
[BSD](https://github.com/lovyan03/LovyanGFX/blob/master/license.txt) | ||
Author: | ||
[lovyan03](https://twitter.com/lovyan03) | ||
Contributors: | ||
[ciniml](https://github.com/ciniml) | ||
[mongonta0716](https://github.com/mongonta0716) | ||
[tobozo](https://github.com/tobozo) | ||
/----------------------------------------------------------------------------*/ | ||
#ifndef __LGFX_PGMSPACE_H__ | ||
#define __LGFX_PGMSPACE_H__ | ||
|
||
#if defined ( ARDUINO ) && !defined ( pgm_read_byte ) | ||
#if __has_include(<pgmspace.h>) | ||
#include <pgmspace.h> | ||
#elif __has_include(<avr/pgmspace.h>) || defined(__AVR__) | ||
#include <avr/pgmspace.h> | ||
#else | ||
#include <Arduino.h> | ||
#endif | ||
#endif | ||
#if !defined ( pgm_read_byte ) | ||
#define pgm_read_byte(addr) (*(const uint8_t *)((uintptr_t)addr)) | ||
#define pgm_read_word(addr) (*(const uint16_t *)((uintptr_t)addr)) | ||
#define pgm_read_dword(addr) (*(const uint32_t *)((uintptr_t)addr)) | ||
#endif | ||
|
||
/// for not ESP8266 | ||
#if !defined ( pgm_read_dword_with_offset ) | ||
#if defined (__SAMD21__) | ||
#define pgm_read_word_unaligned(addr) (uint16_t) \ | ||
( *(const uint8_t *)((uintptr_t)addr) \ | ||
| *(const uint8_t *)((uintptr_t)addr+1) << 8 ) | ||
#define pgm_read_3byte_unaligned(addr) (uint32_t) \ | ||
( *(const uint8_t *)((uintptr_t)addr) \ | ||
| *(const uint8_t *)((uintptr_t)addr+1) << 8 \ | ||
| *(const uint8_t *)((uintptr_t)addr+2) << 16 ) | ||
#define pgm_read_dword_unaligned(addr) (uint32_t) \ | ||
( *(const uint8_t *)((uintptr_t)addr) \ | ||
| *(const uint8_t *)((uintptr_t)addr+1) << 8 \ | ||
| *(const uint8_t *)((uintptr_t)addr+2) << 16 \ | ||
| *(const uint8_t *)((uintptr_t)addr+3) << 24 ) | ||
#else | ||
#define pgm_read_word_unaligned(addr) (*(const uint16_t *)((uintptr_t)addr)) | ||
#define pgm_read_dword_unaligned(addr) (*(const uint32_t *)((uintptr_t)addr)) | ||
#endif | ||
#endif | ||
|
||
#if !defined ( pgm_read_3byte_unaligned ) | ||
#define pgm_read_3byte_unaligned(addr) (pgm_read_dword_unaligned(addr) & 0xFFFFFFu) | ||
#endif | ||
|
||
#if defined (__SAMD21__) || defined ( ESP8266 ) | ||
static inline void write_3byte_unaligned(void* addr, uint32_t value) | ||
{ | ||
reinterpret_cast<uint8_t*>(addr)[0] = value; | ||
reinterpret_cast<uint8_t*>(addr)[1] = value >> 8; | ||
reinterpret_cast<uint8_t*>(addr)[2] = value >> 16; | ||
} | ||
#else | ||
static inline void write_3byte_unaligned(void* addr, uint32_t value) | ||
{ | ||
reinterpret_cast<uint16_t*>(addr)[0] = value; | ||
reinterpret_cast<uint8_t*>(addr)[2] = value >> 16; | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.