<commit_before>/* mbed Microcontroller Library
 * Copyright (c) 2013-2017 ARM Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "utest/utest.h"
#include "unity/unity.h"


#if !DEVICE_LPTICKER
    #error [NOT_SUPPORTED] Low power ticker not supported for this target
#endif

using utest::v1::Case;

static const int test_timeout = 10;

#define TICKER_COUNT 16
#define MULTI_TICKER_TIME_MS 100

/* Due to poor accuracy of LowPowerTicker on many platforms
   there is no sense to tune tolerance value as it was in Ticker tests.

   Tolerance value is set to 500us for measurement inaccuracy + 5% tolerance
   for LowPowerTicker. */
#define TOLERANCE_US(DELAY) (500 + DELAY / 20)


volatile uint32_t ticker_callback_flag;
volatile uint32_t multi_counter;<commit_msg>tests-mbed_drivers-lp_ticker: increase tolerance for NRF51_DK<commit_after>/* mbed Microcontroller Library
 * Copyright (c) 2013-2017 ARM Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "utest/utest.h"
#include "unity/unity.h"


#if !DEVICE_LPTICKER
    #error [NOT_SUPPORTED] Low power ticker not supported for this target
#endif

using utest::v1::Case;

static const int test_timeout = 10;

#define TICKER_COUNT 16
#define MULTI_TICKER_TIME_MS 100

/* Due to poor accuracy of LowPowerTicker on many platforms
   there is no sense to tune tolerance value as it was in Ticker tests.

   Tolerance value is set to 600us for measurement inaccuracy + 5% tolerance
   for LowPowerTicker. */
#define TOLERANCE_US(DELAY) (600 + DELAY / 20)


volatile uint32_t ticker_callback_flag;
volatile uint32_t multi_counter;
{'fraction_non_alphanumeric': 0.07330415754923414, 'fraction_numerical': 0.024799416484318017, 'mean_word_length': 4.3056092843326885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2999418', 'n_tokens_mistral': 870, 'n_tokens_neox': 799, 'n_words': 339}