Skip to content

Commit 52deef1

Browse files
author
Shota Aoki
authored
STEP8とSTEP13のリファクタリング (#13)
* STEP8とSTEP13のstraight関数の引数名を修正 * SPIFFSからlistdir関数を削除
1 parent e796260 commit 52deef1

File tree

4 files changed

+4
-68
lines changed

4 files changed

+4
-68
lines changed

uROS_STEP13_micromouse/SPIFFS.ino

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
void listDir(fs::FS & fs, const char * dirname, uint8_t levels)
16-
{
17-
Serial.printf("Listing directory: %s\r\n", dirname);
18-
19-
File root = fs.open(dirname);
20-
if (!root) {
21-
Serial.println("- failed to open directory");
22-
return;
23-
}
24-
if (!root.isDirectory()) {
25-
Serial.println(" - not a directory");
26-
return;
27-
}
28-
29-
File file = root.openNextFile();
30-
while (file) {
31-
if (file.isDirectory()) {
32-
Serial.print(" DIR : ");
33-
Serial.println(file.name());
34-
if (levels) {
35-
listDir(fs, file.name(), levels - 1);
36-
}
37-
} else {
38-
Serial.print(" FILE: ");
39-
Serial.print(file.name());
40-
Serial.print("\tSIZE: ");
41-
Serial.println(file.size());
42-
}
43-
file = root.openNextFile();
44-
}
45-
}
46-
4715
void mapWrite(void)
4816
{
4917
String file_tmp;

uROS_STEP13_micromouse/run.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
void straight(int len, int init_speed, int max_sp, int finish_speed)
15+
void straight(int len, int init_speed, int max_speed, int finish_speed)
1616
{
1717
int obj_step;
1818

1919
controlInterruptStop();
20-
g_max_speed = max_sp;
20+
g_max_speed = max_speed;
2121
g_accel = SEARCH_ACCEL;
2222

2323
if (init_speed < MIN_SPEED) {

uROS_STEP8_micromouse/SPIFFS.ino

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
void listDir(fs::FS & fs, const char * dirname, uint8_t levels)
16-
{
17-
Serial.printf("Listing directory: %s\r\n", dirname);
18-
19-
File root = fs.open(dirname);
20-
if (!root) {
21-
Serial.println("- failed to open directory");
22-
return;
23-
}
24-
if (!root.isDirectory()) {
25-
Serial.println(" - not a directory");
26-
return;
27-
}
28-
29-
File file = root.openNextFile();
30-
while (file) {
31-
if (file.isDirectory()) {
32-
Serial.print(" DIR : ");
33-
Serial.println(file.name());
34-
if (levels) {
35-
listDir(fs, file.name(), levels - 1);
36-
}
37-
} else {
38-
Serial.print(" FILE: ");
39-
Serial.print(file.name());
40-
Serial.print("\tSIZE: ");
41-
Serial.println(file.size());
42-
}
43-
file = root.openNextFile();
44-
}
45-
}
46-
4715
void mapWrite(void)
4816
{
4917
String file_tmp;

uROS_STEP8_micromouse/run.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
void straight(int len, int init_speed, int max_sp, int finish_speed)
15+
void straight(int len, int init_speed, int max_speed, int finish_speed)
1616
{
1717
int obj_step;
1818

1919
controlInterruptStop();
20-
g_max_speed = max_sp;
20+
g_max_speed = max_speed;
2121
g_accel = SEARCH_ACCEL;
2222

2323
if (init_speed < MIN_SPEED) {

0 commit comments

Comments
 (0)