Skip to content

Commit 9d03850

Browse files
committed
update PROS, units
1 parent 92352b1 commit 9d03850

File tree

12 files changed

+526
-397
lines changed

12 files changed

+526
-397
lines changed

firmware/libpros.a

-1.73 MB
Binary file not shown.

firmware/units.a

1.99 KB
Binary file not shown.

firmware/v5-common.ld

Lines changed: 263 additions & 263 deletions
Large diffs are not rendered by default.

firmware/v5-hot.ld

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
/* This stack is used during initialization, but FreeRTOS tasks have their own
2-
stack allocated in BSS or Heap (kernel tasks in FreeRTOS .bss heap; user tasks
3-
in standard heap) */
4-
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
5-
6-
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
7-
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
8-
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
9-
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
10-
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
11-
12-
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x02E00000; /* ~48 MB */
13-
14-
/* Define Memories in the system */
15-
start_of_cold_mem = 0x03800000;
16-
_COLD_MEM_SIZE = 0x04800000;
17-
end_of_cold_mem = start_of_cold_mem + _COLD_MEM_SIZE;
18-
19-
start_of_hot_mem = 0x07800000;
20-
_HOT_MEM_SIZE = 0x00800000;
21-
end_of_hot_mem = start_of_hot_mem + _HOT_MEM_SIZE;
22-
23-
MEMORY
24-
{
25-
/* user code 72M */
26-
COLD_MEMORY : ORIGIN = start_of_cold_mem, LENGTH = _COLD_MEM_SIZE /* Just under 19 MB */
27-
HEAP : ORIGIN = 0x04A00000, LENGTH = _HEAP_SIZE
28-
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
29-
}
30-
31-
REGION_ALIAS("RAM", HOT_MEMORY);
32-
33-
ENTRY(install_hot_table)
1+
/* This stack is used during initialization, but FreeRTOS tasks have their own
2+
stack allocated in BSS or Heap (kernel tasks in FreeRTOS .bss heap; user tasks
3+
in standard heap) */
4+
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
5+
6+
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
7+
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
8+
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
9+
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
10+
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
11+
12+
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x02E00000; /* ~48 MB */
13+
14+
/* Define Memories in the system */
15+
start_of_cold_mem = 0x03800000;
16+
_COLD_MEM_SIZE = 0x04800000;
17+
end_of_cold_mem = start_of_cold_mem + _COLD_MEM_SIZE;
18+
19+
start_of_hot_mem = 0x07800000;
20+
_HOT_MEM_SIZE = 0x00800000;
21+
end_of_hot_mem = start_of_hot_mem + _HOT_MEM_SIZE;
22+
23+
MEMORY
24+
{
25+
/* user code 72M */
26+
COLD_MEMORY : ORIGIN = start_of_cold_mem, LENGTH = _COLD_MEM_SIZE /* Just under 19 MB */
27+
HEAP : ORIGIN = 0x04A00000, LENGTH = _HEAP_SIZE
28+
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
29+
}
30+
31+
REGION_ALIAS("RAM", HOT_MEMORY);
32+
33+
ENTRY(install_hot_table)

