mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 07:10:17 +00:00
81 lines
1.4 KiB
C
81 lines
1.4 KiB
C
/*
|
|
* IR_CMD_HandlerLogic.c
|
|
*
|
|
* Created on: Aug 26, 2024
|
|
* Author: DashyFox
|
|
*/
|
|
#include "IR_CMD_Handler.h"
|
|
#include "IR.h"
|
|
#include "ShiftReg.h"
|
|
|
|
#include "Print.h"
|
|
|
|
enum IR_MENU {
|
|
IR_MENU_Home,
|
|
|
|
IR_MENU_SHOT,
|
|
IR_MENU_PROGR,
|
|
IR_MENU_MACRO,
|
|
IR_MENU_,
|
|
|
|
};
|
|
|
|
// <<
|
|
extern void (*InputHandler)(void); // ProcessFunc
|
|
extern uint16_t inputParam; // current input parameter
|
|
|
|
// >>
|
|
extern IRData data;
|
|
|
|
// ()
|
|
extern void NullFunc(); // null func for paramEnter(NullFunc);
|
|
extern void paramEnter(void(*onEnter_)()); // setParamFunc for enter
|
|
|
|
uint8_t testData;
|
|
void selectShot(){
|
|
testData = inputParam;
|
|
}
|
|
|
|
|
|
unsigned char b1 = 1;
|
|
unsigned char b2 = 1;
|
|
unsigned char b3 = 1;
|
|
void IR_Home_Process() {
|
|
InputHandler = IR_Home_Process;
|
|
SetShiftReg_inline(0xff, 0, 0);
|
|
switch (data.command) {
|
|
case IR_FONT_RIGHT:
|
|
|
|
paramEnter(selectShot);
|
|
break;
|
|
|
|
// case IR_FONT_RIGHT:
|
|
// // if(!(b1>64 || b2> 64|| b3>64)) b1 = 64;
|
|
// // else
|
|
// // {
|
|
// // b1 = b1>>1;
|
|
// // b2 = b2<<1;
|
|
// // b3 = b3<<1;
|
|
// // }
|
|
// SetShiftReg_inline(b1, b2, b3);
|
|
// break;
|
|
case IR_FRONT_MID:
|
|
SetShiftReg_inline(0, 0, 0);
|
|
b1 = b2 = b3 = 0;
|
|
break;
|
|
case IR_FRONT_LEFT:
|
|
// if(!b3)
|
|
// b3 = 128;
|
|
// b3 = b3>>1;
|
|
// if(!b3)
|
|
// b2 = 64;
|
|
|
|
SetShiftReg_inline(++b1, ++b2, ++b3);
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|