Skip to content

Commit

Permalink
Convert to PROS 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nikgajjar51 committed Feb 10, 2024
1 parent deae3c4 commit 9274aa6
Show file tree
Hide file tree
Showing 138 changed files with 16,266 additions and 18,011 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ compile_commands.json
temp.log
temp.errors
*.ini
.d/

#Added
*.txt
.d/
17 changes: 15 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ MFLAGS=-mcpu=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=softfp -Os -g
CPPFLAGS=-D_POSIX_THREADS -D_UNIX98_THREAD_MUTEX_ATTRIBUTES -D_POSIX_TIMERS -D_POSIX_MONOTONIC_CLOCK
GCCFLAGS=-ffunction-sections -fdata-sections -fdiagnostics-color -funwind-tables

# Check if the llemu files in libvgl exist. If they do, define macros that the
# llemu headers in the kernel repo can use to conditionally include the libvgl
# versions
ifneq (,$(wildcard ./include/liblvgl/llemu.h))
CPPFLAGS += -D_PROS_INCLUDE_LIBLVGL_LLEMU_H
endif
ifneq (,$(wildcard ./include/liblvgl/llemu.hpp))
CPPFLAGS += -D_PROS_INCLUDE_LIBLVGL_LLEMU_HPP
endif

WARNFLAGS+=-Wno-psabi

SPACE := $() $()
COMMA := ,

C_STANDARD?=gnu11
CXX_STANDARD?=gnu++20

DEPDIR := .d
$(shell mkdir -p $(DEPDIR))
DEPFLAGS = -MT $$@ -MMD -MP -MF $(DEPDIR)/$$*.Td
Expand All @@ -24,8 +37,8 @@ wlprefix=-Wl,$(subst $(SPACE),$(COMMA),$1)
LNK_FLAGS=--gc-sections --start-group $(strip $(LIBRARIES)) -lgcc -lstdc++ --end-group -T$(FWDIR)/v5-common.ld

ASMFLAGS=$(MFLAGS) $(WARNFLAGS)
CFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu11
CXXFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu++17
CFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=$(C_STANDARD)
CXXFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=$(CXX_STANDARD)
LDFLAGS=$(MFLAGS) $(WARNFLAGS) -nostdlib $(GCCFLAGS)
SIZEFLAGS=-d --common
NUMFMTFLAGS=--to=iec --format %.2f --suffix=B
Expand Down
Binary file modified firmware/libpros.a
Binary file not shown.
16 changes: 10 additions & 6 deletions include/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
#include <unistd.h>
#endif /* __cplusplus */

#define PROS_VERSION_MAJOR 3
#define PROS_VERSION_MINOR 8
#define PROS_VERSION_PATCH 0
#define PROS_VERSION_STRING "3.8.0"
#define PROS_VERSION_MAJOR 4
#define PROS_VERSION_MINOR 0
#define PROS_VERSION_PATCH 6
#define PROS_VERSION_STRING "4.0.6"

#include "pros/adi.h"
#include "pros/colors.h"
#include "pros/device.h"
#include "pros/distance.h"
#include "pros/error.h"
#include "pros/ext_adi.h"
Expand All @@ -56,25 +57,28 @@
#include "pros/misc.h"
#include "pros/motors.h"
#include "pros/optical.h"
#include "pros/rtos.h"
#include "pros/rotation.h"
#include "pros/rtos.h"
#include "pros/screen.h"
#include "pros/vision.h"

#ifdef __cplusplus
#include "pros/adi.hpp"
#include "pros/colors.hpp"
#include "pros/device.hpp"
#include "pros/distance.hpp"
#include "pros/gps.hpp"
#include "pros/imu.hpp"
#include "pros/link.hpp"
#include "pros/llemu.hpp"
#include "pros/misc.hpp"
#include "pros/motor_group.hpp"
#include "pros/motors.hpp"
#include "pros/optical.hpp"
#include "pros/rotation.hpp"
#include "pros/rtos.hpp"
#include "pros/screen.hpp"
#include "pros/vision.hpp"
#include "pros/link.hpp"
#endif

#endif // _PROS_API_H_
20 changes: 10 additions & 10 deletions include/apollo/chassis/chassisTankModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,56 @@ class Tank : public Chassis {
std::vector<pros::Motor> left_motors;
std::vector<pros::Motor> right_motors;
pros::Imu inertial_sensor;
pros::ADIEncoder left_adi_encoder_tracker;
pros::ADIEncoder right_adi_encoder_tracker;
pros::ADIEncoder center_adi_encoder_tracker;
pros::adi::Encoder left_adi_encoder_tracker;
pros::adi::Encoder right_adi_encoder_tracker;
pros::adi::Encoder center_adi_encoder_tracker;
pros::Rotation left_rotation_tracker;
pros::Rotation right_rotation_tracker;
pros::Rotation center_rotation_tracker;
// Tank Drive - Motor encoders
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge);
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge);
// Tank Drive - ADI Encoders (Left, Right)
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge,
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge,
std::vector<int> left_adi_encoder_ports,
std::vector<int> right_adi_encoder_ports, double tracker_wheel_diameter,
double tracker_gear_ratio);
// Tank Drive - ADI Encoders (Left, Right, Center)
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge,
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge,
std::vector<int> left_adi_encoder_ports,
std::vector<int> right_adi_encoder_ports,
std::vector<int> center_adi_encoder_ports, double tracker_wheel_diameter,
double tracker_gear_ratio);
// Tank Drive - ADI Encoders (Left, Right) in expander
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge,
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge,
std::vector<int> left_adi_encoder_ports,
std::vector<int> right_adi_encoder_ports, int expander_smart_port,
double tracker_wheel_diameter, double tracker_gear_ratio);
// Tank Drive - ADI Encoders (Left, Right, Center) in expander
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge,
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge,
std::vector<int> left_adi_encoder_ports,
std::vector<int> right_adi_encoder_ports,
std::vector<int> center_adi_encoder_ports, int expander_smart_port,
double tracker_wheel_diameter, double tracker_gear_ratio);
// Tank Drive - Rotation Sensors (Left, Right)
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge,
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge,
int left_rotation_port, int right_rotation_port,
double tracker_wheel_diameter, double tracker_gear_ratio);
// Tank Drive - Rotation Sensors (Left, Right, Center)
Tank(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports,
int inertial_sensor_port, double drivetrain_wheel_diameter,
double drivetrain_gear_ratio, double drivetrain_motor_catridge,
double drivetrain_gear_ratio, pros::v5::MotorGears drivetrain_motor_cartridge,
int left_rotation_port, int right_rotation_port,
int center_rotation_port, double tracker_wheel_diameter,
double tracker_gear_ratio);
Expand Down
2 changes: 2 additions & 0 deletions include/apollo/util/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "pros/misc.hpp"
#include "pros/motors.hpp"
extern pros::Controller master;

namespace apollo {
Expand All @@ -21,5 +22,6 @@ enum chassis_control_type {
FLIPPED_SPLIT_JOYSTICK
};
bool is_reversed(double input);
extern int convert_gear_ratio(pros::v5::MotorGears input);
} // namespace util
} // namespace apollo
71 changes: 0 additions & 71 deletions include/display/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions include/display/licence.txt

This file was deleted.

Loading

0 comments on commit 9274aa6

Please sign in to comment.