Started massive re-factor and re-write of code base -- VERY BROKEN

This commit is contained in:
Mike C 2013-04-06 02:40:36 -04:00
parent 3c3c1faaf0
commit 6a242a25c1
6 changed files with 61 additions and 62 deletions

View file

@ -22,11 +22,6 @@
// Don't change anything below here // Don't change anything below here
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Standard colors
#define BACKGROUND BLACK
#define TEXT GRAY
#define HILIGHT GOLD
// Serial modes supported // Serial modes supported
// Abused in for loops / lookup tables -- DO NOT CHANGE none or set values // Abused in for loops / lookup tables -- DO NOT CHANGE none or set values
enum serialmode { enum serialmode {

View file

@ -8,3 +8,17 @@
attribute. attribute.
*/ */
UI State machine (current element = config / stats / inline display of data)
Configuration state machine (speed, pinout, logic level, sd card on/off, boot logo on/off)
Message to config (element + new value)
Message to UI (element + success/fail)
// Button's controlling UI
UIButton* okButton = new UIButton(22, 23);
UIButton* cancelButton = new UIButton(24, 25);
// Select / Enter
if (okButton->isPressed()) {
//FIXME: Re-enable once new LCD is online
//setMode(selectedMode);
}

View file

@ -8,3 +8,44 @@
attribute. attribute.
*/ */
// PSP joystick tracking
long pspUpCount = 0; // Used to slow down how fast we repeat up movement
long pspDownCount = 0; // Used to slow down how fast we repeat down movement
int pspXAxisValue;
int pspYAxisValue;
// Read the x/y values from the joystick
pspXAxisValue=map(analogRead(pspXPin), 0, 1023, 0, 10);
pspYAxisValue=map(analogRead(pspYPin), 0, 1023, 0, 10);
// Move cursor Up
if (pspYAxisValue > 6 ) {
pspUpCount++;
if (pspUpCount > 768) {
pspUpCount = 0;
serialmode newMode = (serialmode)(selectedMode - 1);
if (newMode >= 0) {
//FIXME: Re-enable once new LCD is online
//setSelection(newMode);
}
}
}
else {
pspUpCount = 0;
}
// Move cursor Down
if (pspYAxisValue < 4 ) {
pspDownCount++;
if (pspDownCount > 768) {
serialmode newMode = (serialmode)(selectedMode + 1);
if (newMode <= modelinespeed) {
//FIXME: Re-enable once new LCD is online
//setSelection(newMode);
}
pspDownCount = 0;
}
}
else {
pspDownCount = 0;
}

View file

@ -8,3 +8,7 @@
attribute. attribute.
*/ */
// Standard colors
#define BACKGROUND BLACK
#define TEXT GRAY
#define HILIGHT GOLD

View file

@ -9,17 +9,6 @@
*/ */
#include "Project.h" #include "Project.h"
#include "UIButton.h"
// Button's controlling UI
UIButton* okButton = new UIButton(22, 23);
UIButton* cancelButton = new UIButton(24, 25);
// PSP joystick tracking
long pspUpCount = 0; // Used to slow down how fast we repeat up movement
long pspDownCount = 0; // Used to slow down how fast we repeat down movement
int pspXAxisValue;
int pspYAxisValue;
// Mode info needed // Mode info needed
serialmode currentMode = none; serialmode currentMode = none;
@ -44,49 +33,5 @@ void setup() {
} }
void loop() { void loop() {
// Read the x/y values from the joystick
pspXAxisValue=map(analogRead(pspXPin), 0, 1023, 0, 10);
pspYAxisValue=map(analogRead(pspYPin), 0, 1023, 0, 10);
// Move cursor Up
if (pspYAxisValue > 6 ) {
pspUpCount++;
if (pspUpCount > 768) {
pspUpCount = 0;
serialmode newMode = (serialmode)(selectedMode - 1);
if (newMode >= 0) {
//FIXME: Re-enable once new LCD is online
//setSelection(newMode);
}
}
}
else {
pspUpCount = 0;
}
// Move cursor Down
if (pspYAxisValue < 4 ) {
pspDownCount++;
if (pspDownCount > 768) {
serialmode newMode = (serialmode)(selectedMode + 1);
if (newMode <= modelinespeed) {
//FIXME: Re-enable once new LCD is online
//setSelection(newMode);
}
pspDownCount = 0;
}
}
else {
pspDownCount = 0;
}
// Select / Enter
if (okButton->isPressed()) {
//FIXME: Re-enable once new LCD is online
//setMode(selectedMode);
}
} }