Skip to content

Commit aa32e7a

Browse files
authored
Merge pull request #24 from LemLib/dep/pros-4.1.1
⬆️ upgrade PROS to 4.1.1
2 parents bc71d9f + a47c7ca commit aa32e7a

File tree

9 files changed

+124
-56
lines changed

9 files changed

+124
-56
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ IS_LIBRARY:=1
2929
# Be sure that your header files are in the include directory inside of a folder with the
3030
# same name as what you set LIBNAME to below.
3131
LIBNAME:=units
32-
VERSION:=0.3.0
32+
VERSION:=0.3.1
3333
# EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c
3434
# this line excludes opcontrol.c and similar files
3535
EXCLUDE_SRC_FROM_LIB+=$(foreach file, $(SRCDIR)/main,$(foreach cext,$(CEXTS),$(file).$(cext)) $(foreach cxxext,$(CXXEXTS),$(file).$(cxxext)))

firmware/libpros.a

-1.73 MB
Binary file not shown.

include/api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141

4242
#define PROS_VERSION_MAJOR 4
4343
#define PROS_VERSION_MINOR 1
44+
#define PROS_VERSION_PATCH 1
45+
#define PROS_VERSION_STRING "4.1.1"
4446

45-
#define PROS_VERSION_PATCH 0
46-
#define PROS_VERSION_STRING "4.1.0"
4747

4848
#include "pros/adi.h"
4949
#include "pros/colors.h"

include/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
* For instance, E_CONTROLLER_MASTER has a shorter name: CONTROLLER_MASTER.
2424
* E_CONTROLLER_MASTER is pedantically correct within the PROS styleguide, but
25-
* not convienent for most student programmers.
25+
* not convenient for most student programmers.
2626
*/
2727
#define PROS_USE_SIMPLE_NAMES
2828

include/pros/optical.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,39 @@ int32_t optical_enable_gesture(uint8_t port);
460460
*/
461461
int32_t optical_disable_gesture(uint8_t port);
462462

463+
/**
464+
* Get integration time (update rate) of the optical sensor in milliseconds, with
465+
* minimum time being
466+
*
467+
* This function uses the following values of errno when an error state is
468+
* reached:
469+
* ENXIO - The given value is not within the range of V5 ports (1-21).
470+
* ENODEV - The port cannot be configured as an Optical Sensor
471+
*
472+
* \param port
473+
* The V5 Optical Sensor port number from 1-21
474+
* \return Integration time in milliseconds if the operation is successful
475+
* or PROS_ERR if the operation failed, setting errno.
476+
*/
477+
double optical_get_integration_time(uint8_t port);
478+
479+
/**
480+
* Set integration time (update rate) of the optical sensor in milliseconds.
481+
*
482+
* This function uses the following values of errno when an error state is
483+
* reached:
484+
* ENXIO - The given value is not within the range of V5 ports (1-21).
485+
* ENODEV - The port cannot be configured as an Optical Sensor
486+
*
487+
* \param port
488+
* The V5 Optical Sensor port number from 1-21
489+
* \param time
490+
* The desired integration time in milliseconds
491+
* \return 1 if the operation is successful or PROS_ERR if the operation failed,
492+
* setting errno.
493+
*/
494+
int32_t optical_set_integration_time(uint8_t port, double time);
495+
463496
///@}
464497

465498
///@}

