Skip to content

Commit

Permalink
Merge pull request #24 from LemLib/dep/pros-4.1.1
Browse files Browse the repository at this point in the history
⬆️ upgrade PROS to 4.1.1
  • Loading branch information
sufferiing authored Nov 21, 2024
2 parents bc71d9f + a47c7ca commit aa32e7a
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ IS_LIBRARY:=1
# Be sure that your header files are in the include directory inside of a folder with the
# same name as what you set LIBNAME to below.
LIBNAME:=units
VERSION:=0.3.0
VERSION:=0.3.1
# EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c
# this line excludes opcontrol.c and similar files
EXCLUDE_SRC_FROM_LIB+=$(foreach file, $(SRCDIR)/main,$(foreach cext,$(CEXTS),$(file).$(cext)) $(foreach cxxext,$(CXXEXTS),$(file).$(cxxext)))
Expand Down
Binary file modified firmware/libpros.a
Binary file not shown.
4 changes: 2 additions & 2 deletions include/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@

#define PROS_VERSION_MAJOR 4
#define PROS_VERSION_MINOR 1
#define PROS_VERSION_PATCH 1
#define PROS_VERSION_STRING "4.1.1"

#define PROS_VERSION_PATCH 0
#define PROS_VERSION_STRING "4.1.0"

#include "pros/adi.h"
#include "pros/colors.h"
Expand Down
2 changes: 1 addition & 1 deletion include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* For instance, E_CONTROLLER_MASTER has a shorter name: CONTROLLER_MASTER.
* E_CONTROLLER_MASTER is pedantically correct within the PROS styleguide, but
* not convienent for most student programmers.
* not convenient for most student programmers.
*/
#define PROS_USE_SIMPLE_NAMES

Expand Down
33 changes: 33 additions & 0 deletions include/pros/optical.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,39 @@ int32_t optical_enable_gesture(uint8_t port);
*/
int32_t optical_disable_gesture(uint8_t port);

/**
* Get integration time (update rate) of the optical sensor in milliseconds, with
* minimum time being
*
* This function uses the following values of errno when an error state is
* reached:
* ENXIO - The given value is not within the range of V5 ports (1-21).
* ENODEV - The port cannot be configured as an Optical Sensor
*
* \param port
* The V5 Optical Sensor port number from 1-21
* \return Integration time in milliseconds if the operation is successful
* or PROS_ERR if the operation failed, setting errno.
*/
double optical_get_integration_time(uint8_t port);

/**
* Set integration time (update rate) of the optical sensor in milliseconds.
*
* This function uses the following values of errno when an error state is
* reached:
* ENXIO - The given value is not within the range of V5 ports (1-21).
* ENODEV - The port cannot be configured as an Optical Sensor
*
* \param port
* The V5 Optical Sensor port number from 1-21
* \param time
* The desired integration time in milliseconds
* \return 1 if the operation is successful or PROS_ERR if the operation failed,
* setting errno.
*/
int32_t optical_set_integration_time(uint8_t port, double time);

///@}

