mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2794 from geky/callback-c-order
callback - Reorder optional argument to static C functionpull/2809/head
commit
c49e970909
5155
hal/api/Callback.h
5155
hal/api/Callback.h
File diff suppressed because it is too large
Load Diff
|
@ -47,7 +47,7 @@ public:
|
|||
MBED_DEPRECATED_SINCE("mbed-os-5.1",
|
||||
"Replaced with RtosTimer(Callback<void()>, os_timer_type)")
|
||||
RtosTimer(void (*func)(void const *argument), os_timer_type type=osTimerPeriodic, void *argument=NULL) {
|
||||
constructor(mbed::callback(argument, (void (*)(void *))func), type);
|
||||
constructor(mbed::callback((void (*)(void *))func, argument), type);
|
||||
}
|
||||
|
||||
/** Create timer.
|
||||
|
|
|
@ -108,12 +108,12 @@ public:
|
|||
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
|
||||
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
|
||||
@deprecated
|
||||
Thread-spawning constructors hide errors. Replaced by thread.start(callback(argument, task)).
|
||||
Thread-spawning constructors hide errors. Replaced by thread.start(callback(task, argument)).
|
||||
|
||||
@code
|
||||
Thread thread(priority, stack_size, stack_pointer);
|
||||
|
||||
osStatus status = thread.start(callback(argument, task));
|
||||
osStatus status = thread.start(callback(task, argument));
|
||||
if (status != osOK) {
|
||||
error("oh no!");
|
||||
}
|
||||
|
@ -122,12 +122,12 @@ public:
|
|||
template <typename T>
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.1",
|
||||
"Thread-spawning constructors hide errors. "
|
||||
"Replaced by thread.start(callback(argument, task)).")
|
||||
"Replaced by thread.start(callback(task, argument)).")
|
||||
Thread(T *argument, void (T::*task)(),
|
||||
osPriority priority=osPriorityNormal,
|
||||
uint32_t stack_size=DEFAULT_STACK_SIZE,
|
||||
unsigned char *stack_pointer=NULL) {
|
||||
constructor(mbed::callback(argument, task),
|
||||
constructor(mbed::callback(task, argument),
|
||||
priority, stack_size, stack_pointer);
|
||||
}
|
||||
|
||||
|
@ -139,12 +139,12 @@ public:
|
|||
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
|
||||
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
|
||||
@deprecated
|
||||
Thread-spawning constructors hide errors. Replaced by thread.start(callback(argument, task)).
|
||||
Thread-spawning constructors hide errors. Replaced by thread.start(callback(task, argument)).
|
||||
|
||||
@code
|
||||
Thread thread(priority, stack_size, stack_pointer);
|
||||
|
||||
osStatus status = thread.start(callback(argument, task));
|
||||
osStatus status = thread.start(callback(task, argument));
|
||||
if (status != osOK) {
|
||||
error("oh no!");
|
||||
}
|
||||
|
@ -153,12 +153,12 @@ public:
|
|||
template <typename T>
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.1",
|
||||
"Thread-spawning constructors hide errors. "
|
||||
"Replaced by thread.start(callback(argument, task)).")
|
||||
"Replaced by thread.start(callback(task, argument)).")
|
||||
Thread(T *argument, void (*task)(T *),
|
||||
osPriority priority=osPriorityNormal,
|
||||
uint32_t stack_size=DEFAULT_STACK_SIZE,
|
||||
unsigned char *stack_pointer=NULL) {
|
||||
constructor(mbed::callback(argument, task),
|
||||
constructor(mbed::callback(task, argument),
|
||||
priority, stack_size, stack_pointer);
|
||||
}
|
||||
|
||||
|
@ -170,12 +170,12 @@ public:
|
|||
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
|
||||
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
|
||||
@deprecated
|
||||
Thread-spawning constructors hide errors. Replaced by thread.start(callback(argument, task)).
|
||||
Thread-spawning constructors hide errors. Replaced by thread.start(callback(task, argument)).
|
||||
|
||||
@code
|
||||
Thread thread(priority, stack_size, stack_pointer);
|
||||
|
||||
osStatus status = thread.start(callback(argument, task));
|
||||
osStatus status = thread.start(callback(task, argument));
|
||||
if (status != osOK) {
|
||||
error("oh no!");
|
||||
}
|
||||
|
@ -183,12 +183,12 @@ public:
|
|||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.1",
|
||||
"Thread-spawning constructors hide errors. "
|
||||
"Replaced by thread.start(callback(argument, task)).")
|
||||
"Replaced by thread.start(callback(task, argument)).")
|
||||
Thread(void (*task)(void const *argument), void *argument=NULL,
|
||||
osPriority priority=osPriorityNormal,
|
||||
uint32_t stack_size=DEFAULT_STACK_SIZE,
|
||||
unsigned char *stack_pointer=NULL) {
|
||||
constructor(mbed::callback(argument, (void (*)(void *))task),
|
||||
constructor(mbed::callback((void (*)(void *))task, argument),
|
||||
priority, stack_size, stack_pointer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue