Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs in arc_design_contest/2018/apps fixed #25

Merged
merged 3 commits into from Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
164 changes: 82 additions & 82 deletions arc_design_contest/2018/HUST_iRhythm/src/GUI/oled.c
Expand Up @@ -237,88 +237,88 @@ void OLED_P8x16Str(uint8_t x, uint8_t y, uint8_t ch[])



void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[])
{
uint8_t wm = 0, ii = 0;
uint16_t adder = 1;

while (ch[ii] != '\0') {
wm = 0;
adder = 1;

while (F14x16_Idx[wm] > 127) {
if (F14x16_Idx[wm] == ch[ii]) {
if (F14x16_Idx[wm + 1] == ch[ii + 1]) {
adder = wm * 14;
break;
}
}

wm += 2;
}

if (x > 118) {x = 0; y++;}

OLED_Set_Pos(x , y);

if (adder != 1) {
OLED_Set_Pos(x , y);

for (wm = 0; wm < 14; wm++) {
Write_IIC_Data(F14x16[adder]);
adder += 1;
}

OLED_Set_Pos(x, y + 1);

for (wm = 0; wm < 14; wm++) {
Write_IIC_Data(F14x16[adder]);
adder += 1;
}
} else {
ii += 1;
OLED_Set_Pos(x, y);

for (wm = 0; wm < 16; wm++) {
Write_IIC_Data(0);
}

OLED_Set_Pos(x, y + 1);

for (wm = 0; wm < 16; wm++) {
Write_IIC_Data(0);
}
}

x += 14;
ii += 2;
}
}



void OLED_Print(uint8_t x, uint8_t y, uint8_t ch[])
{
uint8_t ch2[3];
uint8_t ii = 0;

while (ch[ii] != '\0') {
if (ch[ii] > 127) {
ch2[0] = ch[ii];
ch2[1] = ch[ii + 1];
ch2[2] = '\0';
OLED_P14x16Str(x , y, ch2);
x += 14;
ii += 2;
} else {
ch2[0] = ch[ii];
ch2[1] = '\0';
OLED_P8x16Str(x , y , ch2);
x += 8;
ii += 1;
}
}
}
// void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[])
// {
// uint8_t wm = 0, ii = 0;
// uint16_t adder = 1;

// while (ch[ii] != '\0') {
// wm = 0;
// adder = 1;

// while (F14x16_Idx[wm] > 127) {
// if (F14x16_Idx[wm] == ch[ii]) {
// if (F14x16_Idx[wm + 1] == ch[ii + 1]) {
// adder = wm * 14;
// break;
// }
// }

// wm += 2;
// }

// if (x > 118) {x = 0; y++;}

// OLED_Set_Pos(x , y);

// if (adder != 1) {
// OLED_Set_Pos(x , y);

// for (wm = 0; wm < 14; wm++) {
// Write_IIC_Data(F14x16[adder]);
// adder += 1;
// }

// OLED_Set_Pos(x, y + 1);

// for (wm = 0; wm < 14; wm++) {
// Write_IIC_Data(F14x16[adder]);
// adder += 1;
// }
// } else {
// ii += 1;
// OLED_Set_Pos(x, y);

// for (wm = 0; wm < 16; wm++) {
// Write_IIC_Data(0);
// }

// OLED_Set_Pos(x, y + 1);

// for (wm = 0; wm < 16; wm++) {
// Write_IIC_Data(0);
// }
// }

// x += 14;
// ii += 2;
// }
// }



// void OLED_Print(uint8_t x, uint8_t y, uint8_t ch[])
// {
// uint8_t ch2[3];
// uint8_t ii = 0;

// while (ch[ii] != '\0') {
// if (ch[ii] > 127) {
// ch2[0] = ch[ii];
// ch2[1] = ch[ii + 1];
// ch2[2] = '\0';
// OLED_P14x16Str(x , y, ch2);
// x += 14;
// ii += 2;
// } else {
// ch2[0] = ch[ii];
// ch2[1] = '\0';
// OLED_P8x16Str(x , y , ch2);
// x += 8;
// ii += 1;
// }
// }
// }



Expand Down
Expand Up @@ -10,7 +10,7 @@ typedef struct{
}VarAndName;

//const int varnum = 16 + 4 + 2 + 4 + 4;
VarAndName varname[varnum];
extern VarAndName varname[varnum];
void paramCorr(void);

#endif
Expand Up @@ -113,7 +113,7 @@ to exclude the API function. */
#endif /* FREERTOS_CONFIG_H */


