Adding comments for DoxyGen
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
//------------------------------ INCLUDES -------------------------------------
|
||||
|
||||
#include "aconnoHelpers.h"
|
||||
#include "sdk_config.h"
|
||||
#include "app_error.h"
|
||||
@@ -21,7 +23,11 @@
|
||||
|
||||
#include "MCP23017.h"
|
||||
#include "acd52832Bsp.h"
|
||||
|
||||
//-------------------------------- MACROS -------------------------------------
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//--------------------- PRIVATE FUNCTION PROTOTYPES ---------------------------
|
||||
//----------------------- STATIC DATA & CONSTANTS -----------------------------
|
||||
//------------------------------ GLOBAL DATA ----------------------------------
|
||||
extern bool getInterruptSourceFlag;
|
||||
extern AconnoI2C i2c;
|
||||
extern AconnoGPIO ledRed;
|
||||
@@ -29,10 +35,9 @@ extern AconnoGPIO ledBlue;
|
||||
extern AconnoGPIO ledGreen;
|
||||
extern MCP23017 expdr;
|
||||
extern AconnoGPIO ld1;
|
||||
/**@brief Function for the Timer initialization.
|
||||
*
|
||||
* @details Initializes the timer module. This creates and starts application timers.
|
||||
*/
|
||||
|
||||
//--------------------- PUBLIC FUNCTIONS AND OBJECTS --------------------------
|
||||
|
||||
void timersInit(void)
|
||||
{
|
||||
// Initialize timer module.
|
||||
@@ -40,20 +45,15 @@ void timersInit(void)
|
||||
APP_ERROR_CHECK(err_code);
|
||||
}
|
||||
|
||||
/**@brief Function for starting application timers.
|
||||
* @details Timers are run after the scheduler has started.
|
||||
*/
|
||||
void applicationTimerStart(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**@brief Clear bond information /*/
|
||||
void deleteBonds(void)
|
||||
{
|
||||
NRF_LOG_INFO("Erase bonds!");
|
||||
}
|
||||
|
||||
/**@brief Function for initializing the nrf log module. */
|
||||
void logInit(void)
|
||||
{
|
||||
ret_code_t err_code = NRF_LOG_INIT(NULL);
|
||||
@@ -62,8 +62,6 @@ void logInit(void)
|
||||
NRF_LOG_DEFAULT_BACKENDS_INIT();
|
||||
}
|
||||
|
||||
/**@brief Function for initializing the clock.
|
||||
*/
|
||||
void clockInit(void)
|
||||
{
|
||||
ret_code_t err_code = nrf_drv_clock_init();
|
||||
@@ -117,7 +115,7 @@ BaseType_t xTaskCreateOrResume(TaskFunction_t pvTaskCode,
|
||||
|
||||
void logState(TaskHandle_t xCreatedTask)
|
||||
{
|
||||
eTaskState taskState =eTaskGetState( xCreatedTask );
|
||||
eTaskState taskState = eTaskGetState(xCreatedTask);
|
||||
switch (taskState)
|
||||
{
|
||||
case eRunning:
|
||||
@@ -146,7 +144,7 @@ void initIoExpander(MCP23017 *expdr)
|
||||
expdr->reset();
|
||||
expdr->config(0x01F8, 0xFFFF, 0x0000);
|
||||
|
||||
for(uint8_t x=3; x<10; x++) // Init values on Expander pins
|
||||
for(uint8_t x = 3; x < 10; x++) // Init values on Expander pins
|
||||
{
|
||||
expdr->writeGPIOBit(1, x);
|
||||
}
|
||||
@@ -164,8 +162,8 @@ uint8_t checkState(MCP23017 *expdr, AconnoGPIO *sw1)
|
||||
_(RIGHT);
|
||||
_(CENTER);
|
||||
#undef _
|
||||
result |= (expdr->readGPIOBit(IOEXP_INT_SOURCE:: SW2) << SW2_BIT);
|
||||
result |= ((uint8_t)sw1->read() << SW1_BIT);
|
||||
result |= (expdr->readGPIOBit(IOEXP_INT_SOURCE::SW2) << SW2_BIT);
|
||||
result |= ((uint8_t) sw1->read() << SW1_BIT);
|
||||
result ^= 0xff;
|
||||
|
||||
return result;
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
|
||||
#ifndef __ACONNO_HELPERS_H__
|
||||
#define __ACONNO_HELPERS_H__
|
||||
|
||||
//------------------------------ INCLUDES -------------------------------------
|
||||
#include <stdint.h>
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "MCP23017.h"
|
||||
#include "aconnoConfig.h"
|
||||
#include "timers.h"
|
||||
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
/**
|
||||
* @brief Enumeration for the interrupt source pressed
|
||||
*
|
||||
@@ -37,6 +37,37 @@ enum IOEXP_INT_SOURCE : uint8_t
|
||||
REL2 = 10
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Beacon advertisement packet
|
||||
*
|
||||
*/
|
||||
struct __attribute__((packed, aligned(1))) advertisementPacket_t
|
||||
{
|
||||
uint8_t size = sizeof(advertisementPacket_t)-1;
|
||||
uint8_t msdID = MSD_ID;
|
||||
uint16_t nordicUUID = NORDIC_UUID;
|
||||
uint8_t aconnoUUID = ACONNO_UUID;;
|
||||
uint8_t productID = PRODUCT_ID;
|
||||
uint8_t settingsFlag : 1, versionNumber : 7;
|
||||
int8_t advType = FIRST_ADV_TYPE_ID;
|
||||
union
|
||||
{
|
||||
struct __attribute__((packed, aligned(4)))
|
||||
{
|
||||
int16_t gyroscope[3];
|
||||
int16_t accelerometer[3];
|
||||
int16_t magnetometer[3];
|
||||
};
|
||||
struct __attribute__((packed, aligned(4)))
|
||||
{
|
||||
float temp;
|
||||
float light;
|
||||
uint8_t joy;
|
||||
uint8_t pot;
|
||||
};
|
||||
};
|
||||
};
|
||||
//-------------------------- CONSTANTS & MACROS -------------------------------
|
||||
/**
|
||||
* @defgroup GROUP_BIT
|
||||
* @brief IoExpander gpio input read bit position
|
||||
@@ -50,11 +81,33 @@ enum IOEXP_INT_SOURCE : uint8_t
|
||||
#define SW2_BIT (1)
|
||||
#define SW1_BIT (0)
|
||||
/** @} */
|
||||
//----------------------------PUBLIC PROTOTYPES -------------------------------
|
||||
|
||||
/**
|
||||
* @brief Function for the Timer initialization.
|
||||
* @details Initializes the timer module. This creates and starts application timers.
|
||||
*/
|
||||
void timersInit(void);
|
||||
|
||||
/**
|
||||
* @brief Function for starting application timers.
|
||||
* @details Timers are run after the scheduler has started.
|
||||
*/
|
||||
void applicationTimerStart(void);
|
||||
|
||||
/**
|
||||
* @brief Clear bond information
|
||||
*/
|
||||
void deleteBonds(void);
|
||||
|
||||
/**
|
||||
* @brief Function for initializing the nrf log module.
|
||||
*/
|
||||
void logInit(void);
|
||||
|
||||
/**
|
||||
* @brief Function for initializing the clock.
|
||||
*/
|
||||
void clockInit(void);
|
||||
|
||||
/**
|
||||
@@ -89,37 +142,6 @@ void initIoExpander(MCP23017 *expdr);
|
||||
*/
|
||||
uint8_t checkState(MCP23017 *expdr, AconnoGPIO *sw1);
|
||||
|
||||
/**
|
||||
* @brief BLE Beacon advertisement packet
|
||||
*
|
||||
*/
|
||||
struct __attribute__((packed, aligned(1))) advertisementPacket_t
|
||||
{
|
||||
uint8_t size = sizeof(advertisementPacket_t)-1;
|
||||
uint8_t msdID = MSD_ID;
|
||||
uint16_t nordicUUID = NORDIC_UUID;
|
||||
uint8_t aconnoUUID = ACONNO_UUID;;
|
||||
uint8_t productID = PRODUCT_ID;
|
||||
uint8_t settingsFlag : 1, versionNumber : 7;
|
||||
int8_t advType = FIRST_ADV_TYPE_ID;
|
||||
union
|
||||
{
|
||||
struct __attribute__((packed, aligned(4)))
|
||||
{
|
||||
int16_t gyroscope[3];
|
||||
int16_t accelerometer[3];
|
||||
int16_t magnetometer[3];
|
||||
};
|
||||
struct __attribute__((packed, aligned(4)))
|
||||
{
|
||||
float temp;
|
||||
float light;
|
||||
uint8_t joy;
|
||||
uint8_t pot;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Timer callback to set the flag which prevents too many interrupt
|
||||
* events from ioexpander from occuring
|
||||
@@ -134,7 +156,6 @@ void intFlagTimerCallback(TimerHandle_t xTimer);
|
||||
*/
|
||||
void bspInit();
|
||||
|
||||
|
||||
#endif // __ACONNO_HELPERS_H__
|
||||
|
||||
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
* @copyright Copyright (c) 2019
|
||||
*
|
||||
*/
|
||||
|
||||
//------------------------------ INCLUDES -------------------------------------
|
||||
#include "menuStates.h"
|
||||
#include "aconnoHelpers.h"
|
||||
#include "GDEP015OC1.h"
|
||||
#include "aconnoBeeper.h"
|
||||
#include "semphr.h"
|
||||
|
||||
|
||||
//-------------------------------- MACROS -------------------------------------
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//--------------------- PRIVATE FUNCTION PROTOTYPES ---------------------------
|
||||
//----------------------- STATIC DATA & CONSTANTS -----------------------------
|
||||
//------------------------------ GLOBAL DATA ----------------------------------
|
||||
extern TaskHandle_t LDRTask;
|
||||
extern TaskHandle_t potTask;
|
||||
extern TaskHandle_t tempTask;
|
||||
@@ -34,24 +36,38 @@ extern AconnoGPIO ld1;
|
||||
extern MCP23017 expdr;
|
||||
extern GDEP015OC1 epd;
|
||||
extern Servo servo;
|
||||
|
||||
extern AconnoGPIO ledRed;
|
||||
extern AconnoGPIO ledGreen;
|
||||
extern AconnoGPIO ledBlue;
|
||||
|
||||
extern QueueHandle_t interruptSourceQueueSecondary;
|
||||
|
||||
extern AconnoBeeper beeper;
|
||||
|
||||
uint8_t irFlag;
|
||||
uint8_t joyFlag;
|
||||
uint8_t ldrFlag;
|
||||
uint8_t tempFlag;
|
||||
extern QueueHandle_t interruptSourceQueueSecondary;
|
||||
extern SemaphoreHandle_t epdWriteMutex;
|
||||
|
||||
/**
|
||||
* @brief A flag for initializing infrared task if reentered
|
||||
*
|
||||
*/
|
||||
uint8_t gIrFlag;
|
||||
/**
|
||||
* @brief A flag to help with initial drawing of the joystick example
|
||||
*
|
||||
*/
|
||||
uint8_t gJoyFlag;
|
||||
/**
|
||||
* @brief A flag for initializing LDR task if reentered
|
||||
*
|
||||
*/
|
||||
uint8_t gLdrFlag;
|
||||
/**
|
||||
* @brief A flag for initializing temperature task if reentered
|
||||
*
|
||||
*/
|
||||
uint8_t gTempFlag;
|
||||
|
||||
bool gBleTaskSuspend = false;
|
||||
|
||||
extern SemaphoreHandle_t epdWriteMutex;
|
||||
|
||||
//--------------------- PUBLIC FUNCTIONS AND OBJECTS --------------------------
|
||||
State::State()
|
||||
{
|
||||
_writeMethod = EPD_WRITE_METHOD::PARTIAL;
|
||||
@@ -77,18 +93,6 @@ uint8_t State::writeToEpd()
|
||||
|
||||
State::~State(){}
|
||||
|
||||
State *UnimplementedState::handleEvent(IOEXP_INT_SOURCE intSource)
|
||||
{
|
||||
return new Intro1State();
|
||||
}
|
||||
|
||||
void UnimplementedState::displayOnEpd()
|
||||
{
|
||||
epd.empty();
|
||||
epd.writeString("UNIMPLEMENTED", 60, 100, COLOR_BLACK);
|
||||
writeToEpd();
|
||||
}
|
||||
|
||||
Intro1State::Intro1State(){}
|
||||
Intro1State::Intro1State(EPD_WRITE_METHOD writeMethod):State(writeMethod){}
|
||||
State *Intro1State::handleEvent(IOEXP_INT_SOURCE intSource)
|
||||
@@ -189,7 +193,7 @@ void JoystickExampleState::displayOnEpd()
|
||||
xQueueSendToBack(interruptSourceQueueSecondary,
|
||||
(void *) &helperSendSecondary,
|
||||
((TickType_t)10) != pdPASS);
|
||||
joyFlag = 1;
|
||||
gJoyFlag = 1;
|
||||
vTaskResume(joystickExampleTask);
|
||||
}
|
||||
|
||||
@@ -461,7 +465,7 @@ State* LdrExampleState::handleEvent(IOEXP_INT_SOURCE intSource)
|
||||
if(intSource == IOEXP_INT_SOURCE::JOY_CENTER)
|
||||
{
|
||||
vTaskSuspend(LDRTask);
|
||||
ldrFlag = 1;
|
||||
gLdrFlag = 1;
|
||||
returnStatep = new LdrMenuState(EPD_WRITE_METHOD::FULL);
|
||||
}
|
||||
else
|
||||
@@ -582,7 +586,7 @@ State *TempProbeExampleState::handleEvent(IOEXP_INT_SOURCE intSource)
|
||||
if(intSource == IOEXP_INT_SOURCE::JOY_CENTER)
|
||||
{
|
||||
vTaskSuspend(tempTask);
|
||||
tempFlag = 1;
|
||||
gTempFlag = 1;
|
||||
returnStatep = new TempProbeMenuState(EPD_WRITE_METHOD::FULL);
|
||||
}
|
||||
else
|
||||
@@ -770,7 +774,7 @@ State *InfraredExampleState::handleEvent(IOEXP_INT_SOURCE intSource)
|
||||
if(intSource == IOEXP_INT_SOURCE::JOY_CENTER)
|
||||
{
|
||||
vTaskSuspend(irTask);
|
||||
irFlag = 1;
|
||||
gIrFlag = 1;
|
||||
irLed.write(GPIO_STATE::LOW);
|
||||
returnStatep = new InfraredMenuState(EPD_WRITE_METHOD::FULL);
|
||||
}
|
||||
@@ -904,4 +908,6 @@ void BleExampleState::displayOnEpd()
|
||||
epd.drawImage(BleBeaconInMeni);
|
||||
writeToEpd();
|
||||
vTaskResume(bleTask);
|
||||
}
|
||||
}
|
||||
//--------------------------- PRIVATE FUNCTIONS -------------------------------
|
||||
//--------------------------- INTERRUPT HANDLERS ------------------------------
|
||||
+115
-10
@@ -10,12 +10,13 @@
|
||||
*/
|
||||
#ifndef __MENU_STATES_H__
|
||||
#define __MENU_STATES_H__
|
||||
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//-------------------------- CONSTANTS & MACROS -------------------------------
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "aconnoHelpers.h"
|
||||
#include "aconnoTasks.h"
|
||||
|
||||
//----------------------------PUBLIC PROTOTYPES -------------------------------
|
||||
/**
|
||||
* @brief Abstract state.
|
||||
*
|
||||
@@ -72,14 +73,10 @@ class State
|
||||
EPD_WRITE_METHOD _writeMethod;
|
||||
};
|
||||
|
||||
class UnimplementedState : public State
|
||||
{
|
||||
public:
|
||||
|
||||
State *handleEvent(IOEXP_INT_SOURCE intSource);
|
||||
void displayOnEpd();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Intro 1 state class
|
||||
*
|
||||
*/
|
||||
class Intro1State : public State
|
||||
{
|
||||
public:
|
||||
@@ -89,6 +86,10 @@ class Intro1State : public State
|
||||
void displayOnEpd();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Intro 2 state class
|
||||
*
|
||||
*/
|
||||
class Intro2State : public State
|
||||
{
|
||||
public:
|
||||
@@ -98,6 +99,10 @@ class Intro2State : public State
|
||||
void displayOnEpd();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Intro 3 state class
|
||||
*
|
||||
*/
|
||||
class Intro3State : public State
|
||||
{
|
||||
public:
|
||||
@@ -108,6 +113,10 @@ class Intro3State : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Menu joystick state class
|
||||
*
|
||||
*/
|
||||
class JoystickMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -118,6 +127,10 @@ class JoystickMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Joystick task state class
|
||||
*
|
||||
*/
|
||||
class JoystickExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -128,6 +141,10 @@ class JoystickExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Menu sound state class
|
||||
*
|
||||
*/
|
||||
class SoundMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -138,6 +155,10 @@ class SoundMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Sound task state class
|
||||
*
|
||||
*/
|
||||
class SoundExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -148,6 +169,10 @@ class SoundExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Menu RGB (red, green, blue) LED state class
|
||||
*
|
||||
*/
|
||||
class RgbLedMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -158,6 +183,10 @@ class RgbLedMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief RGB task state class
|
||||
*
|
||||
*/
|
||||
class RgbLedExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -168,6 +197,10 @@ class RgbLedExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Menu servo state class
|
||||
*
|
||||
*/
|
||||
class ServoMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -178,6 +211,10 @@ class ServoMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Servo task state class
|
||||
*
|
||||
*/
|
||||
class ServoExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -188,6 +225,10 @@ class ServoExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Servo jumper instructions state class
|
||||
*
|
||||
*/
|
||||
class ServoInstructionState : public State
|
||||
{
|
||||
public:
|
||||
@@ -198,6 +239,10 @@ class ServoInstructionState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Light detection resistor menu state class
|
||||
*
|
||||
*/
|
||||
class LdrMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -208,6 +253,10 @@ class LdrMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Light detection resistor task state class
|
||||
*
|
||||
*/
|
||||
class LdrExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -218,6 +267,10 @@ class LdrExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Potentiometer menu state class
|
||||
*
|
||||
*/
|
||||
class PotentiometerMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -228,6 +281,10 @@ class PotentiometerMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Potentiometer task state class
|
||||
*
|
||||
*/
|
||||
class PotentiometerExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -238,6 +295,10 @@ class PotentiometerExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Ambient temperature menu state class
|
||||
*
|
||||
*/
|
||||
class TempProbeMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -248,6 +309,10 @@ class TempProbeMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Ambient temeprature task state class
|
||||
*
|
||||
*/
|
||||
class TempProbeExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -258,6 +323,10 @@ class TempProbeExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Relay menu state class
|
||||
*
|
||||
*/
|
||||
class RelayMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -268,6 +337,10 @@ class RelayMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Relay task state class
|
||||
*
|
||||
*/
|
||||
class RelayExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -278,6 +351,10 @@ class RelayExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief LED menu state class
|
||||
*
|
||||
*/
|
||||
class LedMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -288,6 +365,10 @@ class LedMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief LED task state class
|
||||
*
|
||||
*/
|
||||
class LedExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -298,6 +379,10 @@ class LedExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Infrared menu state class
|
||||
*
|
||||
*/
|
||||
class InfraredMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -308,6 +393,10 @@ class InfraredMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Infrared task state class
|
||||
*
|
||||
*/
|
||||
class InfraredExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -318,6 +407,10 @@ class InfraredExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Gyroscope menu state class
|
||||
*
|
||||
*/
|
||||
class GyroMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -328,6 +421,10 @@ class GyroMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Gyroscope task state class
|
||||
*
|
||||
*/
|
||||
class GyroExampleState : public State
|
||||
{
|
||||
public:
|
||||
@@ -338,6 +435,10 @@ class GyroExampleState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Bluetooth beacon and image upload menu state class
|
||||
*
|
||||
*/
|
||||
class BleMenuState : public State
|
||||
{
|
||||
public:
|
||||
@@ -348,6 +449,10 @@ class BleMenuState : public State
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Bluetooth beacon and image upload task state class
|
||||
*
|
||||
*/
|
||||
class BleExampleState : public State
|
||||
{
|
||||
public:
|
||||
|
||||
+151
-1
@@ -1,3 +1,19 @@
|
||||
/**
|
||||
* @file pictures.h
|
||||
* @author Odri Tomas (odri@aconno.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2019-03-27
|
||||
*
|
||||
* @copyright Copyright (c) 2019
|
||||
*/
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//-------------------------- CONSTANTS & MACROS -------------------------------
|
||||
|
||||
/**
|
||||
* @brief Intro 1 image data
|
||||
*
|
||||
*/
|
||||
const unsigned char intro1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -201,6 +217,10 @@ const unsigned char intro1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for introduction EPD image 2
|
||||
*
|
||||
*/
|
||||
const unsigned char intro2[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -404,6 +424,10 @@ const unsigned char intro2[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for introduction EPD image 3
|
||||
*
|
||||
*/
|
||||
const unsigned char intro3[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -607,6 +631,10 @@ const unsigned char intro3[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for joystick menu EPD image
|
||||
*
|
||||
*/
|
||||
const unsigned char joystick0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -810,6 +838,10 @@ const unsigned char joystick0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for sound menu EPD image
|
||||
*
|
||||
*/
|
||||
const unsigned char sound0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -1013,6 +1045,10 @@ const unsigned char sound0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for RGB Led menu EPD image
|
||||
*
|
||||
*/
|
||||
const unsigned char rgb0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -1216,6 +1252,10 @@ const unsigned char rgb0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for servo menu EPD image
|
||||
*
|
||||
*/
|
||||
const unsigned char servo0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -1419,6 +1459,10 @@ const unsigned char servo0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for LDR menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char ldr0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -1622,6 +1666,10 @@ const unsigned char ldr0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for potentiometer menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char pot0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -1825,6 +1873,10 @@ const unsigned char pot0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for temperature menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char temp0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -2028,6 +2080,10 @@ const unsigned char temp0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for relay menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char relay0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -2231,6 +2287,10 @@ const unsigned char relay0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for LED menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char led0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -2434,6 +2494,10 @@ const unsigned char led0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for Infrared LED menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char ir0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -2637,6 +2701,10 @@ const unsigned char ir0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for gyroscope menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char gyro0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -2840,6 +2908,10 @@ const unsigned char gyro0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for compass image
|
||||
*
|
||||
*/
|
||||
const unsigned char compass0[] = {
|
||||
0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80
|
||||
,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0
|
||||
@@ -3043,6 +3115,10 @@ const unsigned char compass0[] = {
|
||||
,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for joystick task image
|
||||
*
|
||||
*/
|
||||
const unsigned char joystick1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -3246,6 +3322,10 @@ const unsigned char joystick1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for sound task image
|
||||
*
|
||||
*/
|
||||
const unsigned char sound1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -3449,6 +3529,10 @@ const unsigned char sound1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for RGB task image
|
||||
*
|
||||
*/
|
||||
const unsigned char rgb1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -3652,6 +3736,10 @@ const unsigned char rgb1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data with servo instructions image
|
||||
*
|
||||
*/
|
||||
const unsigned char servo1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -3855,6 +3943,10 @@ const unsigned char servo1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for servo task image
|
||||
*
|
||||
*/
|
||||
const unsigned char servo2[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -4058,6 +4150,10 @@ const unsigned char servo2[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for LDR task
|
||||
*
|
||||
*/
|
||||
const unsigned char ldr1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -4261,6 +4357,10 @@ const unsigned char ldr1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for potentiometer task image
|
||||
*
|
||||
*/
|
||||
const unsigned char pot1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -4464,6 +4564,10 @@ const unsigned char pot1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for potentiometer clockwise spin
|
||||
*
|
||||
*/
|
||||
const unsigned char potCW[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -4667,6 +4771,10 @@ const unsigned char potCW[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for counter clockwise potentiometer spin
|
||||
*
|
||||
*/
|
||||
const unsigned char potCCW[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -4870,6 +4978,10 @@ const unsigned char potCCW[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for temperature task image
|
||||
*
|
||||
*/
|
||||
const unsigned char temp1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -5073,6 +5185,10 @@ const unsigned char temp1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for relay task image
|
||||
*
|
||||
*/
|
||||
const unsigned char relay1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -5276,6 +5392,10 @@ const unsigned char relay1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for LED task image
|
||||
*
|
||||
*/
|
||||
const unsigned char led1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -5479,6 +5599,10 @@ const unsigned char led1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for infrared task image
|
||||
*
|
||||
*/
|
||||
const unsigned char ir1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -5682,6 +5806,10 @@ const unsigned char ir1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for gyroscope task image
|
||||
*
|
||||
*/
|
||||
const unsigned char gyro1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -5885,6 +6013,11 @@ const unsigned char gyro1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for compass task
|
||||
* @note Currently not used
|
||||
*
|
||||
*/
|
||||
const unsigned char compass1[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -6088,6 +6221,10 @@ const unsigned char compass1[] = {
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for BLE advertisement menu image
|
||||
*
|
||||
*/
|
||||
const unsigned char BleBeacon[]={
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
|
||||
,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
|
||||
@@ -6291,6 +6428,10 @@ const unsigned char BleBeacon[]={
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for BLE task image
|
||||
*
|
||||
*/
|
||||
const unsigned char BleBeaconInMeni[]={
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -6494,6 +6635,10 @@ const unsigned char BleBeaconInMeni[]={
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for BLE EPD image menu
|
||||
*
|
||||
*/
|
||||
const unsigned char BleImgEPD[]={
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
|
||||
,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
|
||||
@@ -6697,6 +6842,10 @@ const unsigned char BleImgEPD[]={
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Data for BLE Image EPD task image
|
||||
*
|
||||
*/
|
||||
const unsigned char BleImgEPDInMeni[]={
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
@@ -6898,4 +7047,5 @@ const unsigned char BleImgEPDInMeni[]={
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
};
|
||||
//----------------------------PUBLIC PROTOTYPES -------------------------------
|
||||
+3
-3
@@ -6,9 +6,9 @@ SDK_ROOT := ../../nRF5_SDK_15.2.0
|
||||
PROJ_DIR := ../
|
||||
|
||||
# edit toolchain path
|
||||
# GNU_INSTALL_ROOT ?= /usr/local/gcc_arm/gcc-arm-none-eabi-8-2018-q4-major/bin/
|
||||
# GNU_VERSION ?= 8.2.1
|
||||
# GNU_PREFIX ?= arm-none-eabi
|
||||
GNU_INSTALL_ROOT ?= /usr/local/gcc_arm/gcc-arm-none-eabi-8-2018-q4-major/bin/
|
||||
GNU_VERSION ?= 8.2.1
|
||||
GNU_PREFIX ?= arm-none-eabi
|
||||
|
||||
|
||||
$(OUTPUT_DIRECTORY)/nrf52832_xxaa.out: \
|
||||
|
||||
+15523
-15585
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
* @copyright Copyright (c) 2019
|
||||
*
|
||||
*/
|
||||
|
||||
//------------------------------ INCLUDES -------------------------------------
|
||||
/** Communication headers */
|
||||
#include "aconnoSPI.h"
|
||||
#include "aconnoI2C.h"
|
||||
@@ -32,7 +32,8 @@
|
||||
#include "LSM9DS1.h"
|
||||
/** Servo header */
|
||||
#include "servo.h"
|
||||
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//-------------------------- CONSTANTS & MACROS -------------------------------
|
||||
/**
|
||||
* @defgroup PIN_GROUP
|
||||
* @note General IO pins
|
||||
@@ -117,5 +118,4 @@
|
||||
#define TWI_AG_ADDR (0x6A << 1) /**< Accelerometer/Gyroscope address */
|
||||
#define TWI_MAG_ADDR (0x1C << 1) /**< Magnetometer address */
|
||||
/** @} */
|
||||
|
||||
|
||||
//----------------------------PUBLIC PROTOTYPES -------------------------------
|
||||
|
||||
+11
-11
@@ -8,7 +8,7 @@
|
||||
* @copyright Copyright (c) 2019
|
||||
*
|
||||
*/
|
||||
|
||||
//------------------------------ INCLUDES -------------------------------------
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -29,7 +29,11 @@
|
||||
#include "aconnoBLE.h"
|
||||
#include "aconnoTasks.h"
|
||||
#include "aconnoBeeper.h"
|
||||
|
||||
//-------------------------------- MACROS -------------------------------------
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//--------------------- PRIVATE FUNCTION PROTOTYPES ---------------------------
|
||||
//----------------------- STATIC DATA & CONSTANTS -----------------------------
|
||||
//------------------------------ GLOBAL DATA ----------------------------------
|
||||
/**
|
||||
* @brief loger task handler
|
||||
*
|
||||
@@ -132,8 +136,11 @@ extern TaskHandle_t mLoggerThread;
|
||||
#endif
|
||||
SemaphoreHandle_t getInterruptSourceSemaphore;
|
||||
QueueHandle_t interruptSourceQueue;
|
||||
/**
|
||||
* @brief secondary interrupt Source queue meant to be used by tasks that
|
||||
* require interrupts from ioexpander
|
||||
*/
|
||||
QueueHandle_t interruptSourceQueueSecondary;
|
||||
TimerHandle_t intFlagTimer;
|
||||
SemaphoreHandle_t epdWriteMutex;
|
||||
|
||||
/**
|
||||
@@ -236,14 +243,6 @@ int main(void)
|
||||
NRF_LOG_ERROR("ERROR, not enough space available to create queues!");
|
||||
}
|
||||
|
||||
// TODO: This part of the code still needs to be done!
|
||||
// Note by Jurica
|
||||
//intFlagTimer = xTimerCreate("IoexpanderInterruptTimer",
|
||||
// IOEXP_INTERRUPT_TIMER_PERIOD,
|
||||
// pdFALSE, // do not loop infinitely
|
||||
// (void *) 0, // timer id
|
||||
// intFlagTimerCallback); //timer callback
|
||||
|
||||
// Initialize state machine
|
||||
pMenuState = new Intro1State(State::EPD_WRITE_METHOD::FULL);
|
||||
pMenuState->displayOnEpd();
|
||||
@@ -317,3 +316,4 @@ extern "C"
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+86
-137
@@ -8,12 +8,27 @@
|
||||
* @copyright Copyright (c) 2019
|
||||
*
|
||||
*/
|
||||
//------------------------------ INCLUDES -------------------------------------
|
||||
#include "aconnoTasks.h"
|
||||
#include <typeinfo>
|
||||
#include "timers.h"
|
||||
#include "aconnoBeeper.h"
|
||||
|
||||
//-------------------------------- MACROS -------------------------------------
|
||||
//----------------------------- DATA TYPES ------------------------------------
|
||||
//--------------------- PRIVATE FUNCTION PROTOTYPES ---------------------------
|
||||
//----------------------- STATIC DATA & CONSTANTS -----------------------------
|
||||
//------------------------------ GLOBAL DATA ----------------------------------
|
||||
extern TaskHandle_t menuStateMachineTask;
|
||||
extern SemaphoreHandle_t getInterruptSourceSemaphore;
|
||||
extern SemaphoreHandle_t epdWriteMutex;
|
||||
extern State *pMenuState;
|
||||
extern QueueHandle_t interruptSourceQueue;
|
||||
extern QueueHandle_t interruptSourceQueueSecondary;
|
||||
|
||||
uint8_t intSrcPin;
|
||||
IOEXP_INT_SOURCE intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
IOEXP_INT_SOURCE intSourceRecv = IOEXP_INT_SOURCE::NOTHING;
|
||||
IOEXP_INT_SOURCE intSourceRecvSecondary = IOEXP_INT_SOURCE::NOTHING;
|
||||
|
||||
extern AconnoSPI spi;
|
||||
extern AconnoI2C i2c;
|
||||
@@ -31,61 +46,20 @@ extern LDR light;
|
||||
extern Potentiometer pot;
|
||||
extern MCP9700 ambientTemperature;
|
||||
extern Servo servo;
|
||||
extern SemaphoreHandle_t getInterruptSourceSemaphore;
|
||||
extern SemaphoreHandle_t epdWriteMutex;
|
||||
extern State *pMenuState;
|
||||
extern QueueHandle_t interruptSourceQueue;
|
||||
IOEXP_INT_SOURCE intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
IOEXP_INT_SOURCE intSourceRecv = IOEXP_INT_SOURCE::NOTHING;
|
||||
IOEXP_INT_SOURCE intSourceRecvSecondary = IOEXP_INT_SOURCE::NOTHING;
|
||||
uint8_t intSrcPin;
|
||||
extern AconnoBeeper beeper;
|
||||
|
||||
extern bool gBleTaskSuspend;
|
||||
|
||||
/**
|
||||
* @brief A flag to help with initial drawing of the joystick example
|
||||
*
|
||||
*/
|
||||
extern uint8_t joyFlag;
|
||||
|
||||
/**
|
||||
* @brief A flag for initializing infrared task if reentered
|
||||
*
|
||||
*/
|
||||
extern uint8_t irFlag;
|
||||
|
||||
/**
|
||||
* @brief A flag for initializing LDR task if reentered
|
||||
*
|
||||
*/
|
||||
extern uint8_t ldrFlag;
|
||||
|
||||
/**
|
||||
* @brief A flag for initializing temperature task if reentered
|
||||
*
|
||||
*/
|
||||
extern uint8_t tempFlag;
|
||||
|
||||
/**
|
||||
* @brief secondary interrupt Source queue meant to be used by tasks that
|
||||
* require interrupts from ioexpander
|
||||
*/
|
||||
extern QueueHandle_t interruptSourceQueueSecondary;
|
||||
|
||||
/**
|
||||
* @brief Flag which is used to prevent interrupts that are sent by ioexpander
|
||||
* while a button is continuously pressed
|
||||
*/
|
||||
bool getInterruptSourceFlag = true;
|
||||
|
||||
extern TimerHandle_t intFlagTimer;
|
||||
|
||||
extern uint8_t gJoyFlag;
|
||||
extern uint8_t gIrFlag;
|
||||
extern uint8_t gLdrFlag;
|
||||
extern uint8_t gTempFlag;
|
||||
/**< Definition of Logger thread. */
|
||||
#if NRF_LOG_ENABLED
|
||||
TaskHandle_t mLoggerThread;
|
||||
void loggerThread(void *arg);
|
||||
#endif
|
||||
|
||||
//--------------------- PUBLIC FUNCTIONS AND OBJECTS --------------------------
|
||||
void logTaskFunction(void *arg)
|
||||
{
|
||||
#if NRF_LOG_ENABLED
|
||||
@@ -102,61 +76,35 @@ void logTaskFunction(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
void interruptCallback()
|
||||
{
|
||||
// resume task to get button
|
||||
xSemaphoreGiveFromISR(getInterruptSourceSemaphore, NULL);
|
||||
}
|
||||
|
||||
void getInterruptSourceFunction(void *arg)
|
||||
{
|
||||
//int i;
|
||||
while(1)
|
||||
{
|
||||
if(xSemaphoreTake(getInterruptSourceSemaphore, portMAX_DELAY) == pdTRUE)
|
||||
{
|
||||
NRF_LOG_INFO("I'm in interrupt");
|
||||
|
||||
expdr.interruptPinDisable();
|
||||
//i = 0;
|
||||
|
||||
uint8_t intSrcPin = expdr.getLastInterruptPin();
|
||||
NRF_LOG_INFO("Register state %d", intSrcPin);
|
||||
//if(expdr.readGPIOBit(intSrcPin))
|
||||
//{
|
||||
// last interrupt reads nothing pressed
|
||||
//intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
//getInterruptSourceFlag = true;
|
||||
//}
|
||||
// only send a message if this is the first interrupt after a while
|
||||
//else if(getInterruptSourceFlag)
|
||||
{
|
||||
NRF_LOG_INFO("I'm before queue");
|
||||
getInterruptSourceFlag=false;
|
||||
intSourceSend = (IOEXP_INT_SOURCE)intSrcPin;
|
||||
|
||||
NRF_LOG_INFO("I'm before queue");
|
||||
intSourceSend = (IOEXP_INT_SOURCE)intSrcPin;
|
||||
|
||||
xQueueSendToBack(interruptSourceQueue,
|
||||
(void *) &intSourceSend,
|
||||
((TickType_t)TICKS_TO_BLOCK_DEFAULT) != pdPASS);
|
||||
|
||||
xQueueSendToBack(interruptSourceQueueSecondary,
|
||||
(void *) &intSourceSend,
|
||||
((TickType_t)TICKS_TO_BLOCK_DEFAULT) != pdPASS);
|
||||
// TODO: This part of the code still needs to be done!
|
||||
//xTimerReset(intFlagTimer, TICKS_TO_BLOCK_DEFAULT);
|
||||
}
|
||||
// give other code a chance to execute since we have a higher
|
||||
// priority
|
||||
xQueueSendToBack(interruptSourceQueue,
|
||||
(void *) &intSourceSend,
|
||||
((TickType_t)TICKS_TO_BLOCK_DEFAULT) != pdPASS);
|
||||
|
||||
xQueueSendToBack(interruptSourceQueueSecondary,
|
||||
(void *) &intSourceSend,
|
||||
((TickType_t)TICKS_TO_BLOCK_DEFAULT) != pdPASS);
|
||||
|
||||
//wait till the it stops being pressed
|
||||
while(expdr.readGPIOBit(intSrcPin) == 0)
|
||||
{
|
||||
//i++;
|
||||
//waitMs(10);
|
||||
}
|
||||
|
||||
}
|
||||
expdr.interruptPinEnable();
|
||||
expdr.readRegister(MCP23017_INTCAP);
|
||||
|
||||
//todo: Consider enclosing epd writing in a critical section
|
||||
// as is done in the joystick example
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,21 +151,20 @@ void ldrFunction(void *arg)
|
||||
vTaskSuspend(NULL);
|
||||
|
||||
aconnoSensorData_t data;
|
||||
//Leave this zero so the next if statement must be executed at the begining
|
||||
float voltage = 0;
|
||||
uint16_t x_coord;
|
||||
uint16_t y_coord;
|
||||
ldrFlag = 0;
|
||||
gLdrFlag = 0;
|
||||
|
||||
adc.calibrate();
|
||||
adc.updateData();//to clear the ADC buffer
|
||||
vTaskDelay(25); // Small delay required by adc to calibrate
|
||||
|
||||
while(1)
|
||||
{
|
||||
light.updateData(&data);
|
||||
if(data.light < voltage - 0.05f || data.light > voltage + 0.05f || ldrFlag == 1 )
|
||||
if(data.light < voltage - 0.05f || data.light > voltage + 0.05f || gLdrFlag == 1 )
|
||||
{
|
||||
ldrFlag = 0;
|
||||
gLdrFlag = 0;
|
||||
voltage = data.light;
|
||||
if (voltage<0.10f) { x_coord = 40; y_coord = 135; }
|
||||
else if(voltage<0.20f) { x_coord = 43; y_coord = 130; }
|
||||
@@ -249,7 +196,7 @@ void potentiometerFunction(void *arg)
|
||||
static float voltage;
|
||||
|
||||
adc.calibrate();
|
||||
adc.updateData(); //to clear the ADC buffer
|
||||
vTaskDelay(25); // Small delay required by adc to calibrate
|
||||
pot.updateData(&data);
|
||||
voltage = data.voltage;
|
||||
|
||||
@@ -280,20 +227,20 @@ void temperatureFunction(void *arg)
|
||||
aconnoSensorData_t data;
|
||||
float temperature = 0;
|
||||
char buffer[10];
|
||||
tempFlag = 0;
|
||||
gTempFlag = 0;
|
||||
adc.calibrate();
|
||||
adc.updateData(); //to clear the ADC buffer
|
||||
vTaskDelay(25); // Small delay required by adc to calibrate
|
||||
|
||||
while(1)
|
||||
{
|
||||
ambientTemperature.updateData(&data);
|
||||
NRF_LOG_INFO("Flag value is %d", tempFlag);
|
||||
NRF_LOG_INFO("Flag value is %d", gTempFlag);
|
||||
|
||||
if(data.temperature > temperature + 0.5f ||
|
||||
data.temperature < temperature - 0.5f || tempFlag == 1)
|
||||
data.temperature < temperature - 0.5f || gTempFlag == 1)
|
||||
{
|
||||
xSemaphoreTake(epdWriteMutex, portMAX_DELAY);
|
||||
tempFlag = 0;
|
||||
gTempFlag = 0;
|
||||
// Erase previous data from the buffer
|
||||
epd.writeString(buffer,110,100,1);
|
||||
|
||||
@@ -487,7 +434,7 @@ void imageUpdate(uint8_t const *data, size_t dataLen)
|
||||
|
||||
void infraredFunction(void *arg)
|
||||
{
|
||||
irFlag = 0;
|
||||
gIrFlag = 0;
|
||||
vTaskSuspend(NULL);
|
||||
uint8_t SOS[] = {
|
||||
0, 1, 0, 1, 0, 1, // S
|
||||
@@ -500,10 +447,10 @@ void infraredFunction(void *arg)
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(irFlag == 1)
|
||||
if(gIrFlag == 1)
|
||||
{
|
||||
irIndex = 0;
|
||||
irFlag = 0;
|
||||
gIrFlag = 0;
|
||||
}
|
||||
|
||||
if(SOS[irIndex] == 0)
|
||||
@@ -606,10 +553,10 @@ void joystickTaskFunction(void *arg)
|
||||
&(intSourceRecvSecondary),
|
||||
(TickType_t) 10))
|
||||
{
|
||||
if (joyFlag)
|
||||
if (gJoyFlag)
|
||||
{
|
||||
xSemaphoreTake(epdWriteMutex, portMAX_DELAY);
|
||||
joyFlag = 0;
|
||||
gJoyFlag = 0;
|
||||
epd.drawImage(joystick1);
|
||||
epd.fillCircle(xCoordCenter,
|
||||
yCoordCenter,
|
||||
@@ -808,46 +755,42 @@ void servoFunction(void *arg)
|
||||
|
||||
while(1)
|
||||
{
|
||||
//if(xQueueReceive(interruptSourceQueueSecondary,
|
||||
//&(intSourceRecvSecondary),
|
||||
//(TickType_t) 10))
|
||||
{
|
||||
|
||||
switch(intSourceSend)
|
||||
switch(intSourceSend)
|
||||
{
|
||||
case IOEXP_INT_SOURCE::JOY_LEFT:
|
||||
{
|
||||
case IOEXP_INT_SOURCE::JOY_LEFT:
|
||||
if(servo.read() > 0.1)
|
||||
{
|
||||
if(servo.read() > 0.1)
|
||||
{
|
||||
intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
servo.enable();
|
||||
percentage = servo.read() - 0.1f;
|
||||
servo.write(percentage);
|
||||
waitMs(SERVO_DELAY_MS);
|
||||
servo.disable();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IOEXP_INT_SOURCE::JOY_RIGHT:
|
||||
{
|
||||
if(servo.read() < 0.90)
|
||||
{
|
||||
intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
servo.enable();
|
||||
percentage = servo.read() + 0.1f;
|
||||
servo.write(percentage);
|
||||
waitMs(SERVO_DELAY_MS);
|
||||
servo.disable();
|
||||
}
|
||||
break;
|
||||
intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
servo.enable();
|
||||
percentage = servo.read() - 0.1f;
|
||||
servo.write(percentage);
|
||||
waitMs(SERVO_DELAY_MS);
|
||||
servo.disable();
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case IOEXP_INT_SOURCE::JOY_RIGHT:
|
||||
{
|
||||
if(servo.read() < 0.90)
|
||||
{
|
||||
break;
|
||||
intSourceSend = IOEXP_INT_SOURCE::NOTHING;
|
||||
servo.enable();
|
||||
percentage = servo.read() + 0.1f;
|
||||
servo.write(percentage);
|
||||
waitMs(SERVO_DELAY_MS);
|
||||
servo.disable();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
vTaskDelay(EXAMPLE_DELAY_MS);
|
||||
}
|
||||
vTaskDelay(EXAMPLE_DELAY_MS);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -858,6 +801,12 @@ void soundFunction(void *arg)
|
||||
vTaskSuspend(NULL);
|
||||
char *song = "Greensleaves:d=4,o=5,b=140:g,2a#,c6,d.6,8d#6,d6,2c6,a,f.,8g,a,2a#,g,g.,8f#,g,2a,f#,2d,g,2a#,c6,d.6,8d#6,d6,2c6,a,f.,8g,a,a#.,8a,g,f#.,8e,f#,2g";
|
||||
beeper.playRttl(song);
|
||||
//vTaskDelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------- INTERRUPT HANDLERS ------------------------------
|
||||
void interruptCallback()
|
||||
{
|
||||
// resume task to get button
|
||||
xSemaphoreGiveFromISR(getInterruptSourceSemaphore, NULL);
|
||||
}
|
||||
+7
-10
@@ -8,10 +8,9 @@
|
||||
* @copyright Copyright (c) 2019
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __ACONNO_TASKS_H__
|
||||
#define __ACONNO_TASKS_H__
|
||||
|
||||
//-------------------------- CONSTANTS & MACROS -------------------------------
|
||||
#include "FreeRTOS.h"
|
||||
#include "aconnoBLE.h"
|
||||
#include "aconnoConfig.h"
|
||||
@@ -21,7 +20,6 @@
|
||||
#include "acd52832Bsp.h"
|
||||
#include "pictures.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "nrf_log.h"
|
||||
#include "nrf_log_ctrl.h"
|
||||
#include "nrf_log_default_backends.h"
|
||||
@@ -37,7 +35,7 @@
|
||||
#define GET_INTERRUPT_DELAY_MS (1)
|
||||
#define SERVO_DELAY_MS (100)
|
||||
#define POT_DELAY_MS (500)
|
||||
|
||||
//----------------------------PUBLIC PROTOTYPES -------------------------------
|
||||
/**
|
||||
* @brief Function logger
|
||||
*
|
||||
@@ -75,12 +73,6 @@ void jumperTaskFunction(void *arg);
|
||||
*/
|
||||
void joystickTaskFunction(void *arg);
|
||||
|
||||
/**
|
||||
* @brief A callback for mainMenu button joystick press
|
||||
*
|
||||
*/
|
||||
void interruptCallback();
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
@@ -168,5 +160,10 @@ void servoFunction(void *arg);
|
||||
*/
|
||||
void soundFunction(void *arg);
|
||||
|
||||
/**
|
||||
* @brief A callback for mainMenu button joystick press
|
||||
*
|
||||
*/
|
||||
void interruptCallback();
|
||||
|
||||
#endif // __ACONNO_TASKS_H__
|
||||
Reference in New Issue
Block a user