Skip to content

Commit

Permalink
Update util_ring_allocator.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos authored Apr 18, 2018
1 parent 0e5b063 commit 13ac982
Showing 1 changed file with 0 additions and 75 deletions.
75 changes: 0 additions & 75 deletions ref_app/src/util/memory/util_ring_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,78 +164,3 @@
}

#endif // UTIL_RING_ALLOCATOR_2010_02_23_H_

/*
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2013.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#if defined(_MSC_VER)
#include <iostream>
#endif
#include <iterator>
#include <numeric>
#include <vector>
#include <mcal/mcal.h>
#include <util/utility/util_time.h>
#include <util/memory/util_ring_allocator.h>
namespace app
{
namespace led
{
void task_init();
void task_func();
}
}
namespace
{
typedef util::timer<std::uint32_t> timer_type;
timer_type app_led_timer(timer_type::seconds(1U));
}
void app::led::task_init()
{
mcal::led::led0.toggle();
}
std::uint8_t counter;
typedef util::ring_allocator<std::uint8_t, UINT8_C(2)> allocator_type;
typedef std::vector<std::uint8_t, allocator_type> vector_type;
vector_type v;
void app::led::task_func()
{
if(app_led_timer.timeout())
{
v.clear();
v.push_back(counter + UINT8_C(0));
v.push_back(counter + UINT8_C(1));
v.push_back(counter + UINT8_C(2));
const bool vector_size_is_ok = (v.size() == vector_type::size_type(3U));
const bool vector_content_is_ok = (std::accumulate(v.cbegin(), v.cend(), std::uint8_t(0U)) == std::uint8_t(std::uint8_t(counter * UINT8_C(3)) + UINT8_C(3)));
counter += std::uint8_t(v.size());
if(vector_size_is_ok && vector_content_is_ok)
{
app_led_timer.start_interval(timer_type::seconds(1U));
mcal::led::led0.toggle();
#if defined(_MSC_VER)
std::cout << unsigned(counter) << std::endl;
#endif
}
}
}
*/

0 comments on commit 13ac982

Please sign in to comment.