Creating a microcontroller startup file

Jens Bauer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 8 08:25:15 PDT 2015


Something tells me that now is when I have to start doing some 
hard work. ;)
-Sorry, I need to split this up into short replies/questions.

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* ?

> immutable ISR[3] g_pfnVectors =
> [
>       cast(ISR)&_stack
>     , &Reset_Handler
>     , &NMI_Handler
>     , &HardFault_Handler
> ];

In your example, you do not have the initial stack pointer.
The above code gives me the following:
src/test.d:24:13: error: reinterpreting cast from uint* to 
void()* is not supported in CTFE
     cast(ISR)&_stack
              ^

-That's the only reason I needed to change it to from function() 
to void*.
Can you successfully cast(ISR)&_stack ?


More information about the Digitalmars-d-learn mailing list