Shop OBEX P1 Docs P2 Docs Learn Events
Reboot command in C — Parallax Forums

Reboot command in C

EnriqueEnrique Posts: 90
edited 2012-11-28 05:46 in Propeller 1
Hi everyone,

Can someone tell me what is the C equivalent of the Spin Reboot command?

Which header file must I include for it to be available in my program?


Thanks,
Enrique

Comments

  • jac_goudsmitjac_goudsmit Posts: 418
    edited 2012-11-28 03:10
    Unless I'm mistaken, the simplest way is to put:
    __asm { "reboot" }
    

    No include files are necessary.

    ===Jac
  • ersmithersmith Posts: 6,054
    edited 2012-11-28 05:12
    Actually, rebooting the processor is accomplished by setting bit 7 in the clock mode using the CLKSET instruction (there is no REBOOT instruction, at least not in GAS). In PropGCC you can accomplish this by:
    #define reboot() __builtin_propeller_clkset(0x80)
    
    And then using ''reboot()'' whenever you want to reboot.

    Eric
  • EnriqueEnrique Posts: 90
    edited 2012-11-28 05:46
    Thanks,
    Enrique
Sign In or Register to comment.