Creating a microcontroller startup file
Mike via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Apr 8 05:41:54 PDT 2015
On Wednesday, 8 April 2015 at 11:17:12 UTC, Mike wrote:
> On Tuesday, 7 April 2015 at 20:33:26 UTC, Jens Bauer wrote:
>
>>
>> Question number 2: Is it possible to change the VectorFunc to
>> be a real function pointer, rather than a void* ?
>>
>
> I did something along these lines (modified to match your
> example) and it worked fine for me:
>
> alias VectorFunc = void function();
>
[...]
>
> @attribute("section",".isr_vector.ro")
> immutable ISR[3] g_pfnVectors =
> [
> &Reset_Handler
> , &NMI_Handler
> , &HardFault_Handler
> ];
>
Sorry, but that code should be:
@attribute("section",".isr_vector.ro")
immutable VectorFunc[3] g_pfnVectors =
[
&Reset_Handler
, &NMI_Handler
, &HardFault_Handler
];
More information about the Digitalmars-d-learn
mailing list