Get dual build working
This commit is contained in:
		
							parent
							
								
									33714fcf17
								
							
						
					
					
						commit
						473efc8003
					
				@ -12,8 +12,7 @@ pkgs.stdenv.mkDerivation rec {
 | 
				
			|||||||
  '';
 | 
					  '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  installPhase = ''
 | 
					  installPhase = ''
 | 
				
			||||||
    mkdir -p $out/bin
 | 
					    cp -r .pio/build/* $out/
 | 
				
			||||||
    cp .pio/build/*/firmware.bin $out/bin/
 | 
					 | 
				
			||||||
  '';
 | 
					  '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  __noChroot = true;
 | 
					  __noChroot = true;
 | 
				
			||||||
 | 
				
			|||||||
@ -30,6 +30,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <Arduino.h>
 | 
					#include <Arduino.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define BUSY_PIN 26
 | 
				
			||||||
 | 
					#define RST_PIN 27
 | 
				
			||||||
 | 
					#define DC_PIN 15
 | 
				
			||||||
 | 
					#define CS_PIN 14
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class EpdIf
 | 
					class EpdIf
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
 | 
				
			|||||||
@ -11,11 +11,11 @@
 | 
				
			|||||||
[platformio]
 | 
					[platformio]
 | 
				
			||||||
lib_dir = lib
 | 
					lib_dir = lib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
; [env:tinypico-color]
 | 
					[env:tinypico-color]
 | 
				
			||||||
; platform = espressif32
 | 
					platform = espressif32
 | 
				
			||||||
; board = tinypico
 | 
					board = tinypico
 | 
				
			||||||
; framework = arduino
 | 
					framework = arduino
 | 
				
			||||||
; build_flags = -DEPD7IN3F
 | 
					build_flags = -DEPD7IN3F
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[env:tinypico-16gray]
 | 
					[env:tinypico-16gray]
 | 
				
			||||||
platform = espressif32
 | 
					platform = espressif32
 | 
				
			||||||
 | 
				
			|||||||
@ -2,14 +2,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#ifdef EPD7IN3F
 | 
					#ifdef EPD7IN3F
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BUSY_PIN 26
 | 
					 | 
				
			||||||
#define RST_PIN 27
 | 
					 | 
				
			||||||
#define DC_PIN 15
 | 
					 | 
				
			||||||
#define CS_PIN 14
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "epd7in3f.h"
 | 
					#include "epd7in3f.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char* einkDisplayProperties = R"json(
 | 
					const char *einkDisplayProperties = R"json(
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "width": 800,
 | 
					  "width": 800,
 | 
				
			||||||
  "height": 480,
 | 
					  "height": 480,
 | 
				
			||||||
@ -48,7 +43,8 @@ const char* einkDisplayProperties = R"json(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Epd epd;
 | 
					Epd epd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void initDisplay() {
 | 
					void initDisplay()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
  if (epd.Init() != 0)
 | 
					  if (epd.Init() != 0)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    Serial.print("e-Paper init failed");
 | 
					    Serial.print("e-Paper init failed");
 | 
				
			||||||
@ -56,7 +52,8 @@ void initDisplay() {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void drawImage(uint8_t* image) {
 | 
					void drawImage(uint8_t *image)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
  // Serial.print("Wake up display\n");
 | 
					  // Serial.print("Wake up display\n");
 | 
				
			||||||
  // epd.Reset();
 | 
					  // epd.Reset();
 | 
				
			||||||
  // Serial.print("Clear display\n");
 | 
					  // Serial.print("Clear display\n");
 | 
				
			||||||
@ -82,7 +79,7 @@ void drawImage(uint8_t* image) {
 | 
				
			|||||||
#define DISPLAY_WIDTH 1872
 | 
					#define DISPLAY_WIDTH 1872
 | 
				
			||||||
#define DISPLAY_HEIGHT 1404
 | 
					#define DISPLAY_HEIGHT 1404
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char* einkDisplayProperties = R"json(
 | 
					const char *einkDisplayProperties = R"json(
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "width": 1872,
 | 
					  "width": 1872,
 | 
				
			||||||
  "height": 1404,
 | 
					  "height": 1404,
 | 
				
			||||||
@ -156,19 +153,21 @@ const char* einkDisplayProperties = R"json(
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
)json";
 | 
					)json";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void initDisplay() {
 | 
					void initDisplay()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
  IT8951_Init();
 | 
					  IT8951_Init();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void drawImage(uint8_t* image) {
 | 
					void drawImage(uint8_t *image)
 | 
				
			||||||
    gpFrameBuf = image;
 | 
					{
 | 
				
			||||||
    Serial.println("Sending image");
 | 
					  gpFrameBuf = image;
 | 
				
			||||||
    IT8951_BMP_Example(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT);
 | 
					  Serial.println("Sending image");
 | 
				
			||||||
    Serial.println("Displaying image");
 | 
					  IT8951_BMP_Example(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT);
 | 
				
			||||||
    IT8951DisplayArea(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, 2);
 | 
					  Serial.println("Displaying image");
 | 
				
			||||||
    Serial.println("Waiting for display ...");
 | 
					  IT8951DisplayArea(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, 2);
 | 
				
			||||||
    LCDWaitForReady();
 | 
					  Serial.println("Waiting for display ...");
 | 
				
			||||||
    Serial.println("done");
 | 
					  LCDWaitForReady();
 | 
				
			||||||
 | 
					  Serial.println("done");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user