src/main.cpp

changeset 48
fc55f6eaa8bc
parent 44
b3c3d54d2c7c
child 49
c146d19101a3
--- a/src/main.cpp	Sat Nov 07 19:23:21 2020 +0100
+++ b/src/main.cpp	Sat Nov 07 19:24:11 2020 +0100
@@ -19,6 +19,10 @@
 
 #include "platform/CircularBuffer.h"
 
+// cannot make it work...
+// #include <USBSerial.h>
+// USBSerial usbcdc(false);
+
 
 Display *dsp;
 volatile bool splashscreen;
@@ -155,25 +159,9 @@
 
 
 void setup() {
-#if defined(HAVE_PC)
-/*
-  #if  defined(TARGET_HP34970_FP_F303RD)
-  pc.init();
-  pc.connect();
-  #endif
-*/
-#endif
-
   printf("\n\nSETUP\n");
   printf("  System Core Clock = %ld MHZ\r\n", SystemCoreClock/1000000);
 
-  /*
-    #if defined(HAS_LED)
-    printf("Attaching Led 1: %d\n", LED1);
-    blinker.attach(callback(timeout_h), 0.5f);
-    #endif
-  */
-
   hp = NULL;
 #if defined(TARGET_NUCLEO_F446RE)
   printf("Serial communication pins\r\n");
@@ -181,21 +169,21 @@
   printf("     USBTX=%d\r\n", USBTX);
 #endif
 #if defined(TARGET_HP34970_FP_F303RD)
-  printf("Serial communication via USB\r\n");
+  printf("Serial communication via UART4\r\n");
 #endif
 
   printf("Setup HP communication pins\r\n");
-  printf("     HP_RX=%d\r\n", HP_RX);
+  //printf("     HP_RX=%d\r\n", HP_RX);
   DigitalIn(HP_RX).mode(PullDown);
-  printf("     HP_TX=%d\r\n", HP_TX);
+  //printf("     HP_TX=%d\r\n", HP_TX);
   DigitalOut(HP_TX).write(1);
-  printf("     HP_RST=%d\r\n", HP_RST);
+  //printf("     HP_RST=%d\r\n", HP_RST);
   DigitalIn(HP_RST).mode(PullDown);
 
   printf("  setup QEI pins\r\n");
-  printf("     ENC1=%d\r\n", KP_ENC1);
+  //printf("     ENC1=%d\r\n", KP_ENC1);
   DigitalIn(KP_ENC1).mode(PullDown);
-  printf("     ENC2=%d\r\n", KP_ENC2);
+  //printf("     ENC2=%d\r\n", KP_ENC2);
   DigitalIn(KP_ENC2).mode(PullDown);
   qenc.attach(&qei_cb);
 
@@ -212,16 +200,17 @@
 
   printf("Setup OLED display\r\n");
   // init the LCD
+  /*
   printf("     DSP_MOSI=%d\r\n", DSP_MOSI);
   printf("     DSP_MISO=%d\r\n", DSP_MISO);
   printf("     DSP_SCLK=%d\r\n", DSP_SCLK);
   printf("     DSP_CS=%d\r\n", DSP_CS);
   printf("     DSP_RST=%d\r\n", DSP_RST);
   printf("     DSP_DC=%d\r\n", DSP_DC);
+  */
   dsp = new Display(20000000, DSP_MOSI, DSP_MISO, DSP_SCLK, DSP_CS,
             DSP_RST, DSP_DC, "SSD1322");
 
-  //curcmd = 0xFF;
   curchar = 0;
   nchars = 0;
 
@@ -236,7 +225,7 @@
   // dsp_refresh.attach(callback(dsp, &Display::copy_to_lcd), 50ms);
   tdsp.start(&refresh_display);
 
-  printf("Attaching timers\r\n");
+  printf("Attach timers\r\n");
   splashscreen = true;
   splashscreen_timer.attach(callback(&end_splashscreen), 2ms);
   rst.fall(&reset_irq);

mercurial