mirror of https://github.com/rusefi/ChibiOS.git
AVR: Change the comment type and correct indentation at the end of the file.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12235 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
8c4b0791ea
commit
5903f8305c
|
@ -126,8 +126,8 @@ static void aes_lld_stop(void) {
|
|||
void cry_lld_init(void) {
|
||||
|
||||
#if AVR_CRY_USE_CRY1 || defined(__DOXYGEN__)
|
||||
aes_lld_reset(); // Reset the AES module.
|
||||
aes_lld_stop(); // Stop the AES module.
|
||||
aes_lld_reset(); /* Reset the AES module. */
|
||||
aes_lld_stop(); /* Stop the AES module. */
|
||||
CRYD1.config = NULL;
|
||||
CRYD1.state = CRY_STOP;
|
||||
#endif
|
||||
|
@ -170,7 +170,7 @@ void cry_lld_start(CRYDriver *cryp) {
|
|||
void cry_lld_stop(CRYDriver *cryp) {
|
||||
|
||||
if (cryp->state == CRY_READY) {
|
||||
aes_lld_stop(); // Stop the AES module.
|
||||
aes_lld_stop(); /* Stop the AES module. */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,11 +200,11 @@ cryerror_t cry_lld_loadkey(CRYDriver *cryp,
|
|||
(void)size;
|
||||
|
||||
if (size != AES_BLOCK_SIZE) {
|
||||
return CRY_ERR_INV_KEY_SIZE; // invalid size error code.
|
||||
return CRY_ERR_INV_KEY_SIZE; /* invalid size error code. */
|
||||
}
|
||||
|
||||
if (algorithm == cry_algo_aes) {
|
||||
// Load the Key into the AES key memory.
|
||||
/* Load the Key into the AES key memory. */
|
||||
for (i = 0; i < AES_BLOCK_SIZE; i++) {
|
||||
AES.KEY = keyp[i];
|
||||
}
|
||||
|
@ -246,25 +246,25 @@ cryerror_t cry_lld_encrypt_AES(CRYDriver *cryp,
|
|||
(void)cryp;
|
||||
(void)key_id;
|
||||
|
||||
// Load the Data into the AES state memory.
|
||||
/* Load the Data into the AES state memory. */
|
||||
for (i = 0; i < AES_BLOCK_SIZE; i++) {
|
||||
AES.STATE = src[i];
|
||||
}
|
||||
|
||||
// Set the AES encryption mode.
|
||||
/* Set the AES encryption mode. */
|
||||
aes_lld_set_mode_encrypt();
|
||||
|
||||
// Start the AES.
|
||||
/* Start the AES. */
|
||||
aes_lld_start();
|
||||
|
||||
// Wait the Encryption to finish or an error to occurs.
|
||||
/* Wait the Encryption to finish or an error to occurs. */
|
||||
do{
|
||||
}
|
||||
while ((AES.STATUS & (AES_SRIF_bm|AES_ERROR_bm)) == 0);
|
||||
|
||||
// Check error.
|
||||
/* Check error. */
|
||||
if((AES.STATUS & AES_ERROR_bm) == 0) {
|
||||
// Store the result of the encryption
|
||||
/* Store the result of the encryption. */
|
||||
for(i = 0; i < AES_BLOCK_SIZE; i++) {
|
||||
dest[i] = AES.STATE;
|
||||
}
|
||||
|
@ -307,25 +307,25 @@ cryerror_t cry_lld_decrypt_AES(CRYDriver *cryp,
|
|||
(void)cryp;
|
||||
(void)key_id;
|
||||
|
||||
// Load data into AES state memory.
|
||||
/* Load data into AES state memory. */
|
||||
for (i = 0; i < AES_BLOCK_SIZE; i++) {
|
||||
AES.STATE = src[i];
|
||||
}
|
||||
|
||||
// Set the AES decryption mode.
|
||||
/* Set the AES decryption mode. */
|
||||
aes_lld_set_mode_decrypt();
|
||||
|
||||
// Start the AES.
|
||||
/* Start the AES. */
|
||||
aes_lld_start();
|
||||
|
||||
// Wait the Encryption to finish or an error to occurs.
|
||||
/* Wait the Encryption to finish or an error to occurs. */
|
||||
do {
|
||||
}
|
||||
while ((AES.STATUS & (AES_SRIF_bm|AES_ERROR_bm)) == 0);
|
||||
|
||||
// Check if not error.
|
||||
/* Check if not error. */
|
||||
if ((AES.STATUS & AES_ERROR_bm) == 0) {
|
||||
// Store the result.
|
||||
/* Store the result. */
|
||||
for (i = 0; i < AES_BLOCK_SIZE; i++) {
|
||||
dest[i] = AES.STATE;
|
||||
}
|
||||
|
|
|
@ -143,11 +143,11 @@
|
|||
#define NIL_STATE_SUSP (tstate_t)2 /**< @brief Thread suspended. */
|
||||
#define NIL_STATE_WTQUEUE (tstate_t)3 /**< @brief On queue or semaph. */
|
||||
#define NIL_STATE_WTOREVT (tstate_t)4 /**< @brief Waiting for events. */
|
||||
#define NIL_THD_IS_READY(tr) ((tr)->state == NIL_STATE_READY)
|
||||
#define NIL_THD_IS_SLEEPING(tr) ((tr)->state == NIL_STATE_SLEEPING)
|
||||
#define NIL_THD_IS_SUSP(tr) ((tr)->state == NIL_STATE_SUSP)
|
||||
#define NIL_THD_IS_WTQUEUE(tr) ((tr)->state == NIL_STATE_WTQUEUE)
|
||||
#define NIL_THD_IS_WTOREVT(tr) ((tr)->state == NIL_STATE_WTOREVT)
|
||||
#define NIL_THD_IS_READY(tp) ((tp)->state == NIL_STATE_READY)
|
||||
#define NIL_THD_IS_SLEEPING(tp) ((tp)->state == NIL_STATE_SLEEPING)
|
||||
#define NIL_THD_IS_SUSP(tp) ((tp)->state == NIL_STATE_SUSP)
|
||||
#define NIL_THD_IS_WTQUEUE(tp) ((tp)->state == NIL_STATE_WTQUEUE)
|
||||
#define NIL_THD_IS_WTOREVT(tp) ((tp)->state == NIL_STATE_WTOREVT)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -404,7 +404,7 @@
|
|||
* @brief Threads initialization hook.
|
||||
*/
|
||||
#if !defined(CH_CFG_THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
|
||||
#define CH_CFG_THREAD_EXT_INIT_HOOK(tr) {}
|
||||
#define CH_CFG_THREAD_EXT_INIT_HOOK(tp) {}
|
||||
#endif
|
||||
|
||||
/*-*
|
||||
|
|
Loading…
Reference in New Issue