Skip to content

Commit

Permalink
fixed problem with implicit declaration in quantum/rgblight.c (qmk#8406)
Browse files Browse the repository at this point in the history
* Update tmk_core/common/progmem.h

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update quantum/rgblight.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* fixed problem with implicit declaration in quantum/rgblight.c (qmk#8381)

Co-authored-by: Ryan <fauxpark@gmail.com>
  • Loading branch information
2 people authored and HokieGeek committed Apr 10, 2020
1 parent 367a1d5 commit ff7cc31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions drivers/oled/oled_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>

#include "progmem.h"
#ifndef __AVR__
# define memcpy_P(des, src, len) memcpy(des, src, len)
#endif

// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf
Expand Down
11 changes: 8 additions & 3 deletions tmk_core/common/progmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
# include <avr/pgmspace.h>
#else
# define PROGMEM
# define pgm_read_byte(p) *((unsigned char*)(p))
# define pgm_read_word(p) *((uint16_t*)(p))
# define pgm_read_dword(p) *((uint32_t*)(p))
# define memcpy_P(dest, src, n) memcpy(dest, src, n)
# define pgm_read_byte(address_short) *((uint8_t*)(address_short))
# define pgm_read_word(address_short) *((uint16_t*)(address_short))
# define pgm_read_dword(address_short) *((uint32_t*)(address_short))
# define pgm_read_ptr(address_short) *((void*)(address_short))
# define strcmp_P(s1, s2) strcmp(s1, s2)
# define strcpy_P(dest, src) strcpy(dest, src)
# define strlen_P(src) strlen(src)
#endif

0 comments on commit ff7cc31

Please sign in to comment.