Browse Source

Clean compile on rPi

James Bowman 5 years ago
parent
commit
1287d6905e
3 changed files with 5 additions and 5 deletions
  1. 3 3
      examples/cube.ino
  2. 1 1
      pc/Makefile
  3. 1 1
      transports/tr-spidriver.h

+ 3 - 3
examples/cube.ino

@@ -24,7 +24,7 @@ static const PROGMEM int8_t CUBE_vertices[] = {
 
 // each line is a face: count, normal, 4 vertices
 
-static const PROGMEM uint8_t CUBE_faces[] = {
+static const PROGMEM int8_t CUBE_faces[] = {
   4, 0,0,127,   0, 1, 3, 2,
   4, 0,0,-127,  6, 7, 5, 4,
 
@@ -34,7 +34,7 @@ static const PROGMEM uint8_t CUBE_faces[] = {
   4, 127,0,0,   0, 2, 6, 4,
   4, -127,0,0,  3, 1, 5, 7,
 
-  0xff
+  -1
 };
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -199,7 +199,7 @@ static void quad(int x1, int y1,
 void draw_faces(int dir)
 {
   int R = 15;
-  const PROGMEM uint8_t *p = CUBE_faces; 
+  const PROGMEM int8_t *p = CUBE_faces; 
   byte n;
 
   GD.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA);

+ 1 - 1
pc/Makefile

@@ -16,7 +16,7 @@ clean:
 OPTS=
 # OPTS=-g -Wall -Wno-unused-function
 
-build/%: examples/%.ino GD2.cpp GD2.h transports/* pc/Makefile
+build/%: examples/%.ino GD2.cpp GD2.h transports/* pc/*
 	g++ $(OPTS) -o $@ -g  -D TEENSYDUINO=1 -DARDUINO_ARCH_STM32L4=1 -DSPIDRIVER=1 \
           -I pc/ -I converted-assets/ -I $D -x c++ $< pc/main.cpp pc/spidriver.cpp GD2.cpp
 

+ 1 - 1
transports/tr-spidriver.h

@@ -144,7 +144,7 @@ public:
   }
 
   unsigned int __rd16(uint32_t a) {
-    char buf[6] = {ADDR3(a), -1, -1, -1};
+    char buf[6] = {ADDR3(a), (char)-1, (char)-1, (char)-1};
     spi_sel(&sd);
     spi_writeread(&sd, sizeof(buf), buf);
     spi_unsel(&sd);