From 76a3360e829ef4d30a3986c5daf5a223b1af4de6 Mon Sep 17 00:00:00 2001 From: Michael Ben-Zvi Date: Sun, 23 Oct 2022 22:55:45 -0700 Subject: [PATCH] updated names in sdcard.hpp EZ-Robotics#65 --- include/EZ-Template/sdcard.hpp | 10 +++++----- src/EZ-Template/sdcard.cpp | 34 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/EZ-Template/sdcard.hpp b/include/EZ-Template/sdcard.hpp index cf977302..90306713 100644 --- a/include/EZ-Template/sdcard.hpp +++ b/include/EZ-Template/sdcard.hpp @@ -15,12 +15,12 @@ extern AutonSelector auton_selector; /** * Sets sd card to current page. */ -void init_auton_selector(); +void auton_selector_init(); /** * Sets the sd card to current page. */ -void update_auto_sd(); +void auton_sd_update(); /** * Increases the page by 1. @@ -44,8 +44,8 @@ void shutdown(); extern bool turn_off; -extern pros::ADIDigitalIn* left_limit_switch; -extern pros::ADIDigitalIn* right_limit_switch; +extern pros::ADIDigitalIn* limit_switch_left; +extern pros::ADIDigitalIn* limit_switch_right; /** * Initialize two limitswithces to change pages on the lcd * @@ -59,6 +59,6 @@ void limit_switch_lcd_initialize(pros::ADIDigitalIn* right_limit, pros::ADIDigit /** * pre_auto_task */ -void limitSwitchTask(); +void limit_switch_task(); } // namespace as } // namespace ez diff --git a/src/EZ-Template/sdcard.cpp b/src/EZ-Template/sdcard.cpp index 0ac0e87d..30146d22 100644 --- a/src/EZ-Template/sdcard.cpp +++ b/src/EZ-Template/sdcard.cpp @@ -11,7 +11,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. namespace ez::as { AutonSelector auton_selector{}; -void update_auto_sd() { +void auton_sd_update() { // If no SD card, return if (!ez::util::SD_CARD_ACTIVE) return; @@ -22,7 +22,7 @@ void update_auto_sd() { fclose(usd_file_write); } -void init_auton_selector() { +void auton_selector_init() { // If no SD card, return if (!ez::util::SD_CARD_ACTIVE) return; @@ -36,13 +36,13 @@ void init_auton_selector() { } // If file doesn't exist, create file else { - update_auto_sd(); // Writing to a file that doesn't exist creates the file + auton_sd_update(); // Writing to a file that doesn't exist creates the file printf("Created auto.txt\n"); } if (ez::as::auton_selector.current_auton_page > ez::as::auton_selector.auton_count - 1 || ez::as::auton_selector.current_auton_page < 0) { ez::as::auton_selector.current_auton_page = 0; - ez::as::update_auto_sd(); + ez::as::auton_sd_update(); } } @@ -51,7 +51,7 @@ void page_up() { auton_selector.current_auton_page = 0; else auton_selector.current_auton_page++; - update_auto_sd(); + auton_sd_update(); auton_selector.print_selected_auton(); } @@ -60,14 +60,14 @@ void page_down() { auton_selector.current_auton_page = auton_selector.auton_count - 1; else auton_selector.current_auton_page--; - update_auto_sd(); + auton_sd_update(); auton_selector.print_selected_auton(); } void initialize() { // Initialize auto selector and LLEMU pros::lcd::initialize(); - ez::as::init_auton_selector(); + ez::as::auton_selector_init(); // Callbacks for auto selector ez::as::auton_selector.print_selected_auton(); @@ -82,28 +82,28 @@ void shutdown() { bool turn_off = false; // Using a button to control the lcd -pros::ADIDigitalIn* left_limit_switch = nullptr; -pros::ADIDigitalIn* right_limit_switch = nullptr; -pros::Task limit_switch_task(limitSwitchTask); +pros::ADIDigitalIn* limit_switch_left = nullptr; +pros::ADIDigitalIn* limit_switch_right = nullptr; +pros::Task limit_switch_task(limit_switch_task); void limit_switch_lcd_initialize(pros::ADIDigitalIn* right_limit, pros::ADIDigitalIn* left_limit) { if (!left_limit && !right_limit) { - delete left_limit_switch; - delete right_limit_switch; + delete limit_switch_left; + delete limit_switch_right; if (pros::millis() <= 100) turn_off = true; return; } turn_off = false; - right_limit_switch = right_limit; - left_limit_switch = left_limit; + limit_switch_right = right_limit; + limit_switch_left = left_limit; limit_switch_task.resume(); } -void limitSwitchTask() { +void limit_switch_task() { while (true) { - if (right_limit_switch && right_limit_switch->get_new_press()) + if (limit_switch_right && limit_switch_right->get_new_press()) page_up(); - else if (left_limit_switch && left_limit_switch->get_new_press()) + else if (limit_switch_left && limit_switch_left->get_new_press()) page_down(); if (pros::millis() >= 500 && turn_off)