Hi,
I am porting a lib from arduino. Previously in its header file it was written as <avr/io.h> now I changed it to just io.h but it says uint8 and uint32 not defined. How shall I handle this error?
Hi,
I am porting a lib from arduino. Previously in its header file it was written as <avr/io.h> now I changed it to just io.h but it says uint8 and uint32 not defined. How shall I handle this error?
youthreewire - are you using the Maple IDE?
The Maple IDE seems completely happy with compiling the Blink program with a couple of extra declarations (though I haven't uploaded):
uint8 f = HIGH;
uint32 g = LOW;
void setup() {
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, f); // set the LED on
delay(100); // wait for a second
digitalWrite(13, g); // set the LED off
delay(100); // wait for a second
}
You could
#include "libmaple_types.h"
if those types are all you need.
(full disclosure: I am not a member of LeafLabs staff.)
<avr/io.h> now I changed it to just io.h
This will not work. The "avr/" part means it's an AVR-specific header. The Arduino boards are based on the AVR architecture, while Maple is based off of ARM. This means that code that relies on AVR-specific features (like those present in avr/io.h) will not work on the Maple.
There is a file in libmaple called io.h, but that's just a coincidence. It has nothing to do with the avr/io.h header.
Perhaps you can give us a link to the library? Maybe we can figure out what parts of avr/io.h it uses, and what the equivalent things are on ARM.
Like it says in the Guidelines for Posting,
If you want help porting a library (or checking if it works), provide a link to the library in your post.
You must log in to post.