<commit_before>/**
* \file timers.c
* \brief OS Soft Timers service functions
*
* Functions to create, start, stop, delete and 
* get remaining time of soft timers
*
**/
/*********************************************************************************************************
*                                               BRTOS
*                                Brazilian Real-Time Operating System
*                            Acronymous of Basic Real-Time Operating System
*
*                              
*                                  Open Source RTOS under MIT License
*
*
*
*                                     OS Soft Timers functions
*
*
*   Authors:  <NAME>
*   Revision: 1.0
*   Date:     12/01/2013
*   Authors:  <NAME>, <NAME>
*   Revision: 1.1
*   Date:     01/05/2015
*********************************************************************************************************/


/*****************************************************************/
/*                          OS SOFT TIMER                        */
/*****************************************************************/
/**
\brief BRTOS soft timer service
*/
#include "timers.h"


#ifdef BRTOS_TMR_EN 
#if (BRTOS_TMR_EN == 1) 

/* private data */
static struct {
    BRTOS_TIMER_T   mem[BRTOS_MAX_TIMER]; /* array of callback structs */            
    BRTOS_TMR_T*    current;              /* keep current timer list */ 
    BRTOS_TMR_T*    future;               /* keep future timer list   */
    INT8U           handling_task;        /* caller Task ID */          
} BRTOS_TIMER_VECTOR;


/* soft timer lists: memory allocation */
static BRTOS_TMR_T BRTOS_TMR_PING,BRTOS_TMR_PONG;    /* Timer lists */

/* local functions */
/* Binary heap of timers */
#define PAI(i)    (INT8U)(i>>1)
#define LEFT(i)   (INT8U)(i<<1)
#define RIGHT(i)  (INT8U)((i<<1) + 1)

static void Subir (BRTOS_TIMER* timers,INT8U i) {
     while (i > 1 && timers[PAI(i)]->timeout > timers[i]->timeout)
     {
         void* tmp = timers[PAI(i)];<commit_msg>Alterado include de timers.h para stimer.h<commit_after>/**
* \file timers.c
* \brief OS Soft Timers service functions
*
* Functions to create, start, stop, delete and 
* get remaining time of soft timers
*
**/
/*********************************************************************************************************
*                                               BRTOS
*                                Brazilian Real-Time Operating System
*                            Acronymous of Basic Real-Time Operating System
*
*                              
*                                  Open Source RTOS under MIT License
*
*
*
*                                     OS Soft Timers functions
*
*
*   Authors:  <NAME>
*   Revision: 1.0
*   Date:     12/01/2013
*   Authors:  <NAME>, <NAME>
*   Revision: 1.1
*   Date:     01/05/2015
*********************************************************************************************************/


/*****************************************************************/
/*                          OS SOFT TIMER                        */
/*****************************************************************/
/**
\brief BRTOS soft timer service
*/
#include "stimer.h"


#ifdef BRTOS_TMR_EN 
#if (BRTOS_TMR_EN == 1) 

/* private data */
static struct {
    BRTOS_TIMER_T   mem[BRTOS_MAX_TIMER]; /* array of callback structs */            
    BRTOS_TMR_T*    current;              /* keep current timer list */ 
    BRTOS_TMR_T*    future;               /* keep future timer list   */
    INT8U           handling_task;        /* caller Task ID */          
} BRTOS_TIMER_VECTOR;


/* soft timer lists: memory allocation */
static BRTOS_TMR_T BRTOS_TMR_PING,BRTOS_TMR_PONG;    /* Timer lists */

/* local functions */
/* Binary heap of timers */
#define PAI(i)    (INT8U)(i>>1)
#define LEFT(i)   (INT8U)(i<<1)
#define RIGHT(i)  (INT8U)((i<<1) + 1)

static void Subir (BRTOS_TIMER* timers,INT8U i) {
     while (i > 1 && timers[PAI(i)]->timeout > timers[i]->timeout)
     {
         void* tmp = timers[PAI(i)];
{'fraction_non_alphanumeric': 0.2642346561498644, 'fraction_numerical': 0.015282228247473502, 'mean_word_length': 2.102446483180428, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2523183', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1125, 'n_words': 282}