git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6453 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
2630791828
commit
5b6fb4adf4
|
@ -285,7 +285,7 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
|
||||||
case USB_EVENT_ADDRESS:
|
case USB_EVENT_ADDRESS:
|
||||||
return;
|
return;
|
||||||
case USB_EVENT_CONFIGURED:
|
case USB_EVENT_CONFIGURED:
|
||||||
chSysLockFromIsr();
|
chSysLockFromISR();
|
||||||
|
|
||||||
/* Enables the endpoints specified into the configuration.
|
/* Enables the endpoints specified into the configuration.
|
||||||
Note, this callback is invoked from an ISR so I-Class functions
|
Note, this callback is invoked from an ISR so I-Class functions
|
||||||
|
@ -296,7 +296,7 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
|
||||||
/* Resetting the state of the CDC subsystem.*/
|
/* Resetting the state of the CDC subsystem.*/
|
||||||
sduConfigureHookI(&SDU2);
|
sduConfigureHookI(&SDU2);
|
||||||
|
|
||||||
chSysUnlockFromIsr();
|
chSysUnlockFromISR();
|
||||||
return;
|
return;
|
||||||
case USB_EVENT_SUSPEND:
|
case USB_EVENT_SUSPEND:
|
||||||
return;
|
return;
|
||||||
|
@ -332,8 +332,8 @@ static const SerialUSBConfig serusbcfg = {
|
||||||
/* Command line related. */
|
/* Command line related. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#define SHELL_WA_SIZE THD_WA_SIZE(2048)
|
#define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(2048)
|
||||||
#define TEST_WA_SIZE THD_WA_SIZE(256)
|
#define TEST_WA_SIZE THD_WORKING_AREA_SIZE(256)
|
||||||
|
|
||||||
static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
|
static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
size_t n, size;
|
size_t n, size;
|
||||||
|
@ -350,8 +350,8 @@ static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
|
static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
static const char *states[] = {THD_STATE_NAMES};
|
static const char *states[] = {CH_STATE_NAMES};
|
||||||
Thread *tp;
|
thread_t *tp;
|
||||||
|
|
||||||
(void)argv;
|
(void)argv;
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
|
@ -361,23 +361,23 @@ static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
chprintf(chp, " addr stack prio refs state time\r\n");
|
chprintf(chp, " addr stack prio refs state time\r\n");
|
||||||
tp = chRegFirstThread();
|
tp = chRegFirstThread();
|
||||||
do {
|
do {
|
||||||
chprintf(chp, "%.8lx %.8lx %4lu %4lu %9s %lu\r\n",
|
chprintf(chp, "%.8lx %.8lx %4lu %4lu %9s\r\n",
|
||||||
(uint32_t)tp, (uint32_t)tp->p_ctx.r13,
|
(uint32_t)tp, (uint32_t)tp->p_ctx.r13,
|
||||||
(uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
|
(uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
|
||||||
states[tp->p_state], (uint32_t)tp->p_time);
|
states[tp->p_state]);
|
||||||
tp = chRegNextThread(tp);
|
tp = chRegNextThread(tp);
|
||||||
} while (tp != NULL);
|
} while (tp != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
|
static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
|
||||||
Thread *tp;
|
thread_t *tp;
|
||||||
|
|
||||||
(void)argv;
|
(void)argv;
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
chprintf(chp, "Usage: test\r\n");
|
chprintf(chp, "Usage: test\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriority(),
|
tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(),
|
||||||
TestThread, chp);
|
TestThread, chp);
|
||||||
if (tp == NULL) {
|
if (tp == NULL) {
|
||||||
chprintf(chp, "out of memory\r\n");
|
chprintf(chp, "out of memory\r\n");
|
||||||
|
@ -437,7 +437,7 @@ static const ShellConfig shell_cfg1 = {
|
||||||
/*
|
/*
|
||||||
* Red LED blinker thread, times are in milliseconds.
|
* Red LED blinker thread, times are in milliseconds.
|
||||||
*/
|
*/
|
||||||
static WORKING_AREA(waThread1, 128);
|
static THD_WORKING_AREA(waThread1, 128);
|
||||||
static msg_t Thread1(void *arg) {
|
static msg_t Thread1(void *arg) {
|
||||||
|
|
||||||
(void)arg;
|
(void)arg;
|
||||||
|
@ -457,7 +457,7 @@ static msg_t Thread1(void *arg) {
|
||||||
* Application entry point.
|
* Application entry point.
|
||||||
*/
|
*/
|
||||||
int main(void) {
|
int main(void) {
|
||||||
Thread *shelltp = NULL;
|
thread_t *shelltp = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* System initializations.
|
* System initializations.
|
||||||
|
@ -513,7 +513,7 @@ int main(void) {
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (!shelltp && (SDU2.config->usbp->state == USB_ACTIVE))
|
if (!shelltp && (SDU2.config->usbp->state == USB_ACTIVE))
|
||||||
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
|
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
|
||||||
else if (chThdTerminated(shelltp)) {
|
else if (chThdTerminatedX(shelltp)) {
|
||||||
chThdRelease(shelltp); /* Recovers memory of the previous shell. */
|
chThdRelease(shelltp); /* Recovers memory of the previous shell. */
|
||||||
shelltp = NULL; /* Triggers spawning of a new shell. */
|
shelltp = NULL; /* Triggers spawning of a new shell. */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue