apache-mynewt-bot removed a comment on issue #2259: ARM semihosting console on 
pinetime
URL: https://github.com/apache/mynewt-core/pull/2259#issuecomment-608018497
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/drivers/semihosting/include/semihosting/mbed_semihost_api.h
   <details>
   
   ```diff
   @@ -1,4 +1,3 @@
   -
    /* mbed Microcontroller Library
     * Copyright (c) 2006-2019 ARM Limited
     * SPDX-License-Identifier: Apache-2.0
   @@ -27,7 +26,8 @@
    #if !defined(__ARMCC_VERSION)
    
    #if defined(__ICCARM__)
   -static inline int __semihost(int reason, const void *arg)
   +static inline int
   +__semihost(int reason, const void *arg)
    {
        return __semihosting(reason, (void *)arg);
    }
   @@ -43,19 +43,20 @@
    #   define AngelSWIAsm          swi
    #endif
    
   -static inline int __semihost(int reason, const void *arg)
   +static inline int
   +__semihost(int reason, const void *arg)
    {
        int value;
    
   -    asm volatile(
   +    asm volatile (
            "mov r0, %1"          "\n\t"
            "mov r1, %2"          "\n\t"
            AngelSWIInsn " %a3"   "\n\t"
            "mov %0, r0"
   -        : "=r"(value)                                          /* output 
operands             */
   -        : "r"(reason), "r"(arg), "i"(AngelSWI)                 /* input 
operands              */
   +        : "=r" (value)                                          /* output 
operands             */
   +        : "r" (reason), "r" (arg), "i" (AngelSWI)                 /* input 
operands              */
            : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc"   /* list of 
clobbered registers */
   -    );
   +        );
    
        return value;
    }
   ```
   
   </details>
   
   #### hw/drivers/semihosting/src/mbed_semihost_api.c
   <details>
   
   ```diff
   @@ -20,7 +20,7 @@
    #include <stdint.h>
    #include <string.h>
    
   -// ARM Semihosting Commands
   +/* ARM Semihosting Commands */
    #define SYS_OPEN   (0x1)
    #define SYS_CLOSE  (0x2)
    #define SYS_WRITE  (0x5)
   @@ -33,7 +33,8 @@
    #define SYS_RENAME (0xf)
    #define SYS_EXIT   (0x18)
    
   -FILEHANDLE semihost_open(const char *name, int openmode)
   +FILEHANDLE
   +semihost_open(const char *name, int openmode)
    {
        uint32_t args[3];
        args[0] = (uint32_t)name;
   @@ -42,12 +43,14 @@
        return __semihost(SYS_OPEN, args);
    }
    
   -int semihost_close(FILEHANDLE fh)
   +int
   +semihost_close(FILEHANDLE fh)
    {
        return __semihost(SYS_CLOSE, &fh);
    }
    
   -int semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int 
length, int mode)
   +int
   +semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int 
length, int mode)
    {
        if (length == 0) {
            return 0;
   @@ -60,7 +63,8 @@
        return __semihost(SYS_WRITE, args);
    }
    
   -int semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int 
length, int mode)
   +int
   +semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int length, 
int mode)
    {
        uint32_t args[3];
        args[0] = (uint32_t)fh;
   @@ -69,12 +73,14 @@
        return __semihost(SYS_READ, args);
    }
    
   -int semihost_istty(FILEHANDLE fh)
   +int
   +semihost_istty(FILEHANDLE fh)
    {
        return __semihost(SYS_ISTTY, &fh);
    }
    
   -int semihost_seek(FILEHANDLE fh, long position)
   +int
   +semihost_seek(FILEHANDLE fh, long position)
    {
        uint32_t args[2];
        args[0] = (uint32_t)fh;
   @@ -82,17 +88,20 @@
        return __semihost(SYS_SEEK, args);
    }
    
   -int semihost_ensure(FILEHANDLE fh)
   +int
   +semihost_ensure(FILEHANDLE fh)
    {
        return __semihost(SYS_ENSURE, &fh);
    }
    
   -long semihost_flen(FILEHANDLE fh)
   +long
   +semihost_flen(FILEHANDLE fh)
    {
        return __semihost(SYS_FLEN, &fh);
    }
    
   -int semihost_remove(const char *name)
   +int
   +semihost_remove(const char *name)
    {
        uint32_t args[2];
        args[0] = (uint32_t)name;
   @@ -100,7 +109,8 @@
        return __semihost(SYS_REMOVE, args);
    }
    
   -int semihost_rename(const char *old_name, const char *new_name)
   +int
   +semihost_rename(const char *old_name, const char *new_name)
    {
        uint32_t args[4];
        args[0] = (uint32_t)old_name;
   @@ -110,13 +120,15 @@
        return __semihost(SYS_RENAME, args);
    }
    
   -int semihost_exit(void)
   +int
   +semihost_exit(void)
    {
        uint32_t args[4];
        return __semihost(SYS_EXIT, args);
    }
    
   -int semihost_connected(void)
   +int
   +semihost_connected(void)
    {
        return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? 1 : 0;
    }
   ```
   
   </details>
   
   #### sys/console/full/src/semihosting_console.c
   <details>
   
   ```diff
   @@ -25,7 +25,7 @@
    static unsigned char 
semihosting_tx_buffer[MYNEWT_VAL(CONSOLE_SEMIHOSTING_TX_BUF_SIZE)];
    static unsigned char *semihosting_tx_buffer_pos = semihosting_tx_buffer;
    
   -static void 
   +static void
    semihosting_console_flush(void)
    {
        unsigned int size = semihosting_tx_buffer_pos - semihosting_tx_buffer;
   @@ -33,18 +33,18 @@
        semihosting_tx_buffer_pos = semihosting_tx_buffer;
    }
    
   -static void 
   +static void
    semihosting_console_flush_event(struct os_event *ev)
    {
        semihosting_console_flush();
    }
    
   -static void 
   +static void
    semihosting_console_write(unsigned char c)
    {
        *semihosting_tx_buffer_pos = c;
        semihosting_tx_buffer_pos++;
   -    if(semihosting_tx_buffer_pos > semihosting_tx_buffer + 
sizeof(semihosting_tx_buffer)) {
   +    if (semihosting_tx_buffer_pos > semihosting_tx_buffer + 
sizeof(semihosting_tx_buffer)) {
            semihosting_console_flush();
        }
    }
   ```
   
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to