Skip to content

Commit

Permalink
PROS 4 Porting work
Browse files Browse the repository at this point in the history
  • Loading branch information
WillXuCodes committed May 31, 2024
1 parent bb6775f commit 9c57f6a
Show file tree
Hide file tree
Showing 301 changed files with 46,581 additions and 16,954 deletions.
32 changes: 1 addition & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Compiled Object files
*.o
*.obj
Expand All @@ -35,13 +14,4 @@ compile_commands.json
temp.log
temp.errors
*.ini
.d/

EZ-Template-Example-Project/bin/
EZ-Template-Example-Project/.vscode/
EZ-Template-Example-Project/.cache/
EZ-Template-Example-Project/compile_commands.json
EZ-Template-Example-Project/temp.log
EZ-Template-Example-Project/temp.errors
EZ-Template-Example-Project/*.ini
EZ-Template-Example-Project/.d/
.d/
2 changes: 1 addition & 1 deletion EZ-Template-Example-Project/include/EZ-Template/piston.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Piston {
/**
* Piston used throughout.
*/
pros::ADIDigitalOut piston;
pros::adi::DigitalOut piston;

/**
* Piston constructor. This class keeps track of piston state. The starting position of your piston is FALSE.
Expand Down
6 changes: 3 additions & 3 deletions EZ-Template-Example-Project/include/EZ-Template/sdcard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ inline bool auton_selector_running;

extern bool turn_off;

extern pros::ADIDigitalIn* limit_switch_left;
extern pros::ADIDigitalIn* limit_switch_right;
extern pros::adi::DigitalIn* limit_switch_left;
extern pros::adi::DigitalIn* limit_switch_right;
/**
* Initialize two limitswithces to change pages on the lcd
*
Expand All @@ -61,7 +61,7 @@ extern pros::ADIDigitalIn* limit_switch_right;
* @param right_limit_port
* port for the right limit switch
*/
void limit_switch_lcd_initialize(pros::ADIDigitalIn* right_limit, pros::ADIDigitalIn* left_limit = nullptr);
void limit_switch_lcd_initialize(pros::adi::DigitalIn* right_limit, pros::adi::DigitalIn* left_limit = nullptr);

/**
* pre_auto_task
Expand Down
14 changes: 7 additions & 7 deletions EZ-Template-Example-Project/include/pros/adi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ class ADIAnalogIn : protected ADIPort {
* this time and computes an average from approximately 500 samples, 1 ms
* apart, for a 0.5 s period of calibration. The average value thus calculated
* is returned and stored for later calls to the
* pros::ADIAnalogIn::get_value_calibrated() and
* pros::ADIAnalogIn::get_value_calibrated_HR() functions. These functions
* pros::adi::AnalogIn::get_value_calibrated() and
* pros::adi::AnalogIn::get_value_calibrated_HR() functions. These functions
* will return the difference between this value and the current sensor value
* when called.
*
Expand All @@ -172,10 +172,10 @@ class ADIAnalogIn : protected ADIPort {
/**
* Gets the 12 bit calibrated value of an analog input port.
*
* The pros::ADIAnalogIn::calibrate() function must be run first. This
* The pros::adi::AnalogIn::calibrate() function must be run first. This
* function is inappropriate for sensor values intended for integration, as
* round-off error can accumulate causing drift over time. Use
* pros::ADIAnalogIn::get_value_calibrated_HR() instead.
* pros::adi::AnalogIn::get_value_calibrated_HR() instead.
*
* This function uses the following values of errno when an error state is
* reached:
Expand All @@ -189,7 +189,7 @@ class ADIAnalogIn : protected ADIPort {
/**
* Gets the 16 bit calibrated value of an analog input port.
*
* The pros::ADIAnalogIn::calibrate() function must be run first. This is
* The pros::adi::AnalogIn::calibrate() function must be run first. This is
* intended for integrated sensor values such as gyros and accelerometers to
* reduce drift due to round-off, and should not be used on a sensor such as a
* line tracker or potentiometer.
Expand Down Expand Up @@ -735,7 +735,7 @@ class ADIPotentiometer : public ADIAnalogIn {
* this time and computes an average from approximately 500 samples, 1 ms
* apart, for a 0.5 s period of calibration. The average value thus calculated
* is returned and stored for later calls to the
* pros::ADIPotentiometer::get_value_calibrated() function. This function
* pros::adi::Potentiometer::get_value_calibrated() function. This function
* will return the difference between this value and the current sensor value
* when called.
*
Expand All @@ -752,7 +752,7 @@ class ADIPotentiometer : public ADIAnalogIn {
/**
* Gets the 12 bit calibrated value of a potentiometer port.
*
* The pros::ADIPotentiometer::calibrate() function must be run first.
* The pros::adi::Potentiometer::calibrate() function must be run first.
*
* This function uses the following values of errno when an error state is
* reached:
Expand Down
Binary file modified [email protected]
Binary file not shown.
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 added firmware/liblvgl.a
Binary file not shown.
Binary file modified firmware/libpros.a
Binary file not shown.
Binary file modified firmware/okapilib.a
Binary file not shown.
4 changes: 2 additions & 2 deletions include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ class Drive {
/**
* Left tracking wheel.
*/
pros::ADIEncoder left_tracker;
pros::adi::Encoder left_tracker;

/**
* Right tracking wheel.
*/
pros::ADIEncoder right_tracker;
pros::adi::Encoder right_tracker;

/**
* Left rotation tracker.
Expand Down
2 changes: 1 addition & 1 deletion include/EZ-Template/piston.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Piston {
/**
* Piston used throughout.
*/
pros::ADIDigitalOut piston;
pros::adi::DigitalOut piston;

/**
* Piston constructor. This class keeps track of piston state. The starting position of your piston is FALSE.
Expand Down
6 changes: 3 additions & 3 deletions include/EZ-Template/sdcard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ inline bool auton_selector_running;

extern bool turn_off;

extern pros::ADIDigitalIn* limit_switch_left;
extern pros::ADIDigitalIn* limit_switch_right;
extern pros::adi::DigitalIn* limit_switch_left;
extern pros::adi::DigitalIn* limit_switch_right;
/**
* Initialize two limitswithces to change pages on the lcd
*
Expand All @@ -61,7 +61,7 @@ extern pros::ADIDigitalIn* limit_switch_right;
* @param right_limit_port
* port for the right limit switch
*/
void limit_switch_lcd_initialize(pros::ADIDigitalIn* right_limit, pros::ADIDigitalIn* left_limit = nullptr);
void limit_switch_lcd_initialize(pros::adi::DigitalIn* right_limit, pros::adi::DigitalIn* left_limit = nullptr);

/**
* pre_auto_task
Expand Down
13 changes: 9 additions & 4 deletions include/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
#include <unistd.h>
#endif /* __cplusplus */

#define PROS_VERSION_MAJOR 3
#define PROS_VERSION_MINOR 8
#define PROS_VERSION_PATCH 3
#define PROS_VERSION_STRING "3.8.3"
#define PROS_VERSION_MAJOR 4
#define PROS_VERSION_MINOR 1

#define PROS_VERSION_PATCH 0
#define PROS_VERSION_STRING "4.1.0"

#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 @@ -63,12 +65,15 @@

#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"
Expand Down
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.

12 changes: 0 additions & 12 deletions include/display/lv_core/lv_core.mk

This file was deleted.

Loading

0 comments on commit 9c57f6a

Please sign in to comment.