Explorar o código

Adjusted logging levels, prepared thread changes

Philipp Hinz %!s(int64=8) %!d(string=hai) anos
pai
achega
ff21c06026
Modificáronse 5 ficheiros con 12 adicións e 17 borrados
  1. 3 3
      CoffeeCode/README.md
  2. 1 1
      CoffeeCode/buildno
  3. 3 2
      CoffeeCode/global.h
  4. 3 3
      CoffeeCode/logger.h
  5. 2 8
      CoffeeCode/main.cpp

+ 3 - 3
CoffeeCode/README.md

@@ -6,10 +6,10 @@ Requirements: wiringpi pthread
 
 Debug levels:
  1. Basic debugging, process informations
- 2. CAN messages
- 3. CAN speedchanges
+ 2. Brewing informations
+ 3. HAL messages
  4. SQL querys
- 5. CAN error states
+ 5. LED stripe debugging
  6. SPI communication
 
 ## Sourcecode ##

+ 1 - 1
CoffeeCode/buildno

@@ -1 +1 @@
-21
+22

+ 3 - 2
CoffeeCode/global.h

@@ -21,6 +21,7 @@
 
 // Global variables
 
+extern int verbose;
 extern bool optDate, optPower;
 extern pthread_mutex_t mutex;
 extern int lcd;
@@ -28,8 +29,8 @@ extern int lcd;
 
 // Thread IDs
 #define THREAD_MAIN 	0
-#define THREAD_TEST		1
-#define THREAD_CAN		2
+#define THREAD_STRIPE	1
+#define THREAD_DISPLAY	2
 
 
 void killThread(int threadid, int sig);

+ 3 - 3
CoffeeCode/logger.h

@@ -24,10 +24,10 @@ typedef enum {
 typedef enum {
 	V_NONE = 0,
 	V_BASIC = 1,
-	V_CAN = 2,
-	V_CANSPEED = 3,
+	V_BREW = 2,
+	V_HAL = 3,
 	V_SQL = 4,
-	V_CANERROR = 5,
+	V_STRIPE = 5,
 	V_SPI = 6,
 } logger_verbose_t;
 

+ 2 - 8
CoffeeCode/main.cpp

@@ -62,12 +62,6 @@ int main(int argc, char *argv[]) {
 			}
 		switch (opt) {
 		case 'v': // be verbose
-			/* Verbose levels:
-			 * 1	Basic debugging
-			 * 2	show CAN communication
-			 * 3	show CAN speed changes
-			 * 4	show SPI communication
-			 */
 			verbose++;
 			break;
 		case 'V':
@@ -145,8 +139,8 @@ int main(int argc, char *argv[]) {
 	for (int i = 0; i < 1; i++) {
 		if (i == THREAD_MAIN)
 			rc = pthread_create(&thread[i], NULL, mainLoop, (void *) i);
-		/*else if (i == THREAD_TEST)
-			rc = pthread_create(&thread[i], NULL, testMain, (void *) i);
+		/*else if (i == THREAD_STRIPE)
+			rc = pthread_create(&thread[i], NULL, stripeThread, (void *) i);
 		else if (i == THREAD_CAN)
 			rc = pthread_create(&thread[i], NULL, canThread, (void *) i);*/
 		if (rc) {