Skip to content

Commit

Permalink
Merge pull request #6 from ROBOTIS-GIT/develop
Browse files Browse the repository at this point in the history
merge from develop
  • Loading branch information
chcbaram authored Jul 28, 2016
2 parents 8741c0c + 2e10abf commit 53c6084
Show file tree
Hide file tree
Showing 749 changed files with 8,557 additions and 66,823 deletions.
2 changes: 2 additions & 0 deletions arduino/opencr_arduino/opencr/boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ menu.device_variant=Variant
menu.bootloader_version=Bootloader version
menu.upload_method=Upload method

OpenCR.bootloader.tool = dfu_util
OpenCR.bootloader.file = opencr_boot.bin

OpenCR.name=OpenCR Board
OpenCR.upload.maximum_size=786432
Expand Down
Binary file not shown.
52 changes: 52 additions & 0 deletions arduino/opencr_arduino/opencr/cores/mapleMX/WInterrupts.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
Copyright (c) 2014 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "WInterrupts.h"
#include "variant.h"
#include "wiring_digital.h"

#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif



/*
* \brief Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs.
* Replaces any previous function that was attached to the interrupt.
*/

void attachInterrupt( uint32_t pin, voidFuncPtr callback, uint32_t ulMode )
{
drv_exti_attach( pin, callback, ulMode );
}

/*
* \brief Turns off the given interrupt.
*/
void detachInterrupt( uint32_t pin )
{
drv_exti_detach( pin );
}


#ifdef __cplusplus
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ extern "C"{
#define HIGH 0x1
#define LOW 0x0

#define INPUT 0x0
#define OUTPUT 0x1
#define INPUT_PULLUP 0x2
#define INPUT 0x0
#define OUTPUT 0x1
#define INPUT_PULLUP 0x2
#define INPUT_ANALOG 0x3


//#define true 0x1
//#define false 0x0
Expand Down
13 changes: 9 additions & 4 deletions arduino/opencr_arduino/opencr/cores/mapleMX/wiring_digital.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,19 @@ extern void pinMode( uint32_t ulPin, uint32_t ulMode )
GPIO_InitStruct.Pull = GPIO_NOPULL;
break ;

case INPUT_ANALOG:
drv_adc_pin_init(ulPin);
break;

default:
break ;
}

GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;


HAL_GPIO_Init(g_Pin2PortMapArray[ulPin].GPIOx_Port, &GPIO_InitStruct);
if( ulMode != INPUT_ANALOG )
{
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
HAL_GPIO_Init(g_Pin2PortMapArray[ulPin].GPIOx_Port, &GPIO_InitStruct);
}
}

extern void digitalWrite( uint32_t ulPin, uint32_t ulVal )
Expand Down
Loading

0 comments on commit 53c6084

Please sign in to comment.