<commit_before>/*
 * This file is part of the µOS++ distribution.
 *   (https://github.com/micro-os-plus)
 * Copyright (c) 2016 <NAME>.
 *
 * µOS++ is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, version 3.
 *
 * µOS++ is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * This file is part of the CMSIS++ proposal, intended as a CMSIS
 * replacement for C++ applications.
 *
 * The structures declared in this file are used both in the C API
 * and in the legacy CMSIS API.
 *
 * Since there is no method to automatically sync them with the C++
 * definitions, they must be manually adjusted to match them, otherwise
 * the validation checks in os-c-wrapper.cpp will fail.
 */

#ifndef CMSIS_PLUS_RTOS_OS_C_DECLS_H_
#define CMSIS_PLUS_RTOS_OS_C_DECLS_H_

// ----------------------------------------------------------------------------

#include <cmsis-plus/rtos/os-app-config.h>
#include <cmsis-plus/rtos/port/os-c-decls.h>

#include <stdint.h>
#include <stddef.h>

// We definitely use CMSIS++.
#define OS_USE_CMSIS_PLUS

// ----------------------------------------------------------------------------

#ifdef  __cplusplus
extern "C"
{
#endif

  // --------------------------------------------------------------------------

#define OS_PRIOTHREAD_SIZE_PTR (OS_INTEGER_MAX_NUMBER_OF_THREADS+1)

  // --------------------------------------------------------------------------

  typedef uint32_t os_result_t;

  typedef uint32_t os_systicks_t;

  typedef struct os_thread_list_s
  {
    void* content[OS_PRIOTHREAD_SIZE_PTR];
  } os_thread_list_t;

  typedef uint32_t os_flags_mode_t;
  typedef uint32_t os_flags_mask_t;

  // --------------------------------------------------------------------------

#define OS_PRIOTHREAD_SHIFT   (1)

  enum
  {
    os_priority_none = 0, // not defined
    os_priority_idle = 1,
    os_priority_lowest = 2, // lowest
    os_priority_low = (2 << OS_PRIOTHREAD_SHIFT),
    os_priority_below_normal = (4 << OS_PRIOTHREAD_SHIFT),
    os_priority_normal = (6 << OS_PRIOTHREAD_SHIFT), // default
    os_priority_above_normal = (8 << OS_PRIOTHREAD_SHIFT),
    os_priority_high = (10 << OS_PRIOTHREAD_SHIFT),
    os_priority_realtime = (12 << OS_PRIOTHREAD_SHIFT),
    os_priority_highest = ((8 << OS_PRIOTHREAD_SHIFT) - 3),
    os_priority_isr = ((8 << OS_PRIOTHREAD_SHIFT) - 2),
    os_priority_error = ((8 << OS_PRIOTHREAD_SHIFT) - 1)
  };

  enum
  {
    os_thread_inactive = 0,
    os_thread_ready,
    os_thread_running,
    os_thread_waiting
  };

  enum
  {
    os_timer_once = 0, os_timer_periodic = 1
  };

  typedef void* os_thread_func_args_t;
  typedef void*
  (*os_thread_func_t) (os_thread_func_args_t args);

  typedef uint8_t os_thread_state_t;

  typedef uint8_t os_thread_prio_t;

  typedef os_flags_mask_t os_thread_sigset_t;

#pragma GCC diagnostic push<commit_msg>os-c-decls: keep priorities in sync<commit_after>/*
 * This file is part of the µOS++ distribution.
 *   (https://github.com/micro-os-plus)
 * Copyright (c) 2016 Liviu Ionescu.
 *
 * µOS++ is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, version 3.
 *
 * µOS++ is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * This file is part of the CMSIS++ proposal, intended as a CMSIS
 * replacement for C++ applications.
 *
 * The structures declared in this file are used both in the C API
 * and in the legacy CMSIS API.
 *
 * Since there is no method to automatically sync them with the C++
 * definitions, they must be manually adjusted to match them, otherwise
 * the validation checks in os-c-wrapper.cpp will fail.
 */

#ifndef CMSIS_PLUS_RTOS_OS_C_DECLS_H_
#define CMSIS_PLUS_RTOS_OS_C_DECLS_H_

// ----------------------------------------------------------------------------

#include <cmsis-plus/rtos/os-app-config.h>
#include <cmsis-plus/rtos/port/os-c-decls.h>

#include <stdint.h>
#include <stddef.h>

// We definitely use CMSIS++.
#define OS_USE_CMSIS_PLUS

// ----------------------------------------------------------------------------

#ifdef  __cplusplus
extern "C"
{
#endif

  // --------------------------------------------------------------------------

#define OS_PRIOTHREAD_SIZE_PTR (OS_INTEGER_MAX_NUMBER_OF_THREADS+1)

  // --------------------------------------------------------------------------

  typedef uint32_t os_result_t;

  typedef uint32_t os_systicks_t;

  typedef struct os_thread_list_s
  {
    void* content[OS_PRIOTHREAD_SIZE_PTR];
  } os_thread_list_t;

  typedef uint32_t os_flags_mode_t;
  typedef uint32_t os_flags_mask_t;

  // --------------------------------------------------------------------------

#define OS_PRIOTHREAD_SHIFT   (0)

  enum
  {
    os_priority_none = 0, // not defined
    os_priority_idle = 1,
    os_priority_lowest = 2, // lowest
    os_priority_low = (2 << OS_PRIOTHREAD_SHIFT),
    os_priority_below_normal = (4 << OS_PRIOTHREAD_SHIFT),
    os_priority_normal = (6 << OS_PRIOTHREAD_SHIFT), // default
    os_priority_above_normal = (8 << OS_PRIOTHREAD_SHIFT),
    os_priority_high = (10 << OS_PRIOTHREAD_SHIFT),
    os_priority_realtime = (12 << OS_PRIOTHREAD_SHIFT),
    os_priority_highest = ((16 << OS_PRIOTHREAD_SHIFT) - 3),
    os_priority_isr = ((16 << OS_PRIOTHREAD_SHIFT) - 2),
    os_priority_error = ((16 << OS_PRIOTHREAD_SHIFT) - 1)
  };

  enum
  {
    os_thread_inactive = 0,
    os_thread_ready,
    os_thread_running,
    os_thread_waiting
  };

  enum
  {
    os_timer_once = 0, os_timer_periodic = 1
  };

  typedef void* os_thread_func_args_t;
  typedef void*
  (*os_thread_func_t) (os_thread_func_args_t args);

  typedef uint8_t os_thread_state_t;

  typedef uint8_t os_thread_prio_t;

  typedef os_flags_mask_t os_thread_sigset_t;

#pragma GCC diagnostic push
{'fraction_non_alphanumeric': 0.19317147192716236, 'fraction_numerical': 0.011684370257966616, 'mean_word_length': 2.3422920892494927, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7540590', 'n_tokens_mistral': 2165, 'n_tokens_neox': 2053, 'n_words': 578}