From 07c7b22669dc17bf3db8c2fbd994af45f213387d Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 19 Sep 2021 22:59:47 +0200 Subject: [PATCH 1/3] Allow setting enum proto values from the command line. --- lib/proto.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/proto.cc b/lib/proto.cc index 41d93b4c..5cf29672 100644 --- a/lib/proto.cc +++ b/lib/proto.cc @@ -156,6 +156,17 @@ void setProtoFieldFromString(ProtoField& protoField, const std::string& value) break; } + case google::protobuf::FieldDescriptor::TYPE_ENUM: + { + const auto* enumfield = field->enum_type(); + const auto* enumvalue = enumfield->FindValueByName(value); + if (!enumvalue) + Error() << fmt::format("unrecognised enum value '{}'", value); + + reflection->SetEnum(message, field, enumvalue); + break; + } + case google::protobuf::FieldDescriptor::TYPE_MESSAGE: if (field->message_type() == RangeProto::descriptor()) { From 028e2498fbecf1ed18bf6ff5bb81c5595dbae042 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 25 Sep 2021 22:35:02 +0200 Subject: [PATCH 2/3] Update references to --input.flux and --output.flux. --- doc/using.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/using.md b/doc/using.md index e4d5c7c8..819d295f 100644 --- a/doc/using.md +++ b/doc/using.md @@ -269,7 +269,7 @@ disks, and have different magnetic properties. 3.5" drives can usually autodetect what kind of medium is inserted into the drive based on the hole in the disk casing, but 5.25" drives can't. As a result, you need to explicitly tell FluxEngine on the command line whether you're using a high density disk or -not with the `--input/output.flux.drive.high_density` configuration setting. +not with the `--flux_source/sink.drive.high_density` configuration setting. **If you don't do this, your disks may not read correctly and will _certainly_ fail to write correctly.** @@ -286,14 +286,14 @@ here.](http://www.retrotechnology.com/herbs_stuff/guzis.html) These flags apply to many operations and are useful for modifying the overall behaviour. - - `--input.flux.drive.revolutions=X` + - `--flux_source.drive.revolutions=X` When reading, spin the disk X times. X can be a floating point number. The default is usually 1.2. Some formats default to 1. Increasing the number will sample more data, and can be useful on dubious disks to try and get a better read. - - `--input.flux.drive.sync_with_index=true|false` + - `--flux_source.drive.sync_with_index=true|false` Wait for an index pulse before starting to read the disk. (Ignored for write operations.) By @@ -301,7 +301,7 @@ behaviour. disk problems it's helpful to have all your data start at the same place each time. - - `--input.flux.drive.index_source=X`, `--output.flux.drive.index_source=X` + - `--flux_source.drive.index_source=X`, `--flux_sink.drive.index_source=X` Set the source of index pulses when reading or writing respectively. This is for use with drives which don't produce index pulse data. `X` can be From 0be673b210498fc3d626d3a09b2908e53952f0f0 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 25 Sep 2021 22:43:19 +0200 Subject: [PATCH 3/3] Clarify documentation in the building doc. --- doc/building.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/building.md b/doc/building.md index 6a5d974d..30864d12 100644 --- a/doc/building.md +++ b/doc/building.md @@ -127,10 +127,11 @@ Programmer](https://www.cypress.com/products/psoc-programming-solutions). **Note:** _not_ the Cypress Programmer, which is for a different board! Cypress will make you register. -Once done, run it. Plug the blunt end of the FluxEngine board into a USB -port (the end which is a USB connector). The programmer should detect it -and report it as a KitProg. You may be prompted to upgrade the programmer -hardware; if so, follow the instructions and do it. +Once done, run it. Plug the blunt end of the FluxEngine board into a USB port +(the end which is a USB plug, with exposed traces; this is on the smaller +section of the board). The programmer should detect it and report it as a +KitProg. You may be prompted to upgrade the programmer hardware; if so, follow +the instructions and do it. Now go to File -> File Load and open `FluxEngine.cydsn/CortexM3/ARM_GCC_541/Release/FluxEngine.hex` in the @@ -151,10 +152,11 @@ CY8CKIT-059 Kit Setup (Kit Design Files, Creator, Programmer, Documentation, Examples)'. I'm not linking to it in case the URL changes when they update it. -Once this is done, I'd strongly recommend working through the initial -tutorial and making the LED on your board flash. It'll tell you where all the -controls are and how to program the board. Remember that the big end of the -board plugs into your computer for programming. +Once this is done, I'd strongly recommend working through the initial tutorial +and making the LED on your board flash. It'll tell you where all the controls +are and how to program the board. Remember that you have to plug the +programming connector into your computer to flash it; the microusb socket is +used only for application control. When you're ready, open the `FluxEngine.cydsn/FluxEngine.cyprj` project, pick 'Program' from the menu, and the firmware should compile and be