1
0
Fork 0

test build of 'Host shield' in minimal env.

This commit is contained in:
tmk 2012-08-25 15:49:08 +09:00
parent 9382bf2f76
commit c5060ea819
26 changed files with 500 additions and 267 deletions

View file

@ -18,19 +18,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef DEBUG_H
#define DEBUG_H 1
#include <stdbool.h>
#include "print.h"
#define debug(s) if(debug_enable) print(s)
#define debug(s) if(debug_enable) print_P(PSTR(s))
#define debug_hex(c) if(debug_enable) phex(c)
#define debug_hex16(i) if(debug_enable) phex16(i)
#define debug_bin(c) if(debug_enable) pbin(c)
#define debug_bin_reverse(c) if(debug_enable) pbin_reverse(c)
bool debug_enable;
bool debug_matrix;
bool debug_keyboard;
bool debug_mouse;
#ifdef __cplusplus
extern "C" {
#endif
extern bool debug_enable;
extern bool debug_matrix;
extern bool debug_keyboard;
extern bool debug_mouse;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -23,6 +23,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "host_driver.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NKRO_ENABLE
extern bool keyboard_nkro;
#endif
@ -54,4 +58,8 @@ void host_mouse_send(report_mouse_t *report);
void host_system_send(uint16_t data);
void host_consumer_send(uint16_t data);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -21,8 +21,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void keyboard_init(void);
void keyboard_proc(void);
void keyboard_set_leds(uint8_t leds);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -29,11 +29,17 @@
#include <avr/pgmspace.h>
extern bool print_enable;
// avoid collision with arduino/Print.h
#ifndef __cplusplus
// this macro allows you to write print("some text") and
// the string is automatically placed into flash memory :)
#define print(s) print_P(PSTR(s))
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern bool print_enable;
void print_S(const char *s);
void print_P(const char *s);
@ -41,5 +47,8 @@ void phex(unsigned char c);
void phex16(unsigned int i);
void pbin(unsigned char c);
void pbin_reverse(unsigned char c);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -21,7 +21,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* transmit a character. return 0 on success, -1 on error. */
int8_t sendchar(uint8_t c);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -23,10 +23,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef TIMER_PRESCALER
# if F_CPU > 16000000
# define TIMER_PRESCALER 256
# elif F_CPU >= 4000000
# elif F_CPU > 2000000
# define TIMER_PRESCALER 64
# else
# elif F_CPU > 250000
# define TIMER_PRESCALER 8
# else
# define TIMER_PRESCALER 1
# endif
#endif
#define TIMER_RAW_FREQ (F_CPU/TIMER_PRESCALER)
@ -42,6 +44,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define TIMER_DIFF_MS(a, b) TIMER_DIFF(a, b, UINT16_MAX)
#ifdef __cplusplus
extern "C" {
#endif
extern volatile uint16_t timer_count;
@ -49,5 +54,8 @@ void timer_init(void);
void timer_clear(void);
uint16_t timer_read(void);
uint16_t timer_elapsed(uint16_t last);
#ifdef __cplusplus
}
#endif
#endif