append_command_all_ports: add optional set_end_flag argument

This commit is contained in:
Zack Buhman 2024-12-08 17:31:00 -06:00
parent 870254efd2
commit 8f95b5a2b2
3 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ endef
$(AS) $(AARCH) $(AFLAGS) $(DEBUG) $< -o $@
%.o: %.c
$(CC) $(CARCH) $(CFLAGS) $(OPT) $(DEBUG) $(DEPFLAGS) -MF ${<}.d -c $< -o $@
$(CC) $(CARCH) $(CFLAGS) -std=c23 $(OPT) $(DEBUG) $(DEPFLAGS) -MF ${<}.d -c $< -o $@
%.o: %.cpp
$(CXX) $(CARCH) $(CFLAGS) $(CXXFLAGS) $(OPT) $(DEBUG) $(DEPFLAGS) -MF ${<}.d -c $< -o $@

View File

@ -15,7 +15,7 @@ void main()
using command_type = maple::device_request;
using response_type = maple::device_status;
auto writer = maple::host_command_writer<>(send_buf, recv_buf);
auto writer = maple::host_command_writer(send_buf, recv_buf);
auto [host_command, host_response]
= writer.append_command_all_ports<command_type, response_type>();

View File

@ -70,12 +70,12 @@ struct host_command_writer {
template <typename C, typename R>
constexpr inline std::tuple<maple::host_command<typename C::data_fields> *,
maple::host_response<typename R::data_fields> *>
append_command_all_ports()
append_command_all_ports(bool set_end_flag = true)
{
auto ret = append_command<C, R>(host_instruction::port_select::a, ap::de::device | ap::port_select::a, false);
append_command<C, R>(host_instruction::port_select::b, ap::de::device | ap::port_select::b, false);
append_command<C, R>(host_instruction::port_select::c, ap::de::device | ap::port_select::c, false);
append_command<C, R>(host_instruction::port_select::d, ap::de::device | ap::port_select::d, true);
append_command<C, R>(host_instruction::port_select::d, ap::de::device | ap::port_select::d, set_end_flag);
return ret;
}