<commit_before>/*
 * Copyright (C) 2014-2015 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.
 */

/**
 * @ingroup     cpu_cortexm_common
 * @{
 *
 * @file
 * @brief       Implementation of the kernels reboot interface
 *
 * @author      <NAME> <hauke.petersen@fu-berlin.de>
 *
 * @}
 */

#include <stdio.h>

#include "arch/reboot_arch.h"
#include "cpu.h"
#include "hwtimer.h"

int reboot_arch(int mode)
{
    printf("Going into reboot, mode %i\n", mode);
    /* wait 1 ms to make sure the printf is finished */
    hwtimer_wait(HWTIMER_TICKS(1000));
    NVIC_SystemReset();
    return -1;
}<commit_msg>cpu: cortexm_common: busywait before resetting<commit_after>/*
 * Copyright (C) 2014-2015 Freie Universität Berlin
 *               2015 <NAME> <<EMAIL>>
 *
 * 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.
 */

/**
 * @ingroup     cpu_cortexm_common
 * @{
 *
 * @file
 * @brief       Implementation of the kernels reboot interface
 *
 * @author      <NAME> <hauke.petersen@fu-berlin.de>
 * @author      <NAME> <<EMAIL>>
 *
 * @}
 */

#include <stdio.h>

#include "arch/reboot_arch.h"
#include "cpu.h"

int reboot_arch(int mode)
{
    printf("Going into reboot, mode %i\n", mode);
    /* wait a while to make sure the printf is finished */
    volatile int n = 100000;
    while(n--);
    NVIC_SystemReset();
    return -1;
}
{'fraction_non_alphanumeric': 0.12445278298936835, 'fraction_numerical': 0.023139462163852407, 'mean_word_length': 3.04040404040404, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5503329', 'n_tokens_mistral': 575, 'n_tokens_neox': 531, 'n_words': 172}