Shop OBEX P1 Docs P2 Docs Learn Events
How many SPIN statements are valid for SimpleIDE.c? — Parallax Forums

How many SPIN statements are valid for SimpleIDE.c?

StephenMooreStephenMoore Posts: 188
edited 2012-07-03 14:31 in Propeller 1
I see that

waitcnt(CLKFREQ + CNT);

is used as a hybrid SPIN / C statement.

Are there others?

Comments

  • StephenMooreStephenMoore Posts: 188
    edited 2012-07-03 13:16
    Thanks. It is going to take a little bit to get to know my way around the documentation zone.I have a question about the start function in the toggle example.


    Does start get executed automatically for every download? Where is this documented?

    How do .dat files get configured?
    int start(unsigned int *pinptr)
    {
        // The label binary_toggle_dat_start is automatically placed
        // on the cog code from toggle.dat by objcopy (see the Makefile).
        extern unsigned int binary_toggle_dat_start[];
        return cognew(&binary_toggle_dat_start, pinptr);
    }
    
  • jazzedjazzed Posts: 11,803
    edited 2012-07-03 13:40
    Thanks. It is going to take a little bit to get to know my way around the documentation zone.I have a question about the start function in the toggle example.


    Does start get executed automatically for every download? Where is this documented?

    How do .dat files get configured?
    int start(unsigned int *pinptr)
    {
        // The label binary_toggle_dat_start is automatically placed
        // on the cog code from toggle.dat by objcopy (see the Makefile).
        extern unsigned int binary_toggle_dat_start[];
        return cognew(&binary_toggle_dat_start, pinptr);
    }
    

    Good question.

    The function name main() is the only "C language function" that starts automatically (GCC also allows for a constructor and it would be called before main in a C program, but that is a C++ extension).

    In the current C compiler mode, SimpleIDE will (using bstc -c spinfile.spin) create .dat files from .spin files that contain PASM. With the toggle makefiles, the common.mk has rules used for similar purposes.

    Then a function the user defines such as start() mentioned in that example can be used to cognew the resulting .dat symbol PASM code. The symbol created by the compiler tools invoked by SimpleIDE for .dat files will always be binary_filename_dat_start.

    Hope this helps.
    --Steve
  • StephenMooreStephenMoore Posts: 188
    edited 2012-07-03 14:17
    Do I need to customize my own Makefile for each application or is there a higher level feature in SimpleIDE to handle this?
  • jazzedjazzed Posts: 11,803
    edited 2012-07-03 14:31
    SimpleIDE has a project manager and builds according to file extensions.
    The User Guide .pdf document describes the Project Manager and file types.
Sign In or Register to comment.