Added environment for @mickdermack

This commit is contained in:
2020-05-19 23:45:53 +02:00
parent ba2acabc01
commit ddfe0d34a1
7 changed files with 55 additions and 117 deletions

5
bobbycar_noota.csv Normal file
View File

@ -0,0 +1,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x250000,
spiffs, data, spiffs, 0x260000, 0x250000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x250000
5 spiffs data spiffs 0x260000 0x250000

View File

@ -151,3 +151,53 @@ build_flags =
-DDEFAULT_GASMAX=4095 -DDEFAULT_GASMAX=4095
-DDEFAULT_BREMSMIN=0 -DDEFAULT_BREMSMIN=0
-DDEFAULT_BREMSMAX=4095 -DDEFAULT_BREMSMAX=4095
[env:mickdermack]
platform = ${common_env_data.platform}
board = ${common_env_data.board}
framework = ${common_env_data.framework}
board_build.partitions = bobbycar_noota.csv
lib_deps = ${common_env_data.lib_deps}
lib_compat_mode = ${common_env_data.lib_compat_mode}
build_unflags = ${common_env_data.build_unflags}
upload_port = /dev/ttyUSB*
upload_speed = 921600
build_flags =
${common_env_data.build_flags}
-DUSER_SETUP_LOADED=1
-DRPI_DISPLAY_TYPE
-DILI9486_DRIVER
; TODO: TFT_MISO (touch MISO?)
-DTFT_MISO=17
-DTFT_MOSI=4
-DTFT_SCLK=21
-DTFT_CS=32
-DTFT_DC=19
-DTFT_RST=27
; TODO: TOUCH_CS
-DTOUCH_CS=22
-DSPI_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000
-DPINS_RX1=18
-DPINS_TX1=19
-DPINS_RX2=23
-DPINS_TX2=34
-DPINS_GAS=35
-DPINS_BREMS=33
; -DFEATURE_3WIRESW
; -DPINS_3WIRESW_OUT=17
; -DPINS_3WIRESW_IN1=4
; -DPINS_3WIRESW_IN2=16
; -DFEATURE_ROTARY
; -DPINS_ROTARY_CLK=4
; -DPINS_ROTARY_DT=16
; -DPINS_ROTARY_SW=17
${default_limits_common_env_data.build_flags}
-DDEFAULT_GASMIN=0
-DDEFAULT_GASMAX=4095
-DDEFAULT_BREMSMIN=0
-DDEFAULT_BREMSMAX=4095

View File

@ -1,94 +0,0 @@
#pragma once
#include "demodisplay.h"
#include "actions/switchscreenaction.h"
#include "globals.h"
#include "utils.h"
#include "texts.h"
namespace {
class DemosMenu;
}
namespace {
class MatrixDisplay : public DemoDisplay, public SwitchScreenAction<DemosMenu>
{
using Base = DemoDisplay;
public:
void initScreen() override;
void redraw() override;
void stop() override;
private:
int scroll_slow(int lines, int wait);
static constexpr auto TEXT_HEIGHT = 8; // Height of text to be printed and scrolled
static constexpr auto BOT_FIXED_AREA = 0; // Number of lines in bottom fixed area (lines counted from bottom of screen)
static constexpr auto TOP_FIXED_AREA = 0; // Number of lines in top fixed area (lines counted from top of screen)
uint16_t yStart = TOP_FIXED_AREA;
uint16_t yArea = 320 - TOP_FIXED_AREA - BOT_FIXED_AREA;
uint16_t yDraw = 320 - BOT_FIXED_AREA - TEXT_HEIGHT;
byte pos[42];
uint16_t xPos = 0;
};
void MatrixDisplay::initScreen()
{
tft.setRotation(2);
tft.fillScreen(TFT_BLACK);
setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
// First fill the screen with random streaks of characters
for (int j = 0; j < 600; j += TEXT_HEIGHT)
{
for (int i = 0; i < 40; i++)
{
if (pos[i] > 20)
pos[i] -= 3; // Rapid fade initially brightness values
if (pos[i] > 0)
pos[i] -= 1; // Slow fade later
if ((random(20) == 1) && (j<400))
pos[i] = 63; // ~1 in 20 probability of a new character
tft.setTextColor(pos[i] << 5, TFT_BLACK); // Set the green character brightness
if (pos[i] == 63)
tft.setTextColor(TFT_WHITE, TFT_BLACK); // Draw white character
xPos += tft.drawChar(random(32, 128), xPos, yDraw, 1); // Draw the character
}
yDraw = scroll_slow(TEXT_HEIGHT, 14); // Scroll, 14ms per pixel line
xPos = 0;
}
}
void MatrixDisplay::redraw()
{
yDraw = scroll_slow(320,5);
}
void MatrixDisplay::stop()
{
scrollAddress(0);
tft.setRotation(0);
}
int MatrixDisplay::scroll_slow(int lines, int wait)
{
int yTemp = yStart;
for (int i = 0; i < lines; i++) {
yStart++;
if (yStart == 320 - BOT_FIXED_AREA)
yStart = TOP_FIXED_AREA;
scrollAddress(yStart);
delay(wait);
}
return yTemp;
}
}

View File

