Compare commits
3 Commits
android-ap
...
rotary
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34618d640d | ||
|
|
38b24f5998 | ||
|
|
2b785e5b0c |
@@ -48,8 +48,8 @@ public:
|
|||||||
void utilizeEventData();
|
void utilizeEventData();
|
||||||
private:
|
private:
|
||||||
ThreadCommon::QueueManager* _qm;
|
ThreadCommon::QueueManager* _qm;
|
||||||
RelayDevice relays [2] = {{0, 24, 0},
|
RelayDevice relays [2] = {{0, 11, 0},
|
||||||
{0, 26, 1}};
|
{0, 23, 1}};
|
||||||
|
|
||||||
void parseEvent(Event * e);
|
void parseEvent(Event * e);
|
||||||
int8_t setpoint, ext_temp;
|
int8_t setpoint, ext_temp;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
static QueueHandle_t * p_rotary_isr_q;
|
static QueueHandle_t * p_rotary_isr_q;
|
||||||
|
|
||||||
|
static DigitalIoPin * p_sigB;
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
void
|
void
|
||||||
@@ -19,11 +21,17 @@ extern "C"
|
|||||||
{
|
{
|
||||||
Chip_PININT_ClearIntStatus (LPC_PININT, PININTCH (PIN_INT0_IRQn));
|
Chip_PININT_ClearIntStatus (LPC_PININT, PININTCH (PIN_INT0_IRQn));
|
||||||
portBASE_TYPE xHigherPriorityWoken = pdFALSE;
|
portBASE_TYPE xHigherPriorityWoken = pdFALSE;
|
||||||
uint8_t data = ThreadCommon::RotaryAction::Right;
|
uint8_t data;
|
||||||
|
|
||||||
|
if (p_sigB->read())
|
||||||
|
data = ThreadCommon::RotaryAction::Left;
|
||||||
|
else
|
||||||
|
data = ThreadCommon::RotaryAction::Right;
|
||||||
|
|
||||||
xQueueSendFromISR (*p_rotary_isr_q, &data, &xHigherPriorityWoken);
|
xQueueSendFromISR (*p_rotary_isr_q, &data, &xHigherPriorityWoken);
|
||||||
portEND_SWITCHING_ISR(xHigherPriorityWoken);
|
portEND_SWITCHING_ISR(xHigherPriorityWoken);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
void
|
void
|
||||||
PIN_INT1_IRQHandler (void)
|
PIN_INT1_IRQHandler (void)
|
||||||
{
|
{
|
||||||
@@ -33,11 +41,11 @@ extern "C"
|
|||||||
xQueueSendFromISR (*p_rotary_isr_q, &data, &xHigherPriorityWoken);
|
xQueueSendFromISR (*p_rotary_isr_q, &data, &xHigherPriorityWoken);
|
||||||
portEND_SWITCHING_ISR(xHigherPriorityWoken);
|
portEND_SWITCHING_ISR(xHigherPriorityWoken);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
PIN_INT2_IRQHandler (void)
|
PIN_INT1_IRQHandler (void)
|
||||||
{
|
{
|
||||||
Chip_PININT_ClearIntStatus (LPC_PININT, PININTCH (PIN_INT2_IRQn));
|
Chip_PININT_ClearIntStatus (LPC_PININT, PININTCH (PIN_INT1_IRQn));
|
||||||
portBASE_TYPE xHigherPriorityWoken = pdFALSE;
|
portBASE_TYPE xHigherPriorityWoken = pdFALSE;
|
||||||
uint8_t data = ThreadCommon::RotaryAction::Press;
|
uint8_t data = ThreadCommon::RotaryAction::Press;
|
||||||
xQueueSendFromISR (*p_rotary_isr_q, &data, &xHigherPriorityWoken);
|
xQueueSendFromISR (*p_rotary_isr_q, &data, &xHigherPriorityWoken);
|
||||||
@@ -48,6 +56,7 @@ extern "C"
|
|||||||
Rotary::Rotary(ThreadCommon::QueueManager* qm) : _qm(qm)
|
Rotary::Rotary(ThreadCommon::QueueManager* qm) : _qm(qm)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("Creating Rotary");
|
LOG_DEBUG("Creating Rotary");
|
||||||
|
p_sigB = &(this->signal[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rotary::~Rotary()
|
Rotary::~Rotary()
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
Event* message;
|
Event* message;
|
||||||
ThreadCommon::QueueManager* _qm;
|
ThreadCommon::QueueManager* _qm;
|
||||||
DigitalIoPin signal[3] = { { 0, 1, true, true, false, true, PIN_INT0_IRQn}, //SW1
|
DigitalIoPin signal[3] = { { 1, 18, true, true, false, true, PIN_INT0_IRQn}, //sigA
|
||||||
{ 0, 16, true, true, false, true, PIN_INT1_IRQn}, //SW2
|
{ 2, 12, true, true, false}, //sigB
|
||||||
{ 1, 8, true, false, false, true, PIN_INT2_IRQn} };
|
{ 0, 2, true, true, false, true, PIN_INT1_IRQn} }; //Press, sw //2 11 (pin without interrupt) //0 1 (board button)
|
||||||
};
|
};
|
||||||
|
|
||||||
void thread_rotary(void* pvParams);
|
void thread_rotary(void* pvParams);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ void Temperature::taskFunction()
|
|||||||
if(temp_value == -128)
|
if(temp_value == -128)
|
||||||
{
|
{
|
||||||
LOG_ERROR("Failed to get temperature.");
|
LOG_ERROR("Failed to get temperature.");
|
||||||
|
vTaskDelay(10000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,19 +75,19 @@ void UserInterface::handleLCD(LiquidCrystal *lcd, const char *str)
|
|||||||
|
|
||||||
void UserInterface::initLCD1()
|
void UserInterface::initLCD1()
|
||||||
{
|
{
|
||||||
this->lcd1_rs = new DigitalIoPin(1, 9, false);
|
this->lcd1_rs = new DigitalIoPin(1, 24, false);//(1, 18, false);
|
||||||
this->lcd1_en = new DigitalIoPin(0, 14, false);
|
this->lcd1_en = new DigitalIoPin(1, 26, false);//(1, 24, false);
|
||||||
this->lcd1_d4 = new DigitalIoPin(0, 13, false);
|
this->lcd1_d4 = new DigitalIoPin(1, 27, false);//(1, 19, false);
|
||||||
this->lcd1_d5 = new DigitalIoPin(0, 12, false);
|
this->lcd1_d5 = new DigitalIoPin(1, 25, false);//(1, 26, false);
|
||||||
this->lcd1_d6 = new DigitalIoPin(0, 23, false);
|
this->lcd1_d6 = new DigitalIoPin(1, 28, false);//(1, 27, false);
|
||||||
this->lcd1_d7 = new DigitalIoPin(0, 11, false);
|
this->lcd1_d7 = new DigitalIoPin(2, 3, false);//(1, 25, false);
|
||||||
|
|
||||||
this->lcd1_rs->write(false);
|
this->lcd1_rs->write(false);
|
||||||
this->lcd1_en->write(false);
|
this->lcd1_en->write(false);
|
||||||
this->lcd1_d4->write(false);
|
this->lcd1_d4->write(false);
|
||||||
this->lcd1_d5->write(false);
|
this->lcd1_d5->write(false);
|
||||||
this->lcd1_d6->write(false);
|
this->lcd1_d6->write(false);
|
||||||
this->lcd1_d7->write(false);
|
this->lcd1_d7->write(false);
|
||||||
// LCD init.
|
// LCD init.
|
||||||
this->lcd1 = new LiquidCrystal(this->lcd1_rs, this->lcd1_en, this->lcd1_d4,
|
this->lcd1 = new LiquidCrystal(this->lcd1_rs, this->lcd1_en, this->lcd1_d4,
|
||||||
this->lcd1_d5, this->lcd1_d6, this->lcd1_d7);
|
this->lcd1_d5, this->lcd1_d6, this->lcd1_d7);
|
||||||
|
|||||||
Reference in New Issue
Block a user