<commit_before>// coding: utf-8
/* Copyright (c) 2013, <NAME>
* All Rights Reserved.
*
* The file is part of my bachelor thesis and is released under the 3-clause BSD
* license. See the file `LICENSE` for the full license governing this code.
*/
// ----------------------------------------------------------------------------

#include <xpcc/architecture/driver.hpp>
#include <xpcc/processing.hpp>

#include "hardware.hpp"
#include <stdlib.h>

using namespace xpcc::atmega;

#undef	XPCC_LOG_LEVEL
#define	XPCC_LOG_LEVEL xpcc::log::DEBUG

// xpcc::Clock
ISR(TIMER2_OVF_vect)
{
	/* this interrupt is called every 1.111111111ms
	 * but the clock is only incremented by 1ms
	 * After 9 interrupts, 10ms in real life has elapsed
	 * but only 9ms have been counted.
	 * therefore after 9 interrupts, the clock is incremented twice
	 */

	static uint8_t cycles(9);
	xpcc::Clock::increment(1);
	if (!cycles--) {
		xpcc::Clock::increment(1);
		cycles = 9;
	}
}

int
main(void)
{
	// set the power pins
	PsOn::setOutput(xpcc::Gpio::High);
	PwrOk::setInput();

	// set the temperature pins
	HeaterPin::setOutput(xpcc::Gpio::Low);
	HeaterFanPin::setOutput(xpcc::Gpio::Low);
	CoolerPin::setOutput(xpcc::Gpio::Low);
	CoolerFanPin::setOutput(xpcc::Gpio::Low);

	// set the led pins
	initializeLeds();<commit_msg>Correct off-by-one error in temperature controller fractional clock generation.<commit_after>// coding: utf-8
/* Copyright (c) 2013, <NAME>
* All Rights Reserved.
*
* The file is part of my bachelor thesis and is released under the 3-clause BSD
* license. See the file `LICENSE` for the full license governing this code.
*/
// ----------------------------------------------------------------------------

#include <xpcc/architecture/driver.hpp>
#include <xpcc/processing.hpp>

#include "hardware.hpp"
#include <stdlib.h>

using namespace xpcc::atmega;

#undef	XPCC_LOG_LEVEL
#define	XPCC_LOG_LEVEL xpcc::log::DEBUG

// xpcc::Clock
ISR(TIMER2_OVF_vect)
{
	/* this interrupt is called every 1.111111111ms
	 * but the clock is only incremented by 1ms
	 * After 9 interrupts, 10ms in real life has elapsed
	 * but only 9ms have been counted.
	 * therefore after 9 interrupts, the clock is incremented twice
	 */

	static uint8_t cycles(9);
	xpcc::Clock::increment(1);
	if (!--cycles) {
		xpcc::Clock::increment(1);
		cycles = 9;
	}
}

int
main(void)
{
	// set the power pins
	PsOn::setOutput(xpcc::Gpio::High);
	PwrOk::setInput();

	// set the temperature pins
	HeaterPin::setOutput(xpcc::Gpio::Low);
	HeaterFanPin::setOutput(xpcc::Gpio::Low);
	CoolerPin::setOutput(xpcc::Gpio::Low);
	CoolerFanPin::setOutput(xpcc::Gpio::Low);

	// set the led pins
	initializeLeds();
{'fraction_non_alphanumeric': 0.18157894736842106, 'fraction_numerical': 0.021052631578947368, 'mean_word_length': 3.464765100671141, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7292119', 'n_tokens_mistral': 974, 'n_tokens_neox': 892, 'n_words': 253}