include/pros/optical.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,36 @@ class Optical : public Device {
398398
*/
399399
virtual std::int32_t disable_gesture();
400400

401+
/**
402+
* Set integration time (update rate) of the optical sensor in milliseconds, with
403+
* minimum time being 3 ms and maximum time being 712 ms. Default is 100 ms, with the
404+
* optical sensor communciating with the V5 brain every 20 ms.
405+
*
406+
* This function uses the following values of errno when an error state is
407+
* reached:
408+
* ENXIO - The given value is not within the range of V5 ports (1-21).
409+
* ENODEV - The port cannot be configured as an Optical Sensor
410+
*
411+
* \return 1 if the operation is successful or PROS_ERR_F if the operation failed,
412+
* setting errno.
413+
*/
414+
double get_integration_time();
415+
416+
/**
417+
* Get integration time (update rate) of the optical sensor in milliseconds.
418+
*
419+
* This function uses the following values of errno when an error state is
420+
* reached:
421+
* ENXIO - The given value is not within the range of V5 ports (1-21).
422+
* ENODEV - The port cannot be configured as an Optical Sensor
423+
*
424+
* \param time
425+
* The desired integration time in milliseconds
426+
* \return Integration time in milliseconds if the operation is successful
427+
* or PROS_ERR if the operation failed, setting errno.
428+
*/
429+
std::int32_t set_integration_time(double time);
430+
401431
/**
402432
* This is the overload for the << operator for printing to streams
403433
*

include/units/units.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <ratio>
66
#include <iostream>
77
#include <utility>
8+
#include <algorithm>
89

910
// define M_PI if not already defined
1011
#ifndef M_PI

project.pros

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"target": "v5",
66
"templates": {
77
"kernel": {
8-
"location": "C:\\Users\\liamt\\AppData\\Roaming\\PROS\\templates\\[email protected].0",
8+
"location": "C:\\Users\\Liam Teale\\AppData\\Roaming\\PROS\\templates\\[email protected].1",
99
"metadata": {
1010
"cold_addr": "58720256",
1111
"cold_output": "bin/cold.package.bin",
@@ -18,64 +18,64 @@
1818
"py/object": "pros.conductor.templates.local_template.LocalTemplate",
1919
"supported_kernels": null,
2020
"system_files": [
21-
"include\\pros\\rtos.hpp",
22-
"firmware\\libpros.a",
23-
"include\\pros\\imu.hpp",
21+
"include/pros/gps.hpp",
22+
"include/pros/motors.h",
23+
"include/pros/error.h",
24+
"include/pros/imu.hpp",
25+
"include/pros/serial.h",
26+
"include/pros/rtos.h",
27+
"include/pros/optical.hpp",
28+
"firmware/libc.a",
29+
"include/pros/distance.hpp",
30+
"include/pros/rotation.h",
2431
"common.mk",
25-
"include\\pros\\rotation.hpp",
26-
"include\\pros\\abstract_motor.hpp",
27-
"include\\pros\\serial.h",
28-
"include\\pros\\vision.hpp",
29-
"include\\pros\\colors.h",
30-
"include\\pros\\colors.hpp",
31-
"include\\pros\\device.hpp",
32-
"include\\pros\\misc.h",
33-
"include\\api.h",
34-
"include\\pros\\link.h",
35-
"firmware\\v5-hot.ld",
36-
"include\\pros\\distance.h",
37-
"firmware\\v5-common.ld",
38-
"include\\pros\\imu.h",
39-
"include\\pros\\motor_group.hpp",
40-
"include\\pros\\vision.h",
41-
"include\\pros\\misc.hpp",
42-
"include\\pros\\adi.h",
43-
"include\\pros\\screen.h",
44-
"include\\pros\\motors.h",
45-
"include\\pros\\llemu.h",
46-
"include\\pros\\adi.hpp",
47-
"include\\pros\\device.h",
48-
"include\\pros\\motors.hpp",
49-
"include\\pros\\serial.hpp",
50-
"include\\pros\\ext_adi.h",
51-
"include\\pros\\apix.h",
52-
"include\\pros\\rtos.h",
53-
"include\\pros\\rotation.h",
54-
"include\\pros\\llemu.hpp",
55-
"firmware\\libc.a",
56-
"firmware\\v5.ld",
57-
"include\\pros\\gps.h",
58-
"include\\pros\\optical.hpp",
59-
"include\\pros\\gps.hpp",
60-
"firmware\\libm.a",
61-
"include\\pros\\distance.hpp",
62-
"include\\pros\\link.hpp",
63-
"include\\pros\\optical.h",
64-
"include\\pros\\screen.hpp",
65-
"include\\pros\\error.h"
32+
"include/pros/motors.hpp",
33+
"firmware/v5.ld",
34+
"include/pros/gps.h",
35+
"include/pros/link.hpp",
36+
"include/pros/colors.h",
37+
"include/pros/imu.h",
38+
"include/pros/adi.hpp",
39+
"include/pros/ext_adi.h",
40+
"include/pros/misc.hpp",
41+
"include/pros/link.h",
42+
"include/pros/device.h",
43+
"include/pros/misc.h",
44+
"firmware/v5-common.ld",
45+
"include/pros/adi.h",
46+
"include/pros/abstract_motor.hpp",
47+
"include/api.h",
48+
"firmware/v5-hot.ld",
49+
"firmware/libm.a",
50+
"include/pros/device.hpp",
51+
"include/pros/apix.h",
52+
"include/pros/llemu.h",
53+
"include/pros/vision.hpp",
54+
"include/pros/serial.hpp",
55+
"include/pros/llemu.hpp",
56+
"include/pros/colors.hpp",
57+
"include/pros/rotation.hpp",
58+
"include/pros/distance.h",
59+
"include/pros/rtos.hpp",
60+
"include/pros/vision.h",
61+
"include/pros/screen.h",
62+
"include/pros/optical.h",
63+
"firmware/libpros.a",
64+
"include/pros/motor_group.hpp",
65+
"include/pros/screen.hpp"
6666
],
6767
"target": "v5",
6868
"user_files": [
69-
"src\\main.c",
70-
"include\\main.hh",
69+
"src/main.cpp",
70+
"src/main.c",
7171
"Makefile",
72-
"include\\main.h",
72+
"src/main.cc",
73+
"include/main.h",
7374
".gitignore",
74-
"src\\main.cc",
75-
"include\\main.hpp",
76-
"src\\main.cpp"
75+
"include/main.hh",
76+
"include/main.hpp"
7777
],
78-
"version": "4.1.0"
78+
"version": "4.1.1"
7979
}
8080
},
8181
"upload_options": {},

src/units/dummy.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// this file exists to force the PROS build script to produce a .a file
2+
// otherwise units does not compile reliably on all platforms
3+
// and the pros conductor will not let you create a template if there is
4+
// no .a file

0 commit comments

Comments
 (0)