Skip to content

Commit

Permalink
Update CI scripts and ESP32 main
Browse files Browse the repository at this point in the history
  • Loading branch information
tekka007 committed Jan 1, 2019
1 parent 935a3bc commit f769917
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .ci/arduino.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!groovy
def buildArduino(config, String buildFlags, String sketch, String key) {
def root = '/opt/arduino-1.8.8/'
def root = '/opt/arduino-1.8.8/'
def build_path = 'build'
def build_path_cmd = ''
if (config.nightly_arduino_ide)
{
root = '/opt/arduino-nightly/'
// patch for arduino-builder 1.8.9
build_path_cmd = ' -build-path '+build_path+' '
}
//def esp8266_tools = '/opt/arduino-nightly/hardware/esp8266com/esp8266/tools'
def jenkins_root = '/var/lib/jenkins/'
def builder = root+'arduino-builder'
def standard_args = ' -warnings=all' //-verbose=true
Expand All @@ -14,9 +17,11 @@ def buildArduino(config, String buildFlags, String sketch, String key) {
def jenkins_packages = jenkins_root+'.arduino15/packages'
def site_specifics = ' -hardware '+jenkins_packages+' -tools '+jenkins_packages
def repo_specifics = ' -hardware hardware -libraries . '
def build_cmd = builder+standard_args+builder_specifics+site_specifics+repo_specifics+buildFlags
def build_cmd = builder+standard_args+builder_specifics+site_specifics+repo_specifics+build_path_cmd+buildFlags
sh """#!/bin/bash
printf "\\e[1m\\e[32mBuilding \\e[34m${sketch} \\e[0musing \\e[1m\\e[36m${build_cmd}\\e[0m\\n"
rm -r ${build_path}
mkdir ${build_path}
${build_cmd} ${sketch} 2>> compiler_${key}.log"""
}

Expand Down
18 changes: 13 additions & 5 deletions hal/architecture/ESP32/MyMainESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_task_wdt.h"
#include "Arduino.h"

TaskHandle_t loopTaskHandle = NULL;

#if CONFIG_AUTOSTART_ARDUINO

#if CONFIG_FREERTOS_UNICORE
Expand All @@ -30,20 +33,25 @@
#define ARDUINO_RUNNING_CORE 1
#endif

void MySensorsTask(void *pvParameters)
bool loopTaskWDTEnabled;

void loopTask(void *pvParameters)
{
_begin(); // Startup MySensors library
for (;;) {
micros(); // update overflow
for(;;) {
if(loopTaskWDTEnabled) {
esp_task_wdt_reset();
}
_process(); // Process incoming data
loop(); // Call sketch loop
loop();
}
}

extern "C" void app_main()
{
loopTaskWDTEnabled = false;
initArduino();
xTaskCreatePinnedToCore(MySensorsTask, "MySensorsTask", 8192, NULL, 1, NULL, ARDUINO_RUNNING_CORE);
xTaskCreatePinnedToCore(loopTask, "loopTask", 8192, NULL, 1, &loopTaskHandle, ARDUINO_RUNNING_CORE);
}

#endif

0 comments on commit f769917

Please sign in to comment.