mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	Make rpm work.
This commit is contained in:
		| @@ -21,13 +21,13 @@ static ActionFlag helpFlag = ActionFlag( | ||||
|     doHelp); | ||||
|  | ||||
| static ActionFlag showConfigFlag = ActionFlag( | ||||
|     { "--show-config", "-c" }, | ||||
|     { "--config", "-C" }, | ||||
|     "Shows the currently set configuration and halts.", | ||||
|     doShowConfig); | ||||
|  | ||||
| static ActionFlag docFlag = ActionFlag( | ||||
|     { "--doc" }, | ||||
|     "Shows the available configuration options.", | ||||
|     "Shows the available configuration options and halts.", | ||||
|     doDoc); | ||||
|  | ||||
| FlagGroup::FlagGroup() | ||||
| @@ -228,7 +228,8 @@ const std::string HexIntFlag::defaultValueAsString() const | ||||
|  | ||||
| static void doHelp() | ||||
| { | ||||
|     std::cout << "FluxEngine options:" << std::endl; | ||||
|     std::cout << "FluxEngine options:\n"; | ||||
| 	std::cout << "Note: options are processed left to right and order matters!\n"; | ||||
|     for (auto flag : all_flags) | ||||
|     { | ||||
|         std::cout << "  "; | ||||
|   | ||||
| @@ -3,28 +3,25 @@ | ||||
| #include "usb/usb.h" | ||||
| #include "dataspec.h" | ||||
| #include "protocol.h" | ||||
| #include "proto.h" | ||||
|  | ||||
| static FlagGroup flags; | ||||
|  | ||||
| static DataSpecFlag source( | ||||
|     { "--source", "-s" }, | ||||
|     "source for data", | ||||
|     ":d=0:t=0:s=0"); | ||||
|  | ||||
| static IntFlag hardSectorCount( | ||||
|     { "--hard-sector-count" }, | ||||
|     "number of hard sectors on the disk (0=soft sectors)", | ||||
|     0); | ||||
| static IntFlag driveFlag( | ||||
|     { "-d", "--drive" }, | ||||
|     "drive to test", | ||||
| 	0, | ||||
| 	[](const auto& value) | ||||
| 	{ | ||||
| 		config.mutable_input()->mutable_disk()->mutable_drive()->set_drive(value); | ||||
| 	}); | ||||
|  | ||||
| int mainRpm(int argc, const char* argv[]) | ||||
| { | ||||
|     flags.parseFlagsWithConfigFiles(argc, argv, {}); | ||||
|  | ||||
| 	Error() << "TODO"; | ||||
| 	#if 0 | ||||
|     FluxSpec spec(source); | ||||
|     usbSetDrive(spec.drive, false, F_INDEX_REAL); | ||||
|     nanoseconds_t period = usbGetRotationalPeriod(hardSectorCount); | ||||
|     usbSetDrive(config.input().disk().drive().drive(), false, F_INDEX_REAL); | ||||
|     nanoseconds_t period = usbGetRotationalPeriod(config.input().disk().drive().hard_sector_count()); | ||||
|     if (period != 0) | ||||
|         std::cout << "Rotational period is " << period/1000000 << " ms (" << 60e9/period << " rpm)" << std::endl; | ||||
|     else | ||||
| @@ -35,7 +32,6 @@ int mainRpm(int argc, const char* argv[]) | ||||
|                      "  - the disk has no index holes (e.g. reversed flippy disks)\n" | ||||
|                      "  - (most common) no disk is inserted in the drive!\n"; | ||||
|     } | ||||
| 	#endif | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user