#define usercfgCPU_USAGE_CALCULATE 1
#define usercfgCPU_USAGE_CALCULATE 0
#ifdef usercfgCPU_USAGE_CALCULATE
#define usercfgCPU_USAGE_CALC_PERIOD 500//ms
#endif
2 changes: 1 addition & 1 deletion arc_design_contest/2018/NCTU_Smart_Pillow/src/makefile
Expand Up @@ -11,7 +11,7 @@ OS_SEL ?= freertos
#
# root dir of embARC
#
EMBARC_ROOT = ../embARC
EMBARC_ROOT = ../../../../../

MID_SEL = common

Expand Down
Expand Up @@ -4,7 +4,7 @@
##

# Application name
APPL ?= NCKU_Smart_Power_Saving_System_of_3D_Remote_Interaction
APPL ?= NCKU_SPSSo3DRI

# Optimization Level
# Please Refer to toolchain_xxx.mk for this option
Expand Down
Expand Up @@ -7,6 +7,7 @@
#include "u8g.h"
#include <string.h>
#include "arc.h"
#include "driver/temperature/emsk_temperature.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use emsk_temperature.h

#define FOLLOW_DISTANCE 120
#define STOP_DISTANCE 80
#define LOST_DISTANCE 300
Expand Down
Expand Up @@ -20,16 +20,16 @@ JTAG ?= usb
#
# root dir of embARC
#
EMBARC_ROOT = ../../..
EMBARC_ROOT = ../../../../..
MID_SEL = common u8glib


# application source dirs
APPL_CSRC_DIR = .
APPL_CSRC_DIR = . driver/buzzer driver/GPRS driver/temperature driver/ultrasonic driver/ZPH01
APPL_ASMSRC_DIR = .

# application include dirs
APPL_INC_DIR = .
APPL_INC_DIR = . driver/buzzer driver/GPRS driver/temperature driver/ultrasonic driver/ZPH01

# include current project makefile
COMMON_COMPILE_PREREQUISITES += makefile
Expand Down
@@ -0,0 +1,36 @@
/* ------------------------------------------
* Copyright (c) 2017, Synopsys, Inc. All rights reserved.

* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:

* 1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.

* 2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.

* 3) Neither the name of the Synopsys, Inc., nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
--------------------------------------------- */
#ifndef _SSD1306_APP_CONFIG_H_
#define _SSD1306_APP_CONFIG_H_

#define SSD1306_I2C_ID 0
#define SSD1306_RST_GPIO 3
#define SSD1306_RST_PIN 5
#endif /* _SSD1306_APP_CONFIG_H_ */
5 changes: 5 additions & 0 deletions arc_design_contest/2018/XDU_Master-Sign-Language/arc/main.c
Expand Up @@ -4,6 +4,11 @@
#include "embARC_debug.h"
#include "embARC_error.h"
#include "u8g.h"
#include "driver/draw/draw.h"
#include "driver/gprs/send_msg.h"
#include "driver/judge/judge.h"
#include "driver/uart/dw_uart_obj.h"
#include "driver/data/data.h"
#define I2C_SLAVE_ADDR1 0x02
#define uchar unsigned char
#define uint unsigned int
Expand Down
8 changes: 4 additions & 4 deletions arc_design_contest/2018/XDU_Master-Sign-Language/arc/makefile
Expand Up @@ -9,7 +9,7 @@ OLEVEL ?= O2
# Current Board And Core
##
BOARD ?= emsk
BD_VER ?= 20
BD_VER ?= 22
CUR_CORE ?= arcem7d
TOOLCHAIN ?= gnu
##
Expand Down Expand Up @@ -37,16 +37,16 @@ JTAG ?= usb
#
# root dir of embARC
#
EMBARC_ROOT = ../../..
EMBARC_ROOT = ../../../../..

MID_SEL = common u8glib

# application source dirs
APPL_CSRC_DIR = .
APPL_CSRC_DIR = . ./driver/draw ./driver/data ./driver/gprs ./driver/judge ./driver/uart
APPL_ASMSRC_DIR = .

# application include dirs
APPL_INC_DIR = .
APPL_INC_DIR = . ./driver/draw ./driver/data ./driver/gprs ./driver/judge ./driver/uart

# application defines
APPL_DEFINES =
Expand Down
@@ -0,0 +1,36 @@
/* ------------------------------------------
* Copyright (c) 2017, Synopsys, Inc. All rights reserved.

* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:

* 1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.

* 2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.

* 3) Neither the name of the Synopsys, Inc., nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
--------------------------------------------- */
#ifndef _SSD1306_APP_CONFIG_H_
#define _SSD1306_APP_CONFIG_H_

#define SSD1306_I2C_ID 0
#define SSD1306_RST_GPIO 3
#define SSD1306_RST_PIN 5
#endif /* _SSD1306_APP_CONFIG_H_ */