Skip to content

Commit

Permalink
Merge pull request #31 from ROBOTIS-GIT/develop
Browse files Browse the repository at this point in the history
merge from develop
  • Loading branch information
hancheol-cho authored Mar 6, 2017
2 parents f4dab0e + b466b4a commit f0c52a0
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 19 deletions.
13 changes: 10 additions & 3 deletions arduino/opencr_arduino/opencr/libraries/OLLO/OLLO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ void OLLO::begin(int devNum){
}
mMot_plus = 0;
mMot_minus = 0;


pinMode(OLLO_SLEEP, OUTPUT);
digitalWrite(OLLO_SLEEP, HIGH);

switch(devNum){
case 1:
pinMode(PORT1_SIG1, OUTPUT); //RED (right)
Expand Down Expand Up @@ -86,6 +91,10 @@ void OLLO::begin(int devNum, OlloDeviceIndex device_index){ //MAGNETIC SENSOR, B
}
mMot_plus = 0;
mMot_minus = 0;

pinMode(OLLO_SLEEP, OUTPUT);
digitalWrite(OLLO_SLEEP, HIGH);

switch(devNum){
case 1:
if(device_index == TOUCH_SENSOR || device_index == PIR_SENSOR || device_index == MAGNETIC_SENSOR){
Expand Down Expand Up @@ -608,8 +617,6 @@ int OLLO::detectColor(uint8_t port){
before_color_cnt = 0;
}

before_color_num = bColorResult;
before_color_num = bColorResult;
return 0;
}


15 changes: 9 additions & 6 deletions arduino/opencr_arduino/opencr/libraries/OLLO/OLLO.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ typedef enum COLOR_INDEX {
#define PORT2_SIG2 44
#define PORT2_ADC 45

#define PORT3_SIG1 40
#define PORT3_SIG2 41
#define PORT3_ADC 42
#define PORT3_SIG1 70
#define PORT3_SIG2 71
#define PORT3_ADC 72

#define PORT4_SIG1 73
#define PORT4_SIG2 74
#define PORT4_ADC 75

#define OLLO_SLEEP 46

#define PORT4_SIG1 43
#define PORT4_SIG2 44
#define PORT4_ADC 45

class OLLO {
private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extern USBD_HandleTypeDef USBD_Device;
static int8_t CDC_Itf_Init(void);
static int8_t CDC_Itf_DeInit(void);
static int8_t CDC_Itf_Control(uint8_t cmd, uint8_t* pbuf, uint16_t length);
static void CDC_Itf_TxISR(void);
void CDC_Itf_TxISR(void);
static int8_t CDC_Itf_Receive(uint8_t* pbuf, uint32_t *Len);
static uint32_t CDC_Itf_TxAvailable( void );

Expand Down Expand Up @@ -128,11 +128,6 @@ static int8_t CDC_Itf_Init(void)
rxd_BufPtrIn = 0;
rxd_BufPtrOut = 0;


drv_timer_set_period(TIMER_USB, 1000); // 5ms
drv_timer_attachInterrupt(TIMER_USB, CDC_Itf_TxISR);
drv_timer_resume(TIMER_USB);

return (USBD_OK);
}

Expand Down Expand Up @@ -477,7 +472,7 @@ BOOL CDC_Itf_IsConnected( void )
{
if( USBD_Device.dev_config == 0
|| is_opened == FALSE
|| USBD_Device.pClassData == NULL )
|| USBD_Device.pClassData == NULL )
{
return FALSE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,14 @@ void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
* @param hpcd: PCD handle
* @retval None
*/
extern void CDC_Itf_TxISR(void);

void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_SOF(hpcd->pData);

// for USB CDC
CDC_Itf_TxISR();
}

/**
Expand Down Expand Up @@ -357,7 +362,7 @@ USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
hpcd.Init.dma_enable = 0;
hpcd.Init.low_power_enable = 0;
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd.Init.Sof_enable = 0;
hpcd.Init.Sof_enable = 1;
hpcd.Init.speed = PCD_SPEED_FULL;
hpcd.Init.vbus_sensing_enable = 0;
hpcd.Init.lpm_enable = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim)
if( htim->Instance == TIM6 )
{
__HAL_RCC_TIM6_CLK_ENABLE();
HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 5, 0);
HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 10, 0);
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
}

Expand Down
2 changes: 1 addition & 1 deletion arduino/opencr_arduino/opencr/variants/OpenCR/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ extern const Pin2PortMapArray g_Pin2PortMapArray[]=
{GPIOC, GPIO_PIN_5, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 43 OLLO_P2_SIG1
{GPIOB, GPIO_PIN_1, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 44 OLLO_P2_SIG2
{GPIOC, GPIO_PIN_4, &hADC1, ADC_CHANNEL_14, NULL , NO_PWM , 6 }, // 45 OLLO_P2_ADC EXTI_6
{GPIOF, GPIO_PIN_7, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 46
{GPIOD, GPIO_PIN_10, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 46 OLLO_SLEEP
{GPIOF, GPIO_PIN_7, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 47
{GPIOF, GPIO_PIN_7, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 48
{GPIOF, GPIO_PIN_7, NULL, NO_ADC , NULL , NO_PWM , NO_EXTI }, // 49
Expand Down
Binary file not shown.
31 changes: 31 additions & 0 deletions arduino/opencr_release/package_opencr_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,37 @@
"version": "1.0.0"
}
]
},
{
"name": "OpenCR",
"architecture": "OpenCR",
"version": "1.0.7",
"category": "Arduino",
"help": {
"online": "https://github.com/ROBOTIS-GIT/OpenCR"
},
"url": "https://github.com/ROBOTIS-GIT/OpenCR/releases/download/1.0.7/opencr_core_1.0.7.tar.bz2",
"archiveFileName": "opencr_core_1.0.7.tar.bz2",
"checksum": "SHA-256:05a38b30efd11d6e1ed340d9727bff590c5391f511dee41e76cd0f54aed4f42b",
"size": "2662016",
"help": {
"online": "https://github.com/ROBOTIS-GIT/OpenCR"
},
"boards": [
{"name": "OpenCR"}
],
"toolsDependencies": [
{
"packager": "OpenCR",
"name": "opencr_gcc",
"version": "5.4.0-2016q2"
},
{
"packager": "OpenCR",
"name": "opencr_tools",
"version": "1.0.0"
}
]
}

],
Expand Down

0 comments on commit f0c52a0

Please sign in to comment.