bugfix compile error
This commit is contained in:
parent
b929b419af
commit
6695835808
|
@ -70,6 +70,7 @@ extern "C"{
|
|||
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
|
||||
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
|
||||
|
||||
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
|
||||
#define microsecondsToClockCycles(a) ( (a) * (F_CPU / 1000000L) )
|
||||
|
||||
typedef unsigned int word;
|
||||
|
|
|
@ -17,15 +17,12 @@
|
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#if defined(ARDUINO_ARCH_AVR)
|
||||
|
||||
#include <avr/interrupt.h>
|
||||
extern "C" {
|
||||
#include "Arduino.h"
|
||||
}
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Servo.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_AVR)
|
||||
|
||||
#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009
|
||||
#define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
#include <inttypes.h>
|
||||
#define ARDUINO_ARCH_AVR
|
||||
|
||||
/*
|
||||
* Defines for 16 bit timers used with Servo library
|
||||
*
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#define PLATFORM_HAS_BATTERY 1
|
||||
|
||||
|
||||
#define LOOP_INTERVAL (30 * CLOCK_SECOND)
|
||||
#define LOOP_INTERVAL (CLOCK_SECOND/10)
|
||||
|
||||
/* Save energy */
|
||||
//#define RDC_CONF_PT_YIELD_OFF
|
||||
|
|
|
@ -9,27 +9,23 @@
|
|||
* Note that for a normal arduino sketch you won't have to include any
|
||||
* of the contiki-specific files here, the sketch should just work.
|
||||
*/
|
||||
#include "Servo.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "arduino-process.h"
|
||||
#include "rest-engine.h"
|
||||
#include "net/netstack.h"
|
||||
#include "Servo.h"
|
||||
|
||||
extern resource_t res_led, res_battery, res_cputemp;
|
||||
}
|
||||
|
||||
uint8_t led_pin=4;
|
||||
uint8_t led_status;
|
||||
|
||||
|
||||
int potpin = A5; // analog pin used to connect the potentiometer
|
||||
int val; // variable to read the value from the analog pin
|
||||
|
||||
Servo servo(); // create servo object to control a servo
|
||||
|
||||
}
|
||||
|
||||
Servo servo; // create servo object to control a servo
|
||||
|
||||
void setup (void)
|
||||
{
|
||||
|
@ -48,7 +44,7 @@ void setup (void)
|
|||
#pragma GCC diagnostic pop
|
||||
|
||||
// NETSTACK_MAC.off(1);
|
||||
mcu_sleep_set(128);
|
||||
// mcu_sleep_set(128);
|
||||
}
|
||||
|
||||
void loop (void)
|
||||
|
|
Loading…
Reference in a new issue