Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes to framework to be able to compile with sdcc 3.5.0 #21

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
dexbridge
=========

**NOTE: This version includes a package queue that saves up to 64 packets on the wixel and transmits them to a phone (running xDrip+) as soon as a bluetooth connection can be established. So if you are out of range of your phone you will not miss the packets but instead receive them once you are back in range.**

The handling of the LEDs also changed compared to the original version:
RED LED: Dex packet, blinking 1/sec while trying to capture a packet, blinking 2/sec once a packet has been captured.
YELLOW LED: Bluetooth status, blinking 1/sec while trying to connect to the phone, blinking 2/sec once a BLE connection has been established.

Disclaimer: This version is my personal research version - so code in the repository will often not work as expected. It also requires a modified version of xDrip to be able to correctly handle the modified packet format.

Pololu Wixel SDK, with dexbridge code.
This repository contains Adrien de Croy's polou wixel SDK, his original dexterity code, and a modified version of that code called dexbridge.
To build dexbridge, please download this entire repository.

All thanks to Adrien de Croy for all his work on developing dexterity, which has made this code possible.



22 changes: 0 additions & 22 deletions README.txt

This file was deleted.

17 changes: 14 additions & 3 deletions apps/shiftbrite/shiftbrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ BIT radioBlinkActive = 0;
uint8 radioLastActivity;
uint8 radioBlinkStart;

// This is initialized to be equal to param_input_bits, but restricted to be within 1..16.
uint8 input_bits;

// The number of hex characters it takes to express a color.
// 1-4 input bits = 1 char; 5-8 input bits = 2 chars; etc.
uint8 hex_chars_per_color;

// amount to shift to create the output
int8 shift;

// converts 0-9, a-f, or A-F into the corresponding hex value
uint8 hexCharToByte(char c)
{
Expand Down Expand Up @@ -124,9 +134,6 @@ void shiftbriteProcessByte(char c)
{
static char rgb[12]; // big enough to hold 4 hex digits times three colors
static uint8 i = 0;
static const uint8 input_bits = restrictRange(param_input_bits,1,16); // allow up to 16 bits = 4 hex digits
static const uint8 hex_chars_per_color = ((input_bits-1) >> 2) + 1; // 1-4 bits = 1; 5-8 bits = 2; etc.
static const int8 shift = 10 - input_bits; // amount to shift to create the output

if(c == '\r' || c == '\n')
{
Expand Down Expand Up @@ -193,6 +200,10 @@ void shiftbriteService()

void shiftbriteInit()
{
input_bits = restrictRange(param_input_bits,1,16); // allow up to 16 bits = 4 hex digits
hex_chars_per_color = ((input_bits-1) >> 2) + 1;
shift = 10 - input_bits;

SHIFTBRITE_DISABLE = 1; // disable shiftbrites until a valid color is sent
SHIFTBRITE_CLOCK = 0; // clock low
SHIFTBRITE_LATCH = 0; // prevent unintended latching
Expand Down
Loading