(volumes []string, tmppath string, options *compileopts.Options)
| 1068 | } |
| 1069 | |
| 1070 | func flashHexUsingMSD(volumes []string, tmppath string, options *compileopts.Options) error { |
| 1071 | for start := time.Now(); time.Since(start) < options.Timeout; { |
| 1072 | // Find all mount points. |
| 1073 | mounts, err := findFATMounts(options) |
| 1074 | if err != nil { |
| 1075 | return err |
| 1076 | } |
| 1077 | for _, mount := range mounts { |
| 1078 | for _, volume := range volumes { |
| 1079 | if mount.name != volume { |
| 1080 | continue |
| 1081 | } |
| 1082 | // Found the filesystem, so flash the device! |
| 1083 | return moveFile(tmppath, filepath.Join(mount.path, "flash.hex")) |
| 1084 | } |
| 1085 | } |
| 1086 | time.Sleep(500 * time.Millisecond) |
| 1087 | } |
| 1088 | return errors.New("unable to locate any volume: [" + strings.Join(volumes, ",") + "]") |
| 1089 | } |
| 1090 | |
| 1091 | const ( |
| 1092 | defaultReset = "default" |
no test coverage detected