Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Oct 31, 2024
1 parent 820bdec commit f1134d9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "firmware/freertos_tasks.hpp"

#include "firmware/system_policy.hpp"
#include "flex-stacker/system_task.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ auto run(tasks::FirmwareTasks::QueueAggregator* aggregator) -> void;
namespace system_control_task {
// Actual function that runs in the task
auto run(tasks::FirmwareTasks::QueueAggregator* aggregator) -> void;
} // namespace system_task
} // namespace system_control_task
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "firmware/system_hardware.h"
#include "firmware/system_serial_number.h"
#include "systemwide.h"
#include "flex-stacker/errors.hpp"
#include "systemwide.h"

class SystemPolicy {
private:
Expand Down
8 changes: 4 additions & 4 deletions stm32-modules/include/flex-stacker/flex-stacker/gcodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ struct SetSerialNumber {
std::array<char, SYSTEM_WIDE_SERIAL_NUMBER_LENGTH> value;

template <typename InputIt, typename InLimit>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputIt, InLimit>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputIt, InLimit>
static auto write_response_into(InputIt buf, InLimit limit) -> InputIt {
return write_string_to_iterpair(buf, limit, response);
}

template <typename InputIt, typename Limit>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<Limit, InputIt>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<Limit, InputIt>
static auto parse(const InputIt& input, Limit limit)
-> std::pair<ParseResult, InputIt> {
auto res =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ class HostCommsTask {
}

template <typename InputIt, typename InputLimit>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputLimit, InputIt>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputLimit, InputIt>
auto visit_gcode(const gcode::GetSystemInfo& gcode, InputIt tx_into,
InputLimit tx_limit) -> std::pair<bool, InputIt> {
auto id = get_system_info_cache.add(gcode);
Expand All @@ -383,8 +383,8 @@ class HostCommsTask {
}

template <typename InputIt, typename InputLimit>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputLimit, InputIt>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputLimit, InputIt>
auto visit_gcode(const gcode::SetSerialNumber& gcode, InputIt tx_into,
InputLimit tx_limit) -> std::pair<bool, InputIt> {
auto id = ack_only_cache.add(gcode);
Expand All @@ -405,8 +405,8 @@ class HostCommsTask {
}

template <typename InputIt, typename InputLimit>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputLimit, InputIt>
requires std::forward_iterator<InputIt> &&
std::sized_sentinel_for<InputLimit, InputIt>
auto visit_gcode(const gcode::EnterBootloader& gcode, InputIt tx_into,
InputLimit tx_limit) -> std::pair<bool, InputIt> {
auto id = ack_only_cache.add(gcode);
Expand Down
13 changes: 7 additions & 6 deletions stm32-modules/include/flex-stacker/flex-stacker/system_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include "core/ack_cache.hpp"
#include "core/queue_aggregator.hpp"
#include "core/version.hpp"
#include "hal/message_queue.hpp"
#include "flex-stacker/messages.hpp"
#include "flex-stacker/tasks.hpp"
#include "hal/message_queue.hpp"

namespace system_task {

Expand Down Expand Up @@ -85,8 +85,8 @@ class SystemTask {
auto response =
messages::AcknowledgePrevious{.responding_to_id = message.id};
response.with_error = policy.set_serial_number(message.serial_number);
static_cast<void>(
_task_registry->send_to_address(response, Queues::HostCommsAddress));
static_cast<void>(_task_registry->send_to_address(
response, Queues::HostCommsAddress));
}

template <SystemExecutionPolicy Policy>
Expand All @@ -96,7 +96,8 @@ class SystemTask {
auto id = _prep_cache.add(0);
auto usb_msg = messages::ForceUSBDisconnect{
.id = id, .return_address = MY_ADDRESS};
if (!_task_registry->send_to_address(usb_msg, Queues::HostCommsAddress)) {
if (!_task_registry->send_to_address(usb_msg,
Queues::HostCommsAddress)) {
_prep_cache.remove_if_present(id);
}

Expand All @@ -107,8 +108,8 @@ class SystemTask {

auto response =
messages::AcknowledgePrevious{.responding_to_id = message.id};
static_cast<void>(
_task_registry->send_to_address(response, Queues::HostCommsAddress));
static_cast<void>(_task_registry->send_to_address(
response, Queues::HostCommsAddress));
}

// Any Ack messages should be in response to bootloader prep messages
Expand Down

0 comments on commit f1134d9

Please sign in to comment.