Skip to content

Commit 1a133f2

Browse files
follow mruby/c master changes.
1 parent 1e2cf93 commit 1a133f2

File tree

3 files changed

+15
-36
lines changed

3 files changed

+15
-36
lines changed

PSoC5LP/i2c/c_i2c.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,7 @@
5050
#include <stdint.h>
5151
#include <project.h> // auto generated by PSoC Creator.
5252

53-
#include "value.h"
54-
#include "alloc.h"
55-
#include "static.h"
56-
#include "symbol.h"
57-
#include "class.h"
58-
#include "c_string.h"
59-
#include "c_array.h"
60-
#include "console.h"
53+
#include "mrubyc.h"
6154

6255

6356
// convert pseudo identifier to real identifier.

PSoC5LP/uart/c_uart.c

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,20 @@
33
UART class for Cypress PSoC5LP
44
55
<pre>
6-
Copyright (C) 2018 Kyushu Institute of Technology.
7-
Copyright (C) 2018 Shimane IT Open-Innovation Center.
6+
Copyright (C) 2018-2020 Kyushu Institute of Technology.
7+
Copyright (C) 2018-2020 Shimane IT Open-Innovation Center.
88
99
This file is distributed under BSD 3-Clause License.
1010
1111
(Usage)
12-
Copy the following 4 files and add to project.
13-
c_uart.h
14-
c_uart.c
15-
uart2.h
16-
uart2.c
17-
18-
1912
Hardware configration.
2013
2114
1. Use PSoC Creator, place "Communication > UART" device.
22-
2. Open a Configure dialog.
15+
2. Open a configure dialog.
2316
3. Make sure the name is "UART_1".
2417
4. Set the baud rate and other parameters.
2518
5. Change to the "Advanced" tab and check "RX - ON Byte Received" and "TX - On TX Complete".
26-
6. Click OK button to close dialog.
19+
6. Close this dialog.
2720
7. Place two "System > Interrupt" devices.
2821
8. Connect to tx_interrupt and rx_interrupt of UART.
2922
9. Change the names to "isr_UART_1_Tx" and "isr_UART_1_Rx" respectively.
@@ -63,13 +56,8 @@
6356
#include <stdint.h>
6457
#include <project.h> // auto generated by PSoC Creator.
6558

66-
#include "value.h"
67-
#include "alloc.h"
68-
#include "static.h"
69-
#include "class.h"
70-
#include "c_string.h"
71-
7259
#include "uart2.h"
60+
#include "mrubyc.h"
7361

7462

7563
//================================================================
@@ -102,7 +90,7 @@ UART_ISR( &uh[2], UART_3 );
10290
$uart = UART.new # automatic assign
10391
$uart = UART.new( num ) # 1 origin.
10492
*/
105-
static void c_uart_new(struct VM *vm, mrbc_value v[], int argc)
93+
static void c_uart_new(mrbc_vm *vm, mrbc_value v[], int argc)
10694
{
10795
static int uart_counter = 0;
10896
int uart_num;
@@ -140,7 +128,7 @@ static void c_uart_new(struct VM *vm, mrbc_value v[], int argc)
140128
@return String Received data.
141129
@return Nil Not enough receive length.
142130
*/
143-
static void c_uart_read(struct VM *vm, mrbc_value v[], int argc)
131+
static void c_uart_read(mrbc_vm *vm, mrbc_value v[], int argc)
144132
{
145133
mrbc_value ret;
146134
UART_HANDLE *handle = *(UART_HANDLE **)v->instance->data;
@@ -168,7 +156,7 @@ static void c_uart_read(struct VM *vm, mrbc_value v[], int argc)
168156
169157
@param s Write data.
170158
*/
171-
static void c_uart_write(struct VM *vm, mrbc_value v[], int argc)
159+
static void c_uart_write(mrbc_vm *vm, mrbc_value v[], int argc)
172160
{
173161
UART_HANDLE *handle = *(UART_HANDLE **)v->instance->data;
174162

@@ -193,7 +181,7 @@ static void c_uart_write(struct VM *vm, mrbc_value v[], int argc)
193181
@return String Received string.
194182
@return Nil Not enough receive length.
195183
*/
196-
static void c_uart_gets(struct VM *vm, mrbc_value v[], int argc)
184+
static void c_uart_gets(mrbc_vm *vm, mrbc_value v[], int argc)
197185
{
198186
mrbc_value ret;
199187
UART_HANDLE *handle = *(UART_HANDLE **)v->instance->data;
@@ -221,7 +209,7 @@ static void c_uart_gets(struct VM *vm, mrbc_value v[], int argc)
221209
222210
$uart.clear_tx_buffer()
223211
*/
224-
static void c_uart_clear_tx_buffer(struct VM *vm, mrbc_value v[], int argc)
212+
static void c_uart_clear_tx_buffer(mrbc_vm *vm, mrbc_value v[], int argc)
225213
{
226214
UART_HANDLE *handle = *(UART_HANDLE **)v->instance->data;
227215
uart_clear_tx_buffer( handle );
@@ -233,7 +221,7 @@ static void c_uart_clear_tx_buffer(struct VM *vm, mrbc_value v[], int argc)
233221
234222
$uart.clear_rx_buffer()
235223
*/
236-
static void c_uart_clear_rx_buffer(struct VM *vm, mrbc_value v[], int argc)
224+
static void c_uart_clear_rx_buffer(mrbc_vm *vm, mrbc_value v[], int argc)
237225
{
238226
UART_HANDLE *handle = *(UART_HANDLE **)v->instance->data;
239227
uart_clear_rx_buffer( handle );

PSoC5LP/uart/c_uart.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
UART class for Cypress PSoC5LP
44
55
<pre>
6-
Copyright (C) 2018 Kyushu Institute of Technology.
7-
Copyright (C) 2018 Shimane IT Open-Innovation Center.
6+
Copyright (C) 2018-2020 Kyushu Institute of Technology.
7+
Copyright (C) 2018-2020 Shimane IT Open-Innovation Center.
88
99
This file is distributed under BSD 3-Clause License.
1010
@@ -14,13 +14,11 @@
1414
#ifndef MRBC_PSOC5LP_UART_H_
1515
#define MRBC_PSOC5LP_UART_H_
1616

17-
#include "value.h"
18-
1917
#ifdef __cplusplus
2018
extern "C" {
2119
#endif
2220

23-
21+
struct VM;
2422
void mrbc_init_class_uart(struct VM *vm);
2523

2624

0 commit comments

Comments
 (0)