View Single Post
Old 01-03-16, 02:20 PM   #16
Acuario
Apprentice EcoRenovator
 
Join Date: May 2011
Location: Tortosa, Spain
Posts: 221
Thanks: 2
Thanked 81 Times in 46 Posts
Default Last part of HeatpumpController.ino

// Declare stacks for threads
NIL_WORKING_AREA(waThreadMain, 1024);
NIL_WORKING_AREA(waThreadEth, 1024);
NIL_WORKING_AREA(waThreadDS18B20, 128);
NIL_WORKING_AREA(waThreadBAC, 256);
NIL_WORKING_AREA(waThreadDHT11, 128);
NIL_WORKING_AREA(waThreadOLED, 128);
NIL_WORKING_AREA(waThreadDefrost, 32);
NIL_WORKING_AREA(waThreadNTC, 64);//128
NIL_WORKING_AREA(waThreadSetBACTime, 256);

/*
* Threads static table, one entry per thread. A thread's priority is determined by its position in the table with highest priority first.
* These threads start with a null argument. A thread's name may also be null to save RAM since the name is currently not used.
*/
NIL_THREADS_TABLE_BEGIN()
NIL_THREADS_TABLE_ENTRY("", threadEthernet, NULL, waThreadEth, sizeof(waThreadEth))
NIL_THREADS_TABLE_ENTRY("", threadMain, NULL, waThreadMain, sizeof(waThreadMain))
NIL_THREADS_TABLE_ENTRY("", threadDisplayOLED, NULL, waThreadOLED, sizeof(waThreadOLED))
NIL_THREADS_TABLE_ENTRY("", threadReadBAC1000, NULL, waThreadBAC, sizeof(waThreadBAC))
NIL_THREADS_TABLE_ENTRY("", threadReadSensors, NULL, waThreadDS18B20, sizeof(waThreadDS18B20))
NIL_THREADS_TABLE_ENTRY("", threadReadDHT11, NULL, waThreadDHT11, sizeof(waThreadDHT11))
NIL_THREADS_TABLE_ENTRY("", threadDefrost, NULL, waThreadDefrost, sizeof(waThreadDefrost))
NIL_THREADS_TABLE_ENTRY("", threadReadNTC, NULL, waThreadNTC, sizeof(waThreadNTC))
NIL_THREADS_TABLE_ENTRY("", threadSetBACTime, NULL, waThreadSetBACTime, sizeof(waThreadSetBACTime))
NIL_THREADS_TABLE_END()

//Format and output string to serial debug port
void SerialPrint2(char *format, ...)
{
char buff[128];
va_list args;
va_start(args, format);
vsnprintf(buff, sizeof(buff), format, args);
va_end(args);
buff[sizeof(buff) / sizeof(buff[0]) - 1] = '\0';
Serial.print(buff);
}
Acuario is offline   Reply With Quote