mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Made main.c compliant with Energy
Complaining about main() defined twice
This commit is contained in:
@ -3,9 +3,9 @@
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
|
||||
#define false 0
|
||||
#define true 1
|
||||
typedef int bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
typedef int bool;
|
||||
|
||||
#include <stdint.h>
|
||||
#include "inc/hw_memmap.h"
|
||||
@ -16,27 +16,21 @@ typedef int bool;
|
||||
#define LED_BLUE GPIO_PIN_2
|
||||
#define LED_GREEN GPIO_PIN_3
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
void setup() {
|
||||
SysCtlClockSet(
|
||||
SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
|
||||
SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
|
||||
|
||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
|
||||
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);
|
||||
|
||||
while (1)
|
||||
{
|
||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_RED);
|
||||
SysCtlDelay(3000000);
|
||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_BLUE);
|
||||
SysCtlDelay(3000000);
|
||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_GREEN);
|
||||
SysCtlDelay(3000000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// hook for Energia main.cpp where these methods are defined
|
||||
void setup() {}
|
||||
void loop() {}
|
||||
|
||||
void loop() {
|
||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_RED);
|
||||
SysCtlDelay(3000000);
|
||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_BLUE);
|
||||
SysCtlDelay(3000000);
|
||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_GREEN);
|
||||
SysCtlDelay(3000000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user