firmware/v5.ld

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
/* This stack is used during initialization, but FreeRTOS tasks have their own
2-
stack allocated in BSS or Heap (kernel tasks in FreeRTOS .bss heap; user tasks
3-
in standard heap) */
4-
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
5-
6-
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
7-
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
8-
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
9-
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
10-
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
11-
12-
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x02E00000; /* ~48 MB */
13-
14-
/* Define Memories in the system */
15-
start_of_cold_mem = 0x03800000;
16-
_COLD_MEM_SIZE = 0x04800000;
17-
end_of_cold_mem = start_of_cold_mem + _COLD_MEM_SIZE;
18-
19-
start_of_hot_mem = 0x07800000;
20-
_HOT_MEM_SIZE = 0x00800000;
21-
end_of_hot_mem = start_of_hot_mem + _HOT_MEM_SIZE;
22-
23-
MEMORY
24-
{
25-
/* user code 72M */
26-
COLD_MEMORY : ORIGIN = start_of_cold_mem, LENGTH = _COLD_MEM_SIZE /* Just under 19 MB */
27-
HEAP : ORIGIN = 0x04A00000, LENGTH = _HEAP_SIZE
28-
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
29-
}
30-
31-
REGION_ALIAS("RAM", COLD_MEMORY);
32-
33-
ENTRY(vexStartup)
1+
/* This stack is used during initialization, but FreeRTOS tasks have their own
2+
stack allocated in BSS or Heap (kernel tasks in FreeRTOS .bss heap; user tasks
3+
in standard heap) */
4+
_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x2000;
5+
6+
_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 1024;
7+
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 2048;
8+
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : 1024;
9+
_FIQ_STACK_SIZE = DEFINED(_FIQ_STACK_SIZE) ? _FIQ_STACK_SIZE : 1024;
10+
_UNDEF_STACK_SIZE = DEFINED(_UNDEF_STACK_SIZE) ? _UNDEF_STACK_SIZE : 1024;
11+
12+
_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x02E00000; /* ~48 MB */
13+
14+
/* Define Memories in the system */
15+
start_of_cold_mem = 0x03800000;
16+
_COLD_MEM_SIZE = 0x04800000;
17+
end_of_cold_mem = start_of_cold_mem + _COLD_MEM_SIZE;
18+
19+
start_of_hot_mem = 0x07800000;
20+
_HOT_MEM_SIZE = 0x00800000;
21+
end_of_hot_mem = start_of_hot_mem + _HOT_MEM_SIZE;
22+
23+
MEMORY
24+
{
25+
/* user code 72M */
26+
COLD_MEMORY : ORIGIN = start_of_cold_mem, LENGTH = _COLD_MEM_SIZE /* Just under 19 MB */
27+
HEAP : ORIGIN = 0x04A00000, LENGTH = _HEAP_SIZE
28+
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
29+
}
30+
31+
REGION_ALIAS("RAM", COLD_MEMORY);
32+
33+
ENTRY(vexStartup)

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/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/Angle.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ class Angle : public Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::
1616
std::ratio<0>, std::ratio<0>>(value) {};
1717
};
1818

19+
template <> struct LookupName<Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>,
20+
std::ratio<0>, std::ratio<0>, std::ratio<0>>> {
21+
using Named = Angle;
22+
};
23+
24+
inline std::ostream& operator<<(std::ostream& os, const Angle& quantity) {
25+
os << quantity.internal() << " rad";
26+
return os;
27+
}
28+
1929
constexpr Angle rad = Angle(1.0);
2030
constexpr Angle deg = Angle(M_PI / 180);
2131
constexpr Angle rot = Angle(M_TWOPI);

include/units/Temperature.hpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,29 @@
22

33
#include "units/units.hpp"
44

5-
using Temperature = Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>,
6-
std::ratio<0>, std::ratio<0>>;
5+
class Temperature : public Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>,
6+
std::ratio<1>, std::ratio<0>, std::ratio<0>> {
7+
public:
8+
explicit constexpr Temperature(double value)
9+
: Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>,
10+
std::ratio<0>, std::ratio<0>>(value) {}
11+
12+
constexpr Temperature(Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>,
13+
std::ratio<1>, std::ratio<0>, std::ratio<0>>
14+
value)
15+
: Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<1>,
16+
std::ratio<0>, std::ratio<0>>(value) {};
17+
};
18+
19+
template <> struct LookupName<Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>,
20+
std::ratio<1>, std::ratio<0>, std::ratio<0>>> {
21+
using Named = Temperature;
22+
};
23+
24+
inline std::ostream& operator<<(std::ostream& os, const Temperature& quantity) {
25+
os << quantity.internal() << " k";
26+
return os;
27+
}
728

829
constexpr Temperature kelvin = Temperature(1.0);
930

0 commit comments

Comments
 (0)