@ -13,7 +13,6 @@ class StarfieldDisplay;
class PingPongDisplay; class PingPongDisplay;
class SpiroDisplay; class SpiroDisplay;
class GameOfLifeDisplay; class GameOfLifeDisplay;
class MatrixDisplay;
class MainMenu; class MainMenu;
} }
@ -26,7 +25,6 @@ class DemosMenu :
makeComponent<MenuItem, StaticText<TEXT_PINGPONG>, SwitchScreenAction<PingPongDisplay>>, makeComponent<MenuItem, StaticText<TEXT_PINGPONG>, SwitchScreenAction<PingPongDisplay>>,
makeComponent<MenuItem, StaticText<TEXT_SPIRO>, SwitchScreenAction<SpiroDisplay>>, makeComponent<MenuItem, StaticText<TEXT_SPIRO>, SwitchScreenAction<SpiroDisplay>>,
makeComponent<MenuItem, StaticText<TEXT_GAMEOFLIFE>, SwitchScreenAction<GameOfLifeDisplay>>, makeComponent<MenuItem, StaticText<TEXT_GAMEOFLIFE>, SwitchScreenAction<GameOfLifeDisplay>>,
makeComponent<MenuItem, StaticText<TEXT_MATRIX>, SwitchScreenAction<MatrixDisplay>>,
makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>> makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>
> >
{}; {};

View File

@ -35,7 +35,6 @@
#include "displays/dualgraphdisplay.h" #include "displays/dualgraphdisplay.h"
#include "displays/gameoflifedisplay.h" #include "displays/gameoflifedisplay.h"
#include "displays/lockscreen.h" #include "displays/lockscreen.h"
#include "displays/matrixdisplay.h"
#include "displays/metersdisplay.h" #include "displays/metersdisplay.h"
#include "displays/pingpongdisplay.h" #include "displays/pingpongdisplay.h"
#include "displays/poweroffdisplay.h" #include "displays/poweroffdisplay.h"
@ -97,7 +96,6 @@ union X {
DualGraphDisplay dualGraphDisplay; DualGraphDisplay dualGraphDisplay;
GameOfLifeDisplay gameOfLifeDisplay; GameOfLifeDisplay gameOfLifeDisplay;
Lockscreen lockScreen; Lockscreen lockScreen;
MatrixDisplay matrixDisplay;
MetersDisplay metersDisplay; MetersDisplay metersDisplay;
PingPongDisplay pingPongDisplay; PingPongDisplay pingPongDisplay;
PoweroffDisplay poweroffDisplay; PoweroffDisplay poweroffDisplay;
@ -212,7 +210,6 @@ template<> decltype(displays.calibrateDisplay) &
template<> decltype(displays.dualGraphDisplay) &getRefByType<decltype(displays.dualGraphDisplay)>() { return displays.dualGraphDisplay; } template<> decltype(displays.dualGraphDisplay) &getRefByType<decltype(displays.dualGraphDisplay)>() { return displays.dualGraphDisplay; }
template<> decltype(displays.gameOfLifeDisplay) &getRefByType<decltype(displays.gameOfLifeDisplay)>() { return displays.gameOfLifeDisplay; } template<> decltype(displays.gameOfLifeDisplay) &getRefByType<decltype(displays.gameOfLifeDisplay)>() { return displays.gameOfLifeDisplay; }
template<> decltype(displays.lockScreen) &getRefByType<decltype(displays.lockScreen)>() { return displays.lockScreen; } template<> decltype(displays.lockScreen) &getRefByType<decltype(displays.lockScreen)>() { return displays.lockScreen; }
template<> decltype(displays.matrixDisplay) &getRefByType<decltype(displays.matrixDisplay)>() { return displays.matrixDisplay; }
template<> decltype(displays.metersDisplay) &getRefByType<decltype(displays.metersDisplay)>() { return displays.metersDisplay; } template<> decltype(displays.metersDisplay) &getRefByType<decltype(displays.metersDisplay)>() { return displays.metersDisplay; }
template<> decltype(displays.pingPongDisplay) &getRefByType<decltype(displays.pingPongDisplay)>() { return displays.pingPongDisplay; } template<> decltype(displays.pingPongDisplay) &getRefByType<decltype(displays.pingPongDisplay)>() { return displays.pingPongDisplay; }
template<> decltype(displays.poweroffDisplay) &getRefByType<decltype(displays.poweroffDisplay)>() { return displays.poweroffDisplay; } template<> decltype(displays.poweroffDisplay) &getRefByType<decltype(displays.poweroffDisplay)>() { return displays.poweroffDisplay; }

View File

@ -100,8 +100,6 @@ constexpr char TEXT_STARFIELD[] = "Starfield";
constexpr char TEXT_PINGPONG[] = "PingPong"; constexpr char TEXT_PINGPONG[] = "PingPong";
constexpr char TEXT_SPIRO[] = "Spiro"; constexpr char TEXT_SPIRO[] = "Spiro";
constexpr char TEXT_GAMEOFLIFE[] = "GameOfLife"; constexpr char TEXT_GAMEOFLIFE[] = "GameOfLife";
constexpr char TEXT_METERS[] = "Meters";
constexpr char TEXT_MATRIX[] = "Matrix";
//constexpr char TEXT_BACK[] = "Back"; //constexpr char TEXT_BACK[] = "Back";
//BuzzerMenu //BuzzerMenu

View File

@ -248,22 +248,6 @@ void sendCommands()
template<typename T, typename... Args> template<typename T, typename... Args>
void switchScreen(Args&&... args); void switchScreen(Args&&... args);
void setupScrollArea(uint16_t TFA, uint16_t BFA) {
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(TFA >> 8);
tft.writedata(TFA);
tft.writedata((320 - TFA - BFA) >> 8);
tft.writedata(320 - TFA - BFA);
tft.writedata(BFA >> 8);
tft.writedata(BFA);
}
void scrollAddress(uint16_t VSP) {
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling start address
tft.writedata(VSP >> 8);
tft.writedata(VSP);
}
void updateSwapFrontBack() void updateSwapFrontBack()
{ {
front.serial = settings.hardware.swapFrontBack ? Serial2 : Serial1; front.serial = settings.hardware.swapFrontBack ? Serial2 : Serial1;