gustavonihei commented on a change in pull request #4586: URL: https://github.com/apache/incubator-nuttx/pull/4586#discussion_r714262313
########## File path: arch/xtensa/src/esp32s2/esp32s2_oneshot.c ########## @@ -0,0 +1,462 @@ +/**************************************************************************** + * arch/xtensa/src/esp32s2/esp32s2_oneshot.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <sys/types.h> +#include <stdbool.h> +#include <string.h> +#include <stdint.h> +#include <assert.h> +#include <errno.h> +#include <debug.h> + +#include <nuttx/arch.h> +#include <nuttx/timers/oneshot.h> +#include <nuttx/clock.h> + +#include "hardware/esp32s2_soc.h" + +#include "esp32s2_tim.h" +#include "esp32s2_clockconfig.h" +#include "esp32s2_oneshot.h" + +#ifdef CONFIG_ESP32S2_ONESHOT + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define MAX_TIMER_COUNTER UINT64_MAX + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int esp32s2_oneshot_handler(int irq, void * context, void *arg); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: esp32s2_oneshot_handler + * + * Description: + * Oneshot interrupt Handler. When any oneshot timer interrupt + * expires, this function will be triggered. It will forward the call to + * the next level up. + * + * Input Parameters: + * irq - IRQ associated to that interrupt + * arg - A pointer to the argument provided when the interrupt was + * registered. + * + * Returned Value: + * Zero on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int esp32s2_oneshot_handler(int irq, void * context, + void *arg) Review comment: ```suggestion static int esp32s2_oneshot_handler(int irq, void *context, void *arg) ``` The `*` should be next to the identifier. And these two lines may be merged. ########## File path: arch/xtensa/src/esp32s2/esp32s2_oneshot.c ########## @@ -0,0 +1,462 @@ +/**************************************************************************** + * arch/xtensa/src/esp32s2/esp32s2_oneshot.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <sys/types.h> +#include <stdbool.h> +#include <string.h> +#include <stdint.h> +#include <assert.h> +#include <errno.h> +#include <debug.h> + +#include <nuttx/arch.h> +#include <nuttx/timers/oneshot.h> +#include <nuttx/clock.h> + +#include "hardware/esp32s2_soc.h" + +#include "esp32s2_tim.h" +#include "esp32s2_clockconfig.h" +#include "esp32s2_oneshot.h" + +#ifdef CONFIG_ESP32S2_ONESHOT + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define MAX_TIMER_COUNTER UINT64_MAX + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int esp32s2_oneshot_handler(int irq, void * context, void *arg); Review comment: ```suggestion static int esp32s2_oneshot_handler(int irq, void *context, void *arg); ``` -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
