 |
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Go to the documentation of this file.
46 uint8_t totalBits = 0;
103 return (
CNT - start) / MICROSECOND;
125 size_t largestSuccess = 0;
126 size_t smallestFailure = 32 * 1024;
127 size_t nextAttempt = 32 * 1024;
132 ptr = (uint8_t *) malloc(nextAttempt);
138 largestSuccess = nextAttempt;
141 smallestFailure = nextAttempt;
144 nextAttempt = (smallestFailure - largestSuccess) / 2 +
146 }
while (precision < (smallestFailure - largestSuccess));
148 return largestSuccess;
157 for (
size_t i = 0; i < strlen(
string); ++i)
158 string[i] =
tolower(
string[i]);
167 for (
size_t i = 0; i < strlen(
string); ++i)
168 string[i] =
toupper(
string[i]);
177 return b ?
"true" :
"false";
197 for (exp = 31;
x > 0; exp--)
199 ptr = (
unsigned short *) ((((
unsigned int)
x) >> 19) + 0xb000);
200 return (exp << 16) | *ptr;
213 inline static unsigned int reverse (
unsigned int x,
unsigned int bits = 0) {
214 return __builtin_propeller_rev(
x, bits);
217 static bool empty (
const char string[]) {
218 return '\0' ==
string[0];
231 template<
typename T,
size_t N>
243 __builtin_propeller_clkset(0x80);
246 static Bit to_bit (
const uint_fast8_t bitNumber) {
248 return (Bit) (1 << bitNumber);
253 static bool bit_read (
const uint32_t
x,
const Bit bit) {
254 return 0 != (
x & bit);
258 static void bit_write (T &
x,
const Bit bit,
const bool value) {
266 static void bit_set (T &
x,
const Bit bit) {
271 static void bit_clear (T &
x,
const Bit bit) {
static unsigned int reverse(unsigned int x, unsigned int bits=0)
Reverse some of the bits in x
static size_t get_largest_free_block_size(const uint8_t precision=32)
Determine the size of the largest block of free memory.
static void to_upper(char string[])
Convert each alphabetical character in a null-terminated character array to uppercase letters.
static uint32_t measure_time_interval(const register uint32_t start)
Determine the number of microseconds passed since a starting point.
static uint8_t count_bits(int32_t par)
Count the number of set bits in a parameter.
static uint32_t measure_time_interval(const register int32_t start)
static int rom_log(int x)
Compute the mathematical expression log2(x). Result is in fixed-point format (16 digits to the left a...
static void to_lower(char string[])
Convert each alphabetical character in a null-terminated character array to lowercase letters.
static const char * to_string(const bool b)
Convert a boolean to the string-literal either "true" or "false"
static uint8_t count_bits(uint32_t par)
Count the number of set bits in a parameter.
#define CNT
The system clock count.
static void reboot()
Perform hard reboot.
Generic definitions and functions for the Parallax Propeller.
static size_t size_of_array(const T(&array)[N])
Determine the size of an array.