New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'printf_P' was not declared in this scope #19
Comments
in AES.h there is the header code that defines functions missing in boards.
|
my bad the file is : AES_config.h the code you need for due is : defined(SAM3X8E) and is an ARM device add this: as Arduino due is an arm device but the device specific code is SAM3X8E |
Hi, I have tried the 3 combinations:
The error still shows up. Since seems I don't use to call the printArray function, is that okay if I just commented out each line of "printf_P(PSTR..." in AES.cpp? |
you can try , but there will be other errors as well. |
Hi, This is my file |
Hi! To make it work in Arduino MKRGSM 1400, and I guess all arduino ARM family I've changed the following: Note I've only tested in MKGSM. So, in Base64.h: #include "Base64.h"
#if defined(__AVR__) || defined(__arm__)
#include <avr/pgmspace.h>
#else
#include <pgmspace.h>
#endif
... And in AES_Config.h (whole file): /* code was modified by george spanos <spaniakos@gmail.com>
* 16/12/14
*/
#ifndef __AES_CONFIG_H__
#define __AES_CONFIG_H__
//defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWIFI1010)
#if (defined(__linux) || defined(linux)) && !(defined(__ARDUINO_X86__) || defined(__arm__))
#define AES_LINUX
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#else
#include <Arduino.h>
#endif
#include <stdint.h>
#include <string.h>
//defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWIFI1010)
#if defined(__ARDUINO_X86__) || defined(__arm__) || (defined (__linux) || defined (linux))
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#define pgm_read_byte(p) (*(p))
typedef unsigned char byte;
#define printf_P printf
#define PSTR(x) (x)
#else
#if (defined(__AVR__))
#include <avr/pgmspace.h>
#else
#include <pgmspace.h>
#endif
#endif
#define N_ROW 4
#define N_COL 4
#define N_BLOCK (N_ROW * N_COL)
#define N_MAX_ROUNDS 14
#define KEY_SCHEDULE_BYTES ((N_MAX_ROUNDS + 1) * N_BLOCK)
#define SUCCESS (0)
#define FAILURE (-1)
#endif @spaniakos maybe you want to include it or I could do a PR... just tell. |
i would like to check it on my boards as well. |
Sure! let me know if there's any issue with |
moving to pull request conv. |
This works perfect in arduino mega. But when I use it in arduino due, there are several 'printf_P' error:
The text was updated successfully, but these errors were encountered: