forked from KurtE/Phantom_Phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hex_Globals.h
92 lines (70 loc) · 2.68 KB
/
Hex_Globals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//==============================================================================
// GLOBALS - The main global definitions for the CPhenix program - still needs
// to be cleaned up.
// This program assumes that the main files were compiled as C files
//==============================================================================
#ifndef _HEX_GLOBALS_H_
#define _HEX_GLOBALS_H_
#include <stdarg.h>
#include "BioloidEx.h"
#include "Hex_Cfg.h"
#include "ServoDriver.h"
#include "InputController.h"
#include <EEPROM.h>
#ifdef USEXBEE
#include "diyxbee.h"
#endif
//=============================================================================
//[CONSTANTS]
//=============================================================================
#define BUTTON_DOWN 0
#define BUTTON_UP 1
#define c1DEC 10
#define c2DEC 100
#define c4DEC 10000
#define c6DEC 1000000
#define cRR 0
#define cRM 1
#define cRF 2
#define cLR 3
#define cLM 4
#define cLF 5
#define WTIMERTICSPERMSMUL 64 // BAP28 is 16mhz need a multiplyer and divider to make the conversion with /8192
#define WTIMERTICSPERMSDIV 125 //
#define USEINT_TIMERAV
#define NUM_GAITS 6
#define SmDiv 4 //"Smooth division" factor for the smooth control function, a value of 3 to 5 is most suitable
extern void GaitSelect(void);
extern short SmoothControl (short CtrlMoveInp, short CtrlMoveOut, byte CtrlDivider);
//-----------------------------------------------------------------------------
// Define global class objects
//-----------------------------------------------------------------------------
extern ServoDriver g_ServoDriver; // our global servo driver class
extern InputController g_InputController; // Our Input controller
extern INCONTROLSTATE g_InControlState; // State information that controller changes
//-----------------------------------------------------------------------------
// Define Global variables
//-----------------------------------------------------------------------------
extern boolean g_fDebugOutput;
extern boolean g_fEnableServos; // Hack to allow me to turn servo processing off...
extern boolean g_fRobotUpsideDown; // Is the robot upside down?
extern void MSound(byte cNotes, ...);
extern boolean CheckVoltage(void);
void AdjustLegPositionsToBodyHeight(void);
// debug handler...
extern boolean g_fDBGHandleError;
#ifdef c4DOF
extern const byte cTarsLength[] PROGMEM;
#endif
#ifdef OPT_BACKGROUND_PROCESS
#define DoBackgroundProcess() g_ServoDriver.BackgroundProcess()
#else
#define DoBackgroundProcess()
#endif
#ifdef __AVR__
#if not defined(UBRR1H)
//extern NewSoftSerial SSCSerial;
extern SoftwareSerial SSCSerial;
#endif
#endif
#endif