Minor updates

This commit is contained in:
Drashna Jael're
2021-06-10 19:49:58 -07:00
parent e7fd95a92d
commit ffb08866c7
2 changed files with 5 additions and 6 deletions

View File

@@ -18,7 +18,7 @@
absData_t touchData;
void print_byte(uint8_t byte) { dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); }
void print_byte(uint8_t byte) { xprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); }
void pointing_device_task(void) {
Pinnacle_GetAbsolute(&touchData);
@@ -29,7 +29,7 @@ void pointing_device_task(void) {
print_byte(touchData.zValue);
print_byte(touchData.buttonFlags);
print_byte(touchData.touchDown);
dprintf("\n");
xprintf("\n");
}
/* Pinnacle-based TM040040 Functions */
@@ -51,8 +51,8 @@ void pointing_device_init(void) {
// Reads XYZ data from Pinnacle registers 0x14 through 0x17
// Stores result in absData_t struct with xValue, yValue, and zValue members
void Pinnacle_GetAbsolute(absData_t* result) {
uint8_t data[6] = {0, 0, 0, 0, 0, 0};
RAP_ReadBytes(PACKET_BYTE_0), data, 6);
uint8_t data[6] = { 0 };
RAP_ReadBytes(PACKET_BYTE_0, data, 6);
Pinnacle_ClearFlags();

View File

@@ -16,9 +16,8 @@ typedef struct {
typedef struct {
uint8_t xValue;
uint8_t yValue;
uint8_t zValue;
uint8_t wValue;
uint8_t buttonFlags;
bool touchDown;
} relativeData_t;
extern absData_t touchData;