2013-11-12 01:41 PM
Hi All,
please somebody help me to write this c code into asm: void EXTI9_5_IRQHandler(void) { /* Clear the EXTI line pending bit */ //EXTI_ClearITPendingBit( EXTI_Line8 ); EXTI->PR = EXTI_Line8; NVIC->ICER[ EXTI9_5_IRQn >> 0x05] = (uint32_t)0x01 << ( EXTI9_5_IRQn & (uint8_t)0x1F); uint32_t i32=ADC_BUFFER_FULL_LEN; // actual value 20001 ADC_Buffer_ptr1=(uint8_t *)ADC_Buffer; do { *(ADC_Buffer_ptr1++)=*(((uint8_t *)&(GPIOF->IDR))+1); // GPIO_Pins [15:8] into Buffer } while( (i32--) > 0 ); } compiler is unrolling ''while'' into 7 steps always and i think that if the code will be written in asm then will not be unrolled ... Thanks for all replies, Kind regards2013-11-12 02:03 PM
please somebody help me to write this c code into asm:
I've got some leaves that need raking and tyres that need changing. This should compile fairly cleanlyvoid EXTI9_5_IRQHandler(void)
{
uint8_t *p = (uint8_t *)ADC_Buffer;
volatile uint8_t *q = (((uint8_t *)&GPIOF->IDR) + 1);
int i = 20000; // or do you need 20001 bytes?
/* Clear the EXTI line pending bit */
EXTI_ClearITPendingBit( EXTI_Line8 );
while(i--)
*p++ = *q;
}
2013-11-12 02:14 PM
well, it isn't unrolled,thank you very much ...