got all of the code actually running (not fully functional though)
diff --git a/aos/build/aos.gyp b/aos/build/aos.gyp
index f5defa5..12ac2a1 100644
--- a/aos/build/aos.gyp
+++ b/aos/build/aos.gyp
@@ -50,6 +50,7 @@
'<(AOS)/common/common.gyp:time',
'<(AOS)/common/common.gyp:once',
'logging_interface',
+ '<(AOS)/common/common.gyp:queue_types',
],
},
],
diff --git a/aos/common/logging/logging_impl.cc b/aos/common/logging/logging_impl.cc
index de1c64a..bdc14ec 100644
--- a/aos/common/logging/logging_impl.cc
+++ b/aos/common/logging/logging_impl.cc
@@ -6,6 +6,7 @@
#include "aos/common/time.h"
#include "aos/common/inttypes.h"
#include "aos/common/once.h"
+#include "aos/common/queue_types.h"
namespace aos {
namespace logging {
@@ -84,6 +85,26 @@
} // namespace internal
+void LogImplementation::LogStruct(
+ log_level level, const ::std::string &message, size_t size,
+ const MessageType *type, const ::std::function<size_t(char *)> &serialize) {
+ char serialized[1024];
+ if (size > sizeof(serialized)) {
+ LOG(FATAL, "structure of type %s too big to serialize\n",
+ type->name.c_str());
+ }
+ size_t used = serialize(serialized);
+ char printed[LOG_MESSAGE_LEN];
+ size_t printed_bytes = sizeof(printed);
+ if (!PrintMessage(printed, &printed_bytes, serialized, &used, *type)) {
+ LOG(FATAL, "PrintMessage(%p, %p(=%zd), %p, %p(=%zd), %p(name=%s)) failed\n",
+ printed, &printed_bytes, printed_bytes, serialized, &used, used, type,
+ type->name.c_str());
+ }
+ DoLogVariadic(level, "%.*s: %.*s\n", static_cast<int>(message.size()),
+ message.data(), static_cast<int>(printed_bytes), printed);
+}
+
StreamLogImplementation::StreamLogImplementation(FILE *stream)
: stream_(stream) {}
diff --git a/aos/common/logging/logging_impl.h b/aos/common/logging/logging_impl.h
index bdbe585..f2d9752 100644
--- a/aos/common/logging/logging_impl.h
+++ b/aos/common/logging/logging_impl.h
@@ -7,6 +7,7 @@
#include <limits.h>
#include <string.h>
#include <stdio.h>
+#include <stdarg.h>
#include <string>
#include <functional>
@@ -118,6 +119,12 @@
// Actually logs the given message. Implementations should somehow create a
// LogMessage and then call internal::FillInMessage.
virtual void DoLog(log_level level, const char *format, va_list ap) = 0;
+ void DoLogVariadic(log_level level, const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ DoLog(level, format, ap);
+ va_end(ap);
+ }
// Logs the contents of an auto-generated structure. The implementation here
// just converts it to a string with PrintMessage and then calls DoLog with
diff --git a/aos/common/logging/logging_interface.cc b/aos/common/logging/logging_interface.cc
index 9f1168f..68a88a8 100644
--- a/aos/common/logging/logging_interface.cc
+++ b/aos/common/logging/logging_interface.cc
@@ -60,16 +60,6 @@
using internal::Context;
-void LogImplementation::LogStruct(
- log_level level, const ::std::string &message, size_t size,
- const MessageType *type, const ::std::function<size_t(char *)> &serialize) {
- (void)level;
- (void)message;
- (void)size;
- (void)type;
- (void)serialize;
-}
-
void LogImplementation::DoVLog(log_level level, const char *format, va_list ap,
int levels) {
internal::RunWithCurrentImplementation(
diff --git a/bbb_cape/src/bbb/cape_manager.cc b/bbb_cape/src/bbb/cape_manager.cc
index b680c4a..b5f2851 100644
--- a/bbb_cape/src/bbb/cape_manager.cc
+++ b/bbb_cape/src/bbb/cape_manager.cc
@@ -11,7 +11,7 @@
namespace bbb {
CapeManager::CapeManager()
- : uart_(750000), reset_(2, 5, true), custom_bootloader_(2, 3, false) {}
+ : uart_(750000), reset_(2, 5, true), custom_bootloader_(2, 3, true) {}
void CapeManager::DownloadHex(const ::std::string &filename) {
HexByteReader file(filename);
diff --git a/frc971/prime/prime.gyp b/frc971/prime/prime.gyp
index 3b699ad..bb8d244 100644
--- a/frc971/prime/prime.gyp
+++ b/frc971/prime/prime.gyp
@@ -17,6 +17,7 @@
'<(DEPTH)/bbb_cape/src/bbb/bbb.gyp:test_sensor_receiver',
'<(DEPTH)/bbb_cape/src/bbb/bbb.gyp:packet_finder_test',
'<(DEPTH)/bbb_cape/src/bbb/bbb.gyp:cows_test',
+ '<(DEPTH)/bbb_cape/src/flasher/flasher.gyp:stm32_flasher',
],
'copies': [
{
diff --git a/frc971/prime/scripts/start_list.txt b/frc971/prime/scripts/start_list.txt
index 79f9490..d7d20f4 100644
--- a/frc971/prime/scripts/start_list.txt
+++ b/frc971/prime/scripts/start_list.txt
@@ -1,4 +1,4 @@
-BinaryLogReader
+binary_log_writer
motor_writer
joystick_reader
drivetrain