///@}
Expand Down
30 changes: 30 additions & 0 deletions include/pros/optical.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,36 @@ class Optical : public Device {
*/
virtual std::int32_t disable_gesture();

/**
* Set integration time (update rate) of the optical sensor in milliseconds, with
* minimum time being 3 ms and maximum time being 712 ms. Default is 100 ms, with the
* optical sensor communciating with the V5 brain every 20 ms.
*
* This function uses the following values of errno when an error state is
* reached:
* ENXIO - The given value is not within the range of V5 ports (1-21).
* ENODEV - The port cannot be configured as an Optical Sensor
*
* \return 1 if the operation is successful or PROS_ERR_F if the operation failed,
* setting errno.
*/
double get_integration_time();

/**
* Get integration time (update rate) of the optical sensor in milliseconds.
*
* This function uses the following values of errno when an error state is
* reached:
* ENXIO - The given value is not within the range of V5 ports (1-21).
* ENODEV - The port cannot be configured as an Optical Sensor
*
* \param time
* The desired integration time in milliseconds
* \return Integration time in milliseconds if the operation is successful
* or PROS_ERR if the operation failed, setting errno.
*/
std::int32_t set_integration_time(double time);

/**
* This is the overload for the << operator for printing to streams
*
Expand Down
1 change: 1 addition & 0 deletions include/units/units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <ratio>
#include <iostream>
#include <utility>
#include <algorithm>

// define M_PI if not already defined
#ifndef M_PI
Expand Down
104 changes: 52 additions & 52 deletions project.pros
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"target": "v5",
"templates": {
"kernel": {
"location": "C:\\Users\\liamt\\AppData\\Roaming\\PROS\\templates\\[email protected].0",
"location": "C:\\Users\\Liam Teale\\AppData\\Roaming\\PROS\\templates\\[email protected].1",
"metadata": {
"cold_addr": "58720256",
"cold_output": "bin/cold.package.bin",
Expand All @@ -18,64 +18,64 @@
"py/object": "pros.conductor.templates.local_template.LocalTemplate",
"supported_kernels": null,
"system_files": [
"include\\pros\\rtos.hpp",
"firmware\\libpros.a",
"include\\pros\\imu.hpp",
"include/pros/gps.hpp",
"include/pros/motors.h",
"include/pros/error.h",
"include/pros/imu.hpp",
"include/pros/serial.h",
"include/pros/rtos.h",
"include/pros/optical.hpp",
"firmware/libc.a",
"include/pros/distance.hpp",
"include/pros/rotation.h",
"common.mk",
"include\\pros\\rotation.hpp",
"include\\pros\\abstract_motor.hpp",
"include\\pros\\serial.h",
"include\\pros\\vision.hpp",
"include\\pros\\colors.h",
"include\\pros\\colors.hpp",
"include\\pros\\device.hpp",
"include\\pros\\misc.h",
"include\\api.h",
"include\\pros\\link.h",
"firmware\\v5-hot.ld",
"include\\pros\\distance.h",
"firmware\\v5-common.ld",
"include\\pros\\imu.h",
"include\\pros\\motor_group.hpp",
"include\\pros\\vision.h",
"include\\pros\\misc.hpp",
"include\\pros\\adi.h",
"include\\pros\\screen.h",
"include\\pros\\motors.h",
"include\\pros\\llemu.h",
"include\\pros\\adi.hpp",
"include\\pros\\device.h",
"include\\pros\\motors.hpp",
"include\\pros\\serial.hpp",
"include\\pros\\ext_adi.h",
"include\\pros\\apix.h",
"include\\pros\\rtos.h",
"include\\pros\\rotation.h",
"include\\pros\\llemu.hpp",
"firmware\\libc.a",
"firmware\\v5.ld",
"include\\pros\\gps.h",
"include\\pros\\optical.hpp",
"include\\pros\\gps.hpp",
"firmware\\libm.a",
"include\\pros\\distance.hpp",
"include\\pros\\link.hpp",
"include\\pros\\optical.h",
"include\\pros\\screen.hpp",
"include\\pros\\error.h"
"include/pros/motors.hpp",
"firmware/v5.ld",
"include/pros/gps.h",
"include/pros/link.hpp",
"include/pros/colors.h",
"include/pros/imu.h",
"include/pros/adi.hpp",
"include/pros/ext_adi.h",
"include/pros/misc.hpp",
"include/pros/link.h",
"include/pros/device.h",
"include/pros/misc.h",
"firmware/v5-common.ld",
"include/pros/adi.h",
"include/pros/abstract_motor.hpp",
"include/api.h",
"firmware/v5-hot.ld",
"firmware/libm.a",
"include/pros/device.hpp",
"include/pros/apix.h",
"include/pros/llemu.h",
"include/pros/vision.hpp",
"include/pros/serial.hpp",
"include/pros/llemu.hpp",
"include/pros/colors.hpp",
"include/pros/rotation.hpp",
"include/pros/distance.h",
"include/pros/rtos.hpp",
"include/pros/vision.h",
"include/pros/screen.h",
"include/pros/optical.h",
"firmware/libpros.a",
"include/pros/motor_group.hpp",
"include/pros/screen.hpp"
],
"target": "v5",
"user_files": [
"src\\main.c",
"include\\main.hh",
"src/main.cpp",
"src/main.c",
"Makefile",
"include\\main.h",
"src/main.cc",
"include/main.h",
".gitignore",
"src\\main.cc",
"include\\main.hpp",
"src\\main.cpp"
"include/main.hh",
"include/main.hpp"
],
"version": "4.1.0"
"version": "4.1.1"
}
},
"upload_options": {},
Expand Down
4 changes: 4 additions & 0 deletions src/units/dummy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// this file exists to force the PROS build script to produce a .a file
// otherwise units does not compile reliably on all platforms
// and the pros conductor will not let you create a template if there is
// no .a file

0 comments on commit aa32e7a

Please sign in to comment.