save memory (3)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
2011-05-11 NIIBE Yutaka <gniibe@fsij.org>
|
||||
|
||||
* src/flash.c (keystore_pool): Remove. Use &_keystore_pool.
|
||||
* src/usb-icc.c (icc_thread): Remove. Use chThdSelf ().
|
||||
|
||||
* src/flash.c (keystore_pool): Remove. Use &_keystore_pool.
|
||||
* src/ac.c (auth_status): Don't assign 0 as it's automatically
|
||||
cleared.
|
||||
|
||||
|
||||
@@ -112,8 +112,6 @@ static uint8_t *icc_chain_p;
|
||||
*/
|
||||
static int icc_tx_size;
|
||||
|
||||
static Thread *icc_thread;
|
||||
|
||||
#define EV_RX_DATA_READY (eventmask_t)1 /* USB Rx data available */
|
||||
/* EV_EXEC_FINISHED == 2 */
|
||||
#define EV_TX_FINISHED (eventmask_t)4 /* USB Tx finished */
|
||||
@@ -125,8 +123,12 @@ void
|
||||
EP1_IN_Callback (void)
|
||||
{
|
||||
if (icc_next_p == NULL)
|
||||
/* The sequence of Bulk-IN transactions finished */
|
||||
chEvtSignalI (icc_thread, EV_TX_FINISHED);
|
||||
{
|
||||
Thread *me = chThdSelf ();
|
||||
|
||||
/* The sequence of Bulk-IN transactions finished */
|
||||
chEvtSignalI (me, EV_TX_FINISHED);
|
||||
}
|
||||
else if (icc_next_p == &icc_buffer[icc_tx_size])
|
||||
/* It was multiple of USB_LL_BUF_SIZE */
|
||||
{
|
||||
@@ -217,8 +219,12 @@ EP2_OUT_Callback (void)
|
||||
icc_prepare_receive (0);
|
||||
}
|
||||
else
|
||||
/* Notify icc_thread */
|
||||
chEvtSignalI (icc_thread, EV_RX_DATA_READY);
|
||||
{
|
||||
Thread *me = chThdSelf ();
|
||||
|
||||
/* Notify myself */
|
||||
chEvtSignalI (me, EV_RX_DATA_READY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,8 +311,12 @@ icc_power_on (void)
|
||||
int size_atr;
|
||||
|
||||
if (gpg_thread == NULL)
|
||||
gpg_thread = chThdCreateStatic (waGPGthread, sizeof(waGPGthread),
|
||||
NORMALPRIO, GPGthread, (void *)icc_thread);
|
||||
{
|
||||
Thread *me = chThdSelf ();
|
||||
|
||||
gpg_thread = chThdCreateStatic (waGPGthread, sizeof(waGPGthread),
|
||||
NORMALPRIO, GPGthread, (void *)me);
|
||||
}
|
||||
|
||||
size_atr = sizeof (ATR);
|
||||
icc_buffer[0] = ICC_DATA_BLOCK_RET;
|
||||
@@ -681,7 +691,6 @@ USBthread (void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
|
||||
icc_thread = chThdSelf ();
|
||||
chEvtClear (ALL_EVENTS);
|
||||
|
||||
icc_state = ICC_STATE_START;
|
||||
|
||||
Reference in New Issue
Block a user