Skip to content

Instantly share code, notes, and snippets.

View gustavosinbandera1's full-sized avatar
💭
Working hard

Gustavo Grisales gustavosinbandera1

💭
Working hard
  • Colombia
View GitHub Profile
std::string CookLogger::processData(int32_t cook_event_id, grafana_event_data_t info_) {
switch (cook_event_id) {
case COOKING_EVENT_PROCESS_STARTED:
case COOKING_EVENT_PROCESS_CANCELLED:
case COOKING_EVENT_PROCESS_ENDED: {
grafana_event_data_t info = info_;
//printCookData(&info);
char *item_data;
item_data = json_asprintf("{event:%Q,cook_name:%Q,cook_type:%Q,event_time:%d,label:%Q, bottom_setting:%Q,bottom_temp:%d,bottom_time:%d,top_setting:%Q,top_temp:%d,top_time:%d}",
#!/bin/sh
#
# Modified from http://qiita.com/janus_wel/items/cfc6914d6b7b8bf185b6
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
while (1) {
if (read) {
read = false;
for (channel = 0; channel < NUM_CHANNELS; channel++) {
adc_average[channel] += this->m_value[channel];
}
count++;
if (count >= num_cycles) {
count = 0;
for (int index = 0; index < NUM_CHANNELS; index++) {
// Copyright (c) 2010-2018 Antmicro
// Copyright (c) 2011-2015 Realtime Embedded
//
// This file is licensed under the MIT License.
// Full license text is available in 'licenses/MIT.txt'.
//
using System;
using System.Threading;
using System.Diagnostics;
//
// Copyright (c) 2010-2018 Antmicro
// Copyright (c) 2011-2015 Realtime Embedded
//
// This file is licensed under the MIT License.
// Full license text is available in 'licenses/MIT.txt'.
//
using System;
using Antmicro.Renode.Peripherals.Bus;
using System.Collections.Generic;
#include "HttpServerHandler.h"
static const char* TAG = "HTTP-SERVER-HANDLER";
namespace HttpServerHandler {
void readDeviceInfoHandler(HttpRequest* pHttpRequest, HttpResponse* pHttpResponse)
{
ostringstream s1;
std::uint16_t voltage = 0;
std::int16_t avg_current = 0;
std::int16_t avg_power = 0;
/**
* @file main.c
* @author Locha Mesh Developers ([email protected])
* @brief Main firmware file
* @version 0.1
* @date 2020-02-02
*
* @copyright Copyright (c) 2020 Locha Mesh project developers
* @license Apache 2.0, see LICENSE file for details
*
/*
* Copyright (C) 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup net_gnrc_netif Network interface API
/*
* Copyright (C) 2013 Freie Universität Berlin.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup net_if Network interfaces
#include "UserButton.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include <esp_log.h>
namespace hmi {
static xQueueHandle gpio_evt_queue = nullptr;
static void IRAM_ATTR interruptIsrHandler(